From 944f19454e3acc6d46ae71fcddb41eaefca2b815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20L=C3=A1szl=C3=B3=20Kulcs=C3=A1r?= Date: Thu, 14 Nov 2024 15:13:56 +0100 Subject: [PATCH] WIP: Add coremark as a program to test and a program builder script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .gitmodules | 3 ++ test/programs/build_programs.py | 47 +++++++++++++++++++ test/programs/coremark | 1 + .../wabt/src/walrus/binary-reader-walrus.cc | 5 +- 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 test/programs/build_programs.py create mode 160000 test/programs/coremark diff --git a/.gitmodules b/.gitmodules index 47248cc92..20c09e32b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/test/programs/build_programs.py b/test/programs/build_programs.py new file mode 100644 index 000000000..418ce70e0 --- /dev/null +++ b/test/programs/build_programs.py @@ -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() diff --git a/test/programs/coremark b/test/programs/coremark new file mode 160000 index 000000000..d5fad6bd0 --- /dev/null +++ b/test/programs/coremark @@ -0,0 +1 @@ +Subproject commit d5fad6bd094899101a4e5fd53af7298160ced6ab diff --git a/third_party/wabt/src/walrus/binary-reader-walrus.cc b/third_party/wabt/src/walrus/binary-reader-walrus.cc index 4a94fd7b4..d25a58cb6 100644 --- a/third_party/wabt/src/walrus/binary-reader-walrus.cc +++ b/third_party/wabt/src/walrus/binary-reader-walrus.cc @@ -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; }