Skip to content

Commit

Permalink
WIP: Add coremark as a program to test and a program builder script
Browse files Browse the repository at this point in the history
The section 'target_features' needs to be implemented to work with wasi-clang
compilation.
Add build_programs.py.

Signed-off-by: Ádám László Kulcsár <kuladam@inf.u-szeged.hu>
  • Loading branch information
kulcsaradam committed Nov 14, 2024
1 parent cf9333d commit 944f194
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
path = third_party/uvwasi/uvwasi
url = https://github.com/nodejs/uvwasi
ignore = untracked
[submodule "test/programs/coremark"]
path = test/programs/coremark
url = https://github.com/eembc/coremark.git
47 changes: 47 additions & 0 deletions test/programs/build_programs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3

# Copyright 2023-present Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse
import os

from os.path import abspath, dirname, join

PROGRAMS_SOURCE_DIR = dirname(abspath(__file__))

def compile_coremark():
return

def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--all", help="compile all programs", action="store_true", default=True)
parser.add_argument("--coremark", help="compile coremark", action="store_true")
parser.add_argument("--summary", help="Generate summary", action="store_true", default=False)
args = parser.parse_args()

args.orig_results = args.results.copy()
return args

def main():
args = parse_args()

if args.all:
compile_coremark()

print("All programs compiled succesfully!")
return

if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions test/programs/coremark
Submodule coremark added at d5fad6
5 changes: 1 addition & 4 deletions third_party/wabt/src/walrus/binary-reader-walrus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1258,20 +1258,17 @@ class BinaryReaderDelegateWalrus: public BinaryReaderDelegate {
}

/* target_features section */
// TODO: Add feature tests for building with wasi-clang.
Result BeginTargetFeaturesSection(Offset size) override {
abort();
return Result::Ok;
}
Result OnFeatureCount(Index count) override {
abort();
return Result::Ok;
}
Result OnFeature(uint8_t prefix, nonstd::string_view name) override {
abort();
return Result::Ok;
}
Result EndTargetFeaturesSection() override {
abort();
return Result::Ok;
}

Expand Down

0 comments on commit 944f194

Please sign in to comment.