added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
SUMMARY = "Bash Automated Testing System"
DESCRIPTION = "Bats is a TAP-compliant testing framework for Bash. It \
provides a simple way to verify that the UNIX programs you write behave as expected."
AUTHOR = "Sam Stephenson & bats-core organization"
HOMEPAGE = "https://github.com/bats-core/bats-core"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=2970203aedf9e829edb96a137a4fe81b"
SRC_URI = "\
git://github.com/bats-core/bats-core.git;branch=master;protocol=https \
"
# v1.9.0
SRCREV = "6636e2c2ef5ffe361535cb45fc61682c5ef46b71"
S = "${WORKDIR}/git"
# Numerous scripts assume ${baselib} == lib, which is not true.
#
do_configure:prepend() {
for f in ${S}/libexec/bats-core/* ${S}/lib/bats-core/* ; do
sed -i 's:\$BATS_ROOT/lib/:\$BATS_ROOT/${baselib}/:g' $f
done
}
do_install() {
# Just a bunch of bash scripts to install
${S}/install.sh ${D}${prefix} ${baselib}
}
RDEPENDS:${PN} = "bash"
FILES:${PN} += "${libdir}/bats-core/*"
PACKAGECONFIG ??= "pretty"
PACKAGECONFIG[pretty] = ",,,ncurses"

View File

@@ -0,0 +1,22 @@
DESCRIPTION = "A modern, C++-native, header-only, test framework for unit-tests, \
TDD and BDD - using C++11, C++14, C++17 and later."
AUTHOR = "Phil Nash, Martin Horenovsky and others"
HOMEPAGE = "https://github.com/catchorg/Catch2"
LICENSE = "BSL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
SRC_URI = "git://github.com/catchorg/Catch2.git;branch=v2.x;protocol=https"
SRCREV = "c4e3767e265808590986d5db6ca1b5532a7f3d13"
S = "${WORKDIR}/git"
inherit cmake python3native
do_install:append() {
rm ${D}${datadir}/Catch2/lldbinit
rm ${D}${datadir}/Catch2/gdbinit
rmdir ${D}${datadir}/Catch2/
}
# Header-only library
RDEPENDS:${PN}-dev = ""
RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"

View File

@@ -0,0 +1,44 @@
DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
objects. It only requires the standard C library, works on a range of computing \
platforms (including embedded) and with different compilers."
HOMEPAGE = "https://cmocka.org/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313"
PV .= "+git${SRCPV}"
SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \
file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \
file://run-ptest \
"
S = "${WORKDIR}/git"
inherit cmake ptest
EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
# Use -Wl,wrap linker flag, which does not work with LTO
LTO = ""
do_install:append () {
install -d ${D}${datadir}/${BPN}/example
install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
install -d ${D}${datadir}/${BPN}/example/mock/uptime
install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${datadir}/${BPN}/example/mock/libproc_uptime.so
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
}
PACKAGE_BEFORE_PN += "${PN}-examples"
FILES:${PN}-examples = "${datadir}/${BPN}/example"
INSANE_SKIP:${PN}-examples = "libdir"

View File

@@ -0,0 +1,43 @@
From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001
From: Breno Leitao <breno.leitao@gmail.com>
Date: Tue, 21 Mar 2023 21:58:28 -0700
Subject: [PATCH] include: Check for previous declaration of uintptr_t
Adding a extra check before declaring uintptr_t. Currently musl uses
macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
this macro before defining it, and, defining it when uintptr_t is
defined.
Taken from Alpine
Upstream-Status: Pending
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
include/cmocka.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/cmocka.h b/include/cmocka.h
index a21d965..f540793 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -121,7 +121,7 @@ typedef uintmax_t LargestIntegralType;
((LargestIntegralType)(value))
/* Smallest integral type capable of holding a pointer. */
-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T)
+#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) && !defined(__DEFINED_uintptr_t)
# if defined(_WIN32)
/* WIN32 is an ILP32 platform */
typedef unsigned int uintptr_t;
@@ -147,6 +147,7 @@ typedef uintmax_t LargestIntegralType;
# define _UINTPTR_T
# define _UINTPTR_T_DEFINED
+# define __DEFINED_uintptr_t
#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
/* Perform an unsigned cast to uintptr_t. */
--
2.40.0

View File

@@ -0,0 +1,10 @@
#!/bin/sh
cd tests
for i in `ls *`; do
if [ ./$i ] ; then
echo "PASS: $i"
else
echo "FAIL: $i"
fi
done

View File

@@ -0,0 +1,16 @@
DESCRIPTION = "CppUnit is the C++ port of the famous JUnit framework for unit testing. Test output is in XML for automatic testing and GUI based for supervised tests. "
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/cppunit"
LICENSE = "LGPL-2.1-only"
SECTION = "libs"
LIC_FILES_CHKSUM = "file://COPYING;md5=b0e9ef921ff780eb328bdcaeebec3269"
SRC_URI = " \
http://dev-www.libreoffice.org/src/cppunit-${PV}.tar.gz \
file://0001-doc-Makefile.am-do-not-preserve-file-flags-when-copy.patch \
"
SRC_URI[md5sum] = "9dc669e6145cadd9674873e24943e6dd"
SRC_URI[sha256sum] = "89c5c6665337f56fd2db36bc3805a5619709d51fb136e51937072f63fcc717a7"
inherit autotools
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,28 @@
From 9d7ce869607d123cd9837890d71f940c5ced3393 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Mon, 29 Feb 2016 07:58:20 +0100
Subject: [PATCH] doc/Makefile.am: do not preserve file flags when copying
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [cross specific]
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
doc/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8815476..3237499 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -8,7 +8,7 @@ htmldir += $(pkgdatadir)/html
html_DATA += $(static_pages) html/index.html
install-data-hook:
- cp -pR html/* $(DESTDIR)$(htmldir)
+ cp -R html/* $(DESTDIR)$(htmldir)
uninstall-local:
rm -rf $(DESTDIR)$(htmldir)

View File

@@ -0,0 +1,25 @@
SUMMARY = "CppUTest unit testing and mocking framework for C/C++"
HOMEPAGE = "http://cpputest.github.io/"
SECTION = "devel"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=ce5d5f1fe02bcd1343ced64a06fd4177"
SRC_URI = "git://github.com/cpputest/cpputest.git;protocol=https;branch=master"
SRCREV = "67d2dfd41e13f09ff218aa08e2d35f1c32f032a1"
S = "${WORKDIR}/git"
inherit cmake
EXTRA_OECMAKE = "-DLONGLONG=ON \
-DC++11=ON \
-DTESTS=OFF \
"
DEV_PKG_DEPENDENCY = ""
FILES:${PN}-dev += "${libdir}/CppUTest/cmake/*"
PACKAGECONFIG ??= ""
PACKAGECONFIG[extensions] = "-DEXTENSIONS=ON,-DEXTENSIONS=OFF"

View File

@@ -0,0 +1,19 @@
SUMMARY = "Linux firmware validation framework"
DESCRIPTION = "Cukinia is designed to help Linux-based embedded firmware \
developers run simple system-level validation tests on their firmware."
HOMEPAGE = "https://github.com/savoirfairelinux/cukinia"
LICENSE = "GPL-3.0-only & Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://github.com/savoirfairelinux/cukinia.git;protocol=https;branch=master"
SRCREV = "b074be54a1379ae1243ae1187f892aeb39b7c083"
S = "${WORKDIR}/git"
do_install () {
install -d ${D}${sbindir}
install -m 0755 ${S}/cukinia ${D}${sbindir}
}

View File

@@ -0,0 +1,37 @@
DESCRIPTION = "CUnit is a C framework for unit testing. Test output supports comandline and GUI results reporting"
HOMEPAGE = "http://cunit.sourceforge.net"
LICENSE = "LGPL-2.0-only"
SECTION = "libs"
LIC_FILES_CHKSUM = "file://COPYING;md5=7734aa853b85d6f935466f081490ddbb"
S = "${WORKDIR}/CUnit-${PV}"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/cunit/CUnit/${PV}/CUnit-${PV}.tar.bz2 \
file://fixup-install-docdir.patch \
file://run-ptest \
"
SRC_URI[md5sum] = "b5f1a9f6093869c070c6e4a9450cc10c"
SRC_URI[sha256sum] = "f5b29137f845bb08b77ec60584fdb728b4e58f1023e6f249a464efa49a40f214"
UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cunit/files/releases"
inherit autotools-brokensep ptest
EXTRA_OECONF = "--enable-memtrace --enable-automated --enable-basic --enable-console"
TESTBIN = "/CUnit/Sources/Test/test_cunit"
PACKAGECONFIG ?= "${@bb.utils.contains('PTEST_ENABLED', '1', 'test','', d)} \
"
PACKAGECONFIG[test] = "--enable-test,,,"
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
install -m 0755 ${S}${TESTBIN} ${D}${PTEST_PATH}/tests/
}
FILES:${PN}-dev += "${datadir}/CUnit"
FILES:${PN}-doc += "${docdir}"
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,36 @@
From: "Mike Holmes" <mike.holmes@linaro.org>
Date: Thu, 30 October 2014 16:21:03 -0500
Subject: [PATCH] fixup-install-docdir
The default configuration macros for CUnit install the documentation and
header files in locations not consistent with the OE filesystem layout.
So here we specify new locations which are consistent with OE filesystems.
Upstream-Status: Inappropriate - configuration for OE build environment
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
---
diff -uNr a/doc/headers/Makefile.am b/doc/headers/Makefile.am
--- a/doc/headers/Makefile.am 2014-10-30 22:06:29.704574162 +0100
+++ b/doc/headers/Makefile.am 2014-10-30 22:07:43.578524791 +0100
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-dochdrdir = $(prefix)/doc/@PACKAGE@/headers
+dochdrdir = $(docdir)/headers
INCLUDE_FILES = \
Automated.h \
diff -uNr a/doc/Makefile.am b/doc/Makefile.am
--- a/doc/Makefile.am 2014-10-30 22:06:29.704574162 +0100
+++ b/doc/Makefile.am 2014-10-30 22:07:01.461412166 +0100
@@ -1,7 +1,5 @@
## Process this file with automake to produce Makefile.in
-docdir = $(prefix)/doc/@PACKAGE@
-
doc_DATA = \
CUnit_doc.css \
error_handling.html \

View File

@@ -0,0 +1,19 @@
#!/bin/sh
ptestdir=$(dirname "$(readlink -f "$0")")
cd $ptestdir/tests
./test_cunit > cunit_test_out.tmp
echo "--- Test output ---"
cat cunit_test_out.tmp
echo ""
echo "--- ptest result ---"
grep "Failures: 0" cunit_test_out.tmp > /dev/null
if [ $? -eq 0 ]; then
echo "PASS: cunit"
else
echo "FAIL: cunit"
fi
rm -f cunit_test_out.tmp

View File

@@ -0,0 +1,25 @@
DESCRIPTION = "CxxTest is a unit testing framework for C++ that is similar in spirit to JUnit, CppUnit, and xUnit."
HOMEPAGE = "http://cxxtest.com/"
SECTION = "devel"
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02"
SRC_URI = "http://downloads.sourceforge.net/project/cxxtest/cxxtest/${PV}/${BP}.tar.gz"
SRC_URI[md5sum] = "c3cc3355e2ac64e34c215f28e44cfcec"
SRC_URI[sha256sum] = "1c154fef91c65dbf1cd4519af7ade70a61d85a923b6e0c0b007dc7f4895cf7d8"
inherit setuptools3
PIP_INSTALL_DIST_PATH = "${B}/python/python3/dist"
SETUPTOOLS_SETUP_PATH = "${S}/python"
do_install:append() {
install -d ${D}${includedir}
cp -a ${S}/cxxtest/ ${D}${includedir}
# Fix the interpretter as otherwise this points to the build host python
sed '1c\
#!/usr/bin/env python3' -i ${D}${bindir}/cxxtestgen
}
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,33 @@
From 490f5b6cd788692d989f07180a5714c76872911e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 30 Nov 2019 11:58:58 -0800
Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
time element is deprecated on new input_event structure in kernel's
input.h [1]
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
Upstream-Status: Submitted [https://gitlab.freedesktop.org/libevdev/evtest/merge_requests/6]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
evtest.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/evtest.c b/evtest.c
index ba7a161..8fc2e5a 100644
--- a/evtest.c
+++ b/evtest.c
@@ -63,6 +63,11 @@
#define input_event_usec time.tv_usec
#endif
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#endif
+
#define BITS_PER_LONG (sizeof(long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)

View File

@@ -0,0 +1,17 @@
SUMMARY = "Simple tool for input event debugging"
HOMEPAGE = "http://people.freedesktop.org/~whot/evtest/"
AUTHOR = "Vojtech Pavlik <vojtech@suse.cz>"
SECTION = "console/utils"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
DEPENDS = "libxml2"
SRCREV = "da347a8f88d2e5729dd12d61ee9743f902065b55"
SRC_URI = "git://gitlab.freedesktop.org/libevdev/evtest.git;protocol=https;branch=master \
file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
"
S = "${WORKDIR}/git"
inherit autotools pkgconfig

View File

@@ -0,0 +1,18 @@
SUMMARY = "Test suite for Linux framebuffer"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
SRCREV = "063ec650960c2d79ac51f5c5f026cb05343a33e2"
SRC_URI = "git://github.com//ponty/fb-test-app.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 fb-test ${D}${bindir}
# avoid collisions with perf (perf) and mesa-demos (offset)
for prog in perf rect offset ; do
install -m 0755 $prog ${D}${bindir}/fb-$prog
done
}

View File

@@ -0,0 +1,42 @@
From ee787b53d734cd952c170c9303d213d3dd18a86f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 8 Jun 2017 16:49:50 -0700
Subject: [PATCH 1/6] Add correct printf qualifier for off_t
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/bios/ebda_region/ebda_region.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/bios/ebda_region/ebda_region.c b/src/bios/ebda_region/ebda_region.c
index b70ced10..947a24bd 100644
--- a/src/bios/ebda_region/ebda_region.c
+++ b/src/bios/ebda_region/ebda_region.c
@@ -83,9 +83,9 @@ static int ebda_test1(fwts_framework *fw)
if ((entry != NULL) &&
(entry->type == FWTS_MEMORY_MAP_RESERVED ||
entry->type == FWTS_MEMORY_MAP_ACPI)) {
- fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved as a %" PRId64
+ fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved as a %" PRId64
"K region in the %s table at 0x%" PRIx64 "..0x%" PRIx64 ".",
- ebda_addr,
+ (intmax_t)ebda_addr,
(entry->end_address - entry->start_address) / 1024,
memory_map_name,
entry->start_address,
@@ -93,9 +93,9 @@ static int ebda_test1(fwts_framework *fw)
} else
fwts_failed(fw, LOG_LEVEL_MEDIUM,
"EBDAMappedNotReserved",
- "EBDA region mapped at 0x%lx but not reserved in the %s table.",
- ebda_addr, memory_map_name);
-
+ "EBDA region mapped at 0x%jdx but not reserved in the %s table.",
+ (intmax_t)ebda_addr, memory_map_name);
+
return FWTS_OK;
}
--
2.25.1

View File

@@ -0,0 +1,68 @@
From 6135a318dd48787f1b6e1296c755d67575f44dc1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 1 Dec 2022 15:18:55 -0800
Subject: [PATCH] libfwtsiasl: Disable parallel builds of lex/bison files
Since they are using mv cmds they maybe conflicting with each other in
highly parallelized build resulting in errors like
| mv dtcompilerparser.tab.c dtcompilerparser.c
| mv dtcompilerparser.tab.c dtcompilerparser.c
| cp dtcompilerparser.tab.h dtcompilerparser.y.h
| mv dtcompilerparser.tab.c dtcompilerparser.c
| mv: cannot stat 'dtcompilerparser.tab.c': No such file or directory
| make[3]: *** [Makefile:4196: dtcompilerparser.c] Error 1
| make[3]: *** Waiting for unfinished jobs....
| mv: cannot stat 'dtcompilerparser.tab.c': No such file or directory
| make[3]: *** [Makefile:4194: dtcompilerparser.y.h] Error 1
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/libfwtsiasl/Makefile.am | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/src/libfwtsiasl/Makefile.am
+++ b/src/libfwtsiasl/Makefile.am
@@ -58,32 +58,24 @@ aslcompiler.y: $(ASL_PARSER)
aslcompilerlex.c: $(ASL_LEXER)
${LEX} ${AM_LFLAGS} -PAslCompiler -o$@ $(top_srcdir)/src/acpica/source/compiler/aslcompiler.l
-.NOTPARALLEL: aslcompiler.c
+.NOTPARALLEL: aslcompiler.c aslcompiler.y.h
aslcompiler.c aslcompiler.y.h: aslcompiler.y
- ${YACC} ${AM_YFLAGS} -d -baslcompiler -pAslCompiler $^
- mv aslcompiler.tab.c aslcompiler.c
- cp aslcompiler.tab.h aslcompiler.y.h
+ ${YACC} ${AM_YFLAGS} -d -baslcompiler -pAslCompiler --header=aslcompiler.y.h --output=aslcompiler.c $^
-.NOTPARALLEL: dtcompilerparserlex.c
+.NOTPARALLEL: dtcompilerparserlex.c dtcompilerparser.c dtcompilerparser.y.h
dtcompilerparserlex.c dtcompilerparser.c dtcompilerparser.y.h: $(top_srcdir)/src/acpica/source/compiler/dtcompilerparser.l $(top_srcdir)/src/acpica/source/compiler/dtcompilerparser.y
${LEX} ${AM_LFLAGS} -PDtCompilerParser -odtcompilerparserlex.c $<
- ${YACC} ${AM_YFLAGS} -bdtcompilerparser -pDtCompilerParser $(top_srcdir)/src/acpica/source/compiler/dtcompilerparser.y
- mv dtcompilerparser.tab.c dtcompilerparser.c
- cp dtcompilerparser.tab.h dtcompilerparser.y.h
+ ${YACC} ${AM_YFLAGS} -bdtcompilerparser -pDtCompilerParser --header=dtcompilerparser.y.h --output=dtcompilerparser.c $(top_srcdir)/src/acpica/source/compiler/dtcompilerparser.y
-.NOTPARALLEL: dtparserlex.c
+.NOTPARALLEL: dtparserlex.c dtparser.c dtparser.y.h
dtparserlex.c dtparser.c dtparser.y.h: $(top_srcdir)/src/acpica/source/compiler/dtparser.l $(top_srcdir)/src/acpica/source/compiler/dtparser.y
${LEX} ${AM_LFLAGS} -PDtParser -odtparserlex.c $<
- ${YACC} ${AM_YFLAGS} -bdtparser -pDtParser $(top_srcdir)/src/acpica/source/compiler/dtparser.y
- mv dtparser.tab.c dtparser.c
- cp dtparser.tab.h dtparser.y.h
+ ${YACC} ${AM_YFLAGS} -bdtparser -pDtParser --header=dtparser.y.h --output=dtparser.c $(top_srcdir)/src/acpica/source/compiler/dtparser.y
-.NOTPARALLEL: prparserlex.c
+.NOTPARALLEL: prparserlex.c prparser.c prparser.y.h
prparserlex.c prparser.c prparser.y.h: $(top_srcdir)/src/acpica/source/compiler/prparser.l $(top_srcdir)/src/acpica/source/compiler/prparser.y
${LEX} ${AM_LFLAGS} -PPrParser -oprparserlex.c $<
- ${YACC} ${AM_YFLAGS} -bprparser -pPrParser $(top_srcdir)/src/acpica/source/compiler/prparser.y
- mv prparser.tab.c prparser.c
- cp prparser.tab.h prparser.y.h
+ ${YACC} ${AM_YFLAGS} -bprparser -pPrParser --header=prparser.y.h --output=prparser.c $(top_srcdir)/src/acpica/source/compiler/prparser.y
pkglib_LTLIBRARIES = libfwtsiasl.la

View File

@@ -0,0 +1,45 @@
From 7317aba872f2bcf052a7db9fa3c7a7ce3c55dc6b Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Mon, 21 Aug 2017 10:34:40 +0200
Subject: [PATCH 3/6] Remove -Werror from build
Upstream-Status: Pending
---
src/Makefile.am | 2 +-
src/lib/src/Makefile.am | 2 +-
src/utilities/Makefile.am | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/efi_runtime \
-I$(top_srcdir)/smccc_test \
-pthread \
- -Wall -Werror -Wextra \
+ -Wall -Wextra \
-Wno-address-of-packed-member \
-Wfloat-equal -Wmissing-declarations \
-Wno-long-long -Wredundant-decls -Wshadow \
--- a/src/lib/src/Makefile.am
+++ b/src/lib/src/Makefile.am
@@ -22,7 +22,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/acpica/source/include \
-I$(top_srcdir)/src/acpica/source/compiler \
-DDATAROOTDIR=\"$(datarootdir)\" \
- -Wall -Werror -Wextra \
+ -Wall -Wextra \
-Wno-address-of-packed-member
pkglib_LTLIBRARIES = libfwts.la
--- a/src/utilities/Makefile.am
+++ b/src/utilities/Makefile.am
@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-AM_CPPFLAGS = -Wall -Werror -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \
+AM_CPPFLAGS = -Wall -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \
-I$(srcdir)/../lib/include
bin_PROGRAMS = kernelscan

View File

@@ -0,0 +1,28 @@
From 9456f2f779d3ed4a134d55571d8bec78ad3b28c1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 6 Jun 2017 07:37:20 -0700
Subject: [PATCH 4/6] Define __SWORD_TYPE if not defined by libc
__SWORD_TYPE is internal to glibc, therefore
check and define it if needed e.g. on musl
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/lib/src/fwts_uefi.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/lib/src/fwts_uefi.c
+++ b/src/lib/src/fwts_uefi.c
@@ -63,6 +63,10 @@ typedef struct {
#define UEFI_IFACE_SYSFS (2) /* sysfs */
#define UEFI_IFACE_EFIVARS (3) /* efivar fs */
+#ifndef __SWORD_TYPE
+typedef __typeof__( ((struct statfs *)0)->f_type ) __SWORD_TYPE;
+#endif
+
/* File system magic numbers */
#define PSTOREFS_MAGIC ((__SWORD_TYPE)0x6165676C)
#define EFIVARFS_MAGIC ((__SWORD_TYPE)0xde5e81e4)

View File

@@ -0,0 +1,25 @@
From 53b9f97fb7faed043134f2ab738347b20379d32f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 6 Jun 2017 07:39:28 -0700
Subject: [PATCH 5/6] Undefine PAGE_SIZE
musl defines PAGE_SIZE and build complains
of multiple definitions
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/lib/src/fwts_acpi_tables.c | 1 +
1 file changed, 1 insertion(+)
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -40,6 +40,7 @@
#define BIOS_START (0x000e0000) /* Start of BIOS memory */
#define BIOS_END (0x000fffff) /* End of BIOS memory */
#define BIOS_LENGTH (BIOS_END - BIOS_START) /* Length of BIOS memory */
+#undef PAGE_SIZE
#define PAGE_SIZE (4096)
static fwts_acpi_table_info tables[ACPI_MAX_TABLES];

View File

@@ -0,0 +1,58 @@
From f723458eb649a9ad1d5d0e3dd6e801b284680fa7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 8 Jun 2017 16:50:59 -0700
Subject: [PATCH 6/6] use intptr_t to fix pointer-to-int-cast issues
uintptr_t is guaranteed to be wide enough that
converting a void* to uintptr_t and back again
will yield the original pointer value
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/lib/src/fwts_acpi_tables.c | 4 ++--
src/lib/src/fwts_mmap.c | 2 +-
src/lib/src/fwts_smbios.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -171,7 +171,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_g
return NULL;
}
- if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED)
+ if ((mem = fwts_mmap((uintptr_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED)
return NULL;
if (fwts_safe_memcpy(rsdp, mem, sizeof(fwts_acpi_table_rsdp)) != FWTS_OK) {
@@ -484,7 +484,7 @@ static int fwts_acpi_load_tables_from_fi
if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL)
return FWTS_ERROR;
- fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);
+ fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(uintptr_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);
/* Load any tables from XSDT if it's valid */
if (rsdp->xsdt_address) {
--- a/src/lib/src/fwts_mmap.c
+++ b/src/lib/src/fwts_mmap.c
@@ -82,7 +82,7 @@ int fwts_munmap(void *mem, const size_t
off_t offset;
page_size = fwts_page_size();
- offset = ((off_t)(mem)) & (page_size - 1);
+ offset = ((uintptr_t)(mem)) & (page_size - 1);
if (munmap((void *)((uint8_t *)mem - offset), size + offset) < 0)
return FWTS_ERROR;
--- a/src/lib/src/fwts_smbios.c
+++ b/src/lib/src/fwts_smbios.c
@@ -78,7 +78,7 @@ static void *fwts_smbios_find_entry_uefi
if ((addr = fwts_scan_efi_systab(smbios)) != NULL) {
fwts_smbios_entry *mapped_entry;
- if ((mapped_entry = fwts_mmap((off_t)addr, size)) != FWTS_MAP_FAILED) {
+ if ((mapped_entry = fwts_mmap((uintptr_t)addr, size)) != FWTS_MAP_FAILED) {
if (fwts_safe_memcpy(entry, mapped_entry, size) == FWTS_OK) {
(void)fwts_munmap(mapped_entry, size);
*type = FWTS_SMBIOS;

View File

@@ -0,0 +1,35 @@
SUMMARY = "Firmware testsuite"
DESCRIPTION = "The tool fwts comprises of over fifty tests that are designed to exercise and test different aspects of a machine's firmware. Many of these tests need super user access to read BIOS data and ACPI tables, so the tool requires running with super user privileges (e.g. with sudo)."
HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"
SRC_URI = "http://fwts.ubuntu.com/release/fwts-V${PV}.tar.gz;subdir=${BP} \
file://0001-Add-correct-printf-qualifier-for-off_t.patch \
file://0003-Remove-Werror-from-build.patch \
file://0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \
file://0005-Undefine-PAGE_SIZE.patch \
file://0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \
file://0001-libfwtsiasl-Disable-parallel-builds-of-lex-bison-fil.patch \
"
SRC_URI[sha256sum] = "4af4e1e0f1ae9313297af722d744ba47a81c81bc5bdeab3f4f40837a39e4b808"
COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux"
DEPENDS = "libpcre glib-2.0 dtc bison-native flex-native libbsd"
DEPENDS:append:libc-musl = " libexecinfo"
inherit autotools bash-completion pkgconfig
LDFLAGS:append:libc-musl = " -lexecinfo"
# We end up linker barfing with undefined symbols on ppc64 but not on other arches
# surprisingly
ASNEEDED:powerpc64le = ""
FILES:${PN} += "${libdir}/fwts/lib*${SOLIBS}"
FILES:${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la"
FILES:${PN}-staticdev += "${libdir}/fwts/lib*a"
RDEPENDS:${PN} += "dtc"

View File

@@ -0,0 +1,28 @@
DESCRIPTION = "Google's framework for writing C++ tests"
HOMEPAGE = "https://github.com/google/googletest"
SECTION = "libs"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cbbd27594afd089daa160d3a16dd515a"
PROVIDES += "gmock gtest"
S = "${WORKDIR}/git"
SRCREV = "b796f7d44681514f58a683a3a71ff17c94edb0c1"
SRC_URI = "git://github.com/google/googletest.git;branch=main;protocol=https"
inherit cmake
ALLOW_EMPTY:${PN} = "1"
ALLOW_EMPTY:${PN}-dbg = "1"
RDEPENDS:${PN}-dev += "${PN}-staticdev"
BBCLASSEXTEND = "native nativesdk"
do_configure:prepend() {
# explicitly use python3
# the scripts are already python3 compatible since https://github.com/google/googletest/commit/d404af0d987a9c38cafce82a7e26ec8468c88361 and other fixes like this
# but since this oe-core change http://git.openembedded.org/openembedded-core/commit/?id=5f8f16b17f66966ae91aeabc23e97de5ecd17447
# there isn't python in HOSTTOOLS so "env python" fails
sed -i 's@^#!/usr/bin/env python$@#!/usr/bin/env python3@g' ${S}/googlemock/test/*py ${S}/googletest/test/*py
}

View File

@@ -0,0 +1,13 @@
DESCRIPTION = "Linux Serial Test Application"
HOMEPAGE = "https://github.com/cbrake/linux-serial-test"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSES/MIT;md5=544799d0b492f119fa04641d1b8868ed"
SRC_URI = "git://github.com/cbrake/linux-serial-test.git;protocol=https;branch=master"
PV = "0+git${SRCPV}"
SRCREV = "cacd2790eae7bf4767d4243f5b31134698d3b20d"
S = "${WORKDIR}/git"
inherit cmake

View File

@@ -0,0 +1,69 @@
DESCRIPTION = "Utilities for testing Power Management"
HOMEPAGE = "https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQa"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
PV = "0.5.2"
BRANCH ?= "master"
SRCREV = "05710ec5032be4c8edafb4109d4d908d31243906"
SRC_URI = "git://git.linaro.org/power/pm-qa.git;protocol=git;branch=${BRANCH}"
S = "${WORKDIR}/git"
CFLAGS += "-pthread"
do_compile () {
# Find all the .c files in this project and build them.
for x in `find . -name "*.c"`
do
util=`echo ${x} | sed s/.c$//`
oe_runmake ${util}
done
}
do_install () {
install -d ${D}${bindir}
install -d ${D}${libdir}/${BPN}
# Install the compiled binaries that were built in the previous step
for x in `find . -name "*.c"`
do
util=`echo ${x} | sed s/.c$//`
util_basename=`basename ${util}`
install -m 0755 ${util} ${D}${bindir}/${util_basename}
done
# Install the helper scripts in a subdirectory of $libdir
for script in `find . -name "*.sh" | grep include`
do
# Remove hardcoded relative paths
sed -i -e 's#..\/utils\/##' ${script}
sed -i -e 's#. ..\/Switches#${bindir}#g' ${script}
script_basename=`basename ${script}`
install -m 0755 $script ${D}${libdir}/${BPN}/${script_basename}
done
# Install the shell scripts NOT in the $libdir directory since those
# will be installed elsewhere
for script in `find . -name "*.sh" | grep -v include`
do
# if the script includes any helper scripts from the $libdir
# directory then change the source path to the absolute path
# to reflect the install location of the helper scripts.
sed -i -e "s#. ../include#. ${libdir}/${BPN}#g" ${script}
# Remove hardcoded relative paths
sed -i -e 's#..\/utils\/##' ${script}
script_basename=`basename ${script}`
install -m 0755 $script ${D}${bindir}/${script_basename}
done
}
RDEPENDS:${PN} +="bash"
# http://errors.yoctoproject.org/Errors/Details/186956/
COMPATIBLE_HOST:libc-musl = 'null'

View File

@@ -0,0 +1,67 @@
From aca1030d29f627314d13884ebc7b2c313d718df7 Mon Sep 17 00:00:00 2001
From: Ovidiu Panait <ovidiu.panait@windriver.com>
Date: Wed, 13 Apr 2022 17:17:54 +0300
Subject: [PATCH] sys/targets/targets.go: allow users to override hardcoded
cross-compilers
Currently, cross compiler names are hardcoded for each os/arch combo. However,
toolchain tuples differ, especially when using vendor provided toolchains.
Allow users to specify the cross compiler for an os/arch combo using
SYZ_CC_<os>_<arch> environment variables.
Also, remove hardcoded "-march=armv6" flag to fix compilation on arm.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---
sys/targets/targets.go | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index f3be708f3..19a8bb681 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -258,7 +258,6 @@ var List = map[string]map[string]*Target{
PtrSize: 4,
PageSize: 4 << 10,
LittleEndian: true,
- CFlags: []string{"-D__LINUX_ARM_ARCH__=6", "-march=armv6"},
Triple: "arm-linux-gnueabi",
KernelArch: "arm",
KernelHeaderArch: "arm",
@@ -670,12 +669,16 @@ func initTarget(target *Target, OS, arch string) {
for i := range target.CFlags {
target.replaceSourceDir(&target.CFlags[i], sourceDir)
}
- if OS == Linux && arch == runtime.GOARCH {
- // Don't use cross-compiler for native compilation, there are cases when this does not work:
- // https://github.com/google/syzkaller/pull/619
- // https://github.com/google/syzkaller/issues/387
- // https://github.com/google/syzkaller/commit/06db3cec94c54e1cf720cdd5db72761514569d56
- target.Triple = ""
+ if OS == Linux {
+ if cc := os.Getenv("SYZ_CC_" + OS + "_" + arch); cc != "" {
+ target.CCompiler = cc
+ } else if arch == runtime.GOARCH {
+ // Don't use cross-compiler for native compilation, there are cases when this does not work:
+ // https://github.com/google/syzkaller/pull/619
+ // https://github.com/google/syzkaller/issues/387
+ // https://github.com/google/syzkaller/commit/06db3cec94c54e1cf720cdd5db72761514569d56
+ target.Triple = ""
+ }
}
if target.CCompiler == "" {
target.setCompiler(useClang)
@@ -803,7 +806,7 @@ func (target *Target) lazyInit() {
// On CI we want to fail loudly if cross-compilation breaks.
// Also fail if SOURCEDIR_GOOS is set b/c in that case user probably assumes it will work.
if (target.OS != runtime.GOOS || !runningOnCI) && os.Getenv("SOURCEDIR_"+strings.ToUpper(target.OS)) == "" {
- if _, err := exec.LookPath(target.CCompiler); err != nil {
+ if _, err := exec.LookPath(strings.Fields(target.CCompiler)[0]); err != nil {
target.BrokenCompiler = fmt.Sprintf("%v is missing (%v)", target.CCompiler, err)
return
}
--
2.25.1

View File

@@ -0,0 +1,73 @@
DESCRIPTION = "syzkaller is an unsupervised coverage-guided kernel fuzzer"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=5335066555b14d832335aa4660d6c376"
inherit go-mod
GO_IMPORT = "github.com/google/syzkaller"
SRC_URI = "git://${GO_IMPORT};protocol=https;destsuffix=${BPN}-${PV}/src/${GO_IMPORT};branch=master \
file://0001-sys-targets-targets.go-allow-users-to-override-hardc.patch;patchdir=src/${GO_IMPORT} \
"
SRCREV = "67cb024cd1a3c95e311263a5c95e957f9abfd8ca"
COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64).*-linux"
B = "${S}/src/${GO_IMPORT}/bin"
GO_EXTRA_LDFLAGS += ' -X ${GO_IMPORT}/prog.GitRevision=${SRCREV}'
export GOHOSTFLAGS="${GO_LINKSHARED} ${GOBUILDFLAGS}"
export GOTARGETFLAGS="${GO_LINKSHARED} ${GOBUILDFLAGS}"
export TARGETOS = '${GOOS}'
export TARGETARCH = '${GOARCH}'
export TARGETVMARCH = '${GOARCH}'
CGO_ENABLED = "0"
DEPENDS:class-native += "qemu-system-native"
do_compile:class-native() {
export HOSTOS="${GOHOSTOS}"
export HOSTARCH="${GOHOSTARCH}"
oe_runmake HOSTGO="${GO}" host
}
do_compile:class-target() {
export HOSTOS="${GOOS}"
export HOSTARCH="${GOARCH}"
export SYZ_CC_${TARGETOS}_${TARGETARCH}="${CC}"
# Unset GOOS and GOARCH so that the correct syz-sysgen binary can be
# generated. Fixes:
# go install: cannot install cross-compiled binaries when GOBIN is set
unset GOOS
unset GOARCH
oe_runmake GO="${GO}" CC="${CXX}" CFLAGS="${CXXFLAGS} ${LDFLAGS}" REV=${SRCREV} target
}
do_install:class-native() {
SYZ_BINS_NATIVE="syz-manager syz-runtest syz-repro syz-mutate syz-prog2c \
syz-db syz-upgrade"
install -d ${D}${bindir}
for i in ${SYZ_BINS_NATIVE}; do
install -m 0755 ${B}/${i} ${D}${bindir}
done
}
do_install:class-target() {
SYZ_TARGET_DIR="${TARGETOS}_${TARGETARCH}"
SYZ_BINS_TARGET="syz-fuzzer syz-execprog syz-stress syz-executor"
install -d ${D}${bindir}/${SYZ_TARGET_DIR}
for i in ${SYZ_BINS_TARGET}; do
install -m 0755 ${B}/${SYZ_TARGET_DIR}/${i} ${D}${bindir}/${SYZ_TARGET_DIR}
done
}
BBCLASSEXTEND += "native"

View File

@@ -0,0 +1,409 @@
From 99b62670d01c6081d883303722726beb65699cbb Mon Sep 17 00:00:00 2001
From: Zong Li <zong.li@sifive.com>
Date: Wed, 6 May 2020 01:23:22 -0700
Subject: [PATCH] Makefile for cross compile SoftFloat 3e
This commit adds a Makefile for cross compile on SoftFloat
3e version. Almost implementation is based on meta-oe porting
from Fabio Berton <fabio.berton@ossystems.com.br>.
Signed-off-by: Zong Li <zongbox@gmail.com>
---
SoftFloat-3e/build/Linux-Cross-Compile/Makefile | 325 ++++++++++++++++++++++
SoftFloat-3e/build/Linux-Cross-Compile/platform.h | 52 ++++
2 files changed, 377 insertions(+)
create mode 100644 SoftFloat-3e/build/Linux-Cross-Compile/Makefile
create mode 100644 SoftFloat-3e/build/Linux-Cross-Compile/platform.h
diff --git a/SoftFloat-3e/build/Linux-Cross-Compile/Makefile b/SoftFloat-3e/build/Linux-Cross-Compile/Makefile
new file mode 100644
index 0000000..4da4bc9
--- /dev/null
+++ b/SoftFloat-3e/build/Linux-Cross-Compile/Makefile
@@ -0,0 +1,325 @@
+
+#=============================================================================
+#
+# This Makefile template is part of the SoftFloat IEEE Floating-Point
+# Arithmetic Package, Release 3e, by John R. Hauser.
+#
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
+# University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions, and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions, and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+# DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#=============================================================================
+
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086
+
+SOFTFLOAT_OPTS ?= \
+ -DSOFTFLOAT_ROUND_ODD -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 \
+ -DSOFTFLOAT_FAST_DIV64TO32
+
+DELETE = rm -f
+C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
+COMPILE_C = \
+ ${CC} -c -Werror-implicit-function-declaration $(SOFTFLOAT_OPTS) \
+ $(C_INCLUDES) -O2 -o $@
+MAKELIB = ${AR} crs $@
+
+OBJ = .o
+LIB = .a
+
+OTHER_HEADERS =
+
+.PHONY: all
+all: softfloat$(LIB)
+
+OBJS_PRIMITIVES = \
+ s_compare96M$(OBJ) \
+ s_compare128M$(OBJ) \
+ s_shortShiftLeft64To96M$(OBJ) \
+ s_shortShiftLeftM$(OBJ) \
+ s_shiftLeftM$(OBJ) \
+ s_shortShiftRightM$(OBJ) \
+ s_shortShiftRightJam64$(OBJ) \
+ s_shortShiftRightJamM$(OBJ) \
+ s_shiftRightJam32$(OBJ) \
+ s_shiftRightJam64$(OBJ) \
+ s_shiftRightJamM$(OBJ) \
+ s_shiftRightM$(OBJ) \
+ s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
+ s_countLeadingZeros32$(OBJ) \
+ s_countLeadingZeros64$(OBJ) \
+ s_addM$(OBJ) \
+ s_addCarryM$(OBJ) \
+ s_addComplCarryM$(OBJ) \
+ s_negXM$(OBJ) \
+ s_sub1XM$(OBJ) \
+ s_subM$(OBJ) \
+ s_mul64To128M$(OBJ) \
+ s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
+ s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
+ s_approxRecipSqrt32_1$(OBJ) \
+ s_remStepMBy32$(OBJ) \
+
+OBJS_SPECIALIZE = \
+ softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
+ s_f32UIToCommonNaN$(OBJ) \
+ s_commonNaNToF32UI$(OBJ) \
+ s_propagateNaNF32UI$(OBJ) \
+ s_f64UIToCommonNaN$(OBJ) \
+ s_commonNaNToF64UI$(OBJ) \
+ s_propagateNaNF64UI$(OBJ) \
+ extF80M_isSignalingNaN$(OBJ) \
+ s_extF80MToCommonNaN$(OBJ) \
+ s_commonNaNToExtF80M$(OBJ) \
+ s_propagateNaNExtF80M$(OBJ) \
+ f128M_isSignalingNaN$(OBJ) \
+ s_f128MToCommonNaN$(OBJ) \
+ s_commonNaNToF128M$(OBJ) \
+ s_propagateNaNF128M$(OBJ) \
+
+OBJS_OTHERS = \
+ s_roundToUI32$(OBJ) \
+ s_roundMToUI64$(OBJ) \
+ s_roundToI32$(OBJ) \
+ s_roundMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
+ s_normSubnormalF32Sig$(OBJ) \
+ s_roundPackToF32$(OBJ) \
+ s_normRoundPackToF32$(OBJ) \
+ s_addMagsF32$(OBJ) \
+ s_subMagsF32$(OBJ) \
+ s_mulAddF32$(OBJ) \
+ s_normSubnormalF64Sig$(OBJ) \
+ s_roundPackToF64$(OBJ) \
+ s_normRoundPackToF64$(OBJ) \
+ s_addMagsF64$(OBJ) \
+ s_subMagsF64$(OBJ) \
+ s_mulAddF64$(OBJ) \
+ s_tryPropagateNaNExtF80M$(OBJ) \
+ s_invalidExtF80M$(OBJ) \
+ s_normExtF80SigM$(OBJ) \
+ s_roundPackMToExtF80M$(OBJ) \
+ s_normRoundPackMToExtF80M$(OBJ) \
+ s_addExtF80M$(OBJ) \
+ s_compareNonnormExtF80M$(OBJ) \
+ s_isNaNF128M$(OBJ) \
+ s_tryPropagateNaNF128M$(OBJ) \
+ s_invalidF128M$(OBJ) \
+ s_shiftNormSigF128M$(OBJ) \
+ s_roundPackMToF128M$(OBJ) \
+ s_normRoundPackMToF128M$(OBJ) \
+ s_addF128M$(OBJ) \
+ s_mulAddF128M$(OBJ) \
+ softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
+ ui32_to_f32$(OBJ) \
+ ui32_to_f64$(OBJ) \
+ ui32_to_extF80M$(OBJ) \
+ ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
+ ui64_to_f32$(OBJ) \
+ ui64_to_f64$(OBJ) \
+ ui64_to_extF80M$(OBJ) \
+ ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
+ i32_to_f32$(OBJ) \
+ i32_to_f64$(OBJ) \
+ i32_to_extF80M$(OBJ) \
+ i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
+ i64_to_f32$(OBJ) \
+ i64_to_f64$(OBJ) \
+ i64_to_extF80M$(OBJ) \
+ i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
+ f32_to_ui32$(OBJ) \
+ f32_to_ui64$(OBJ) \
+ f32_to_i32$(OBJ) \
+ f32_to_i64$(OBJ) \
+ f32_to_ui32_r_minMag$(OBJ) \
+ f32_to_ui64_r_minMag$(OBJ) \
+ f32_to_i32_r_minMag$(OBJ) \
+ f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
+ f32_to_f64$(OBJ) \
+ f32_to_extF80M$(OBJ) \
+ f32_to_f128M$(OBJ) \
+ f32_roundToInt$(OBJ) \
+ f32_add$(OBJ) \
+ f32_sub$(OBJ) \
+ f32_mul$(OBJ) \
+ f32_mulAdd$(OBJ) \
+ f32_div$(OBJ) \
+ f32_rem$(OBJ) \
+ f32_sqrt$(OBJ) \
+ f32_eq$(OBJ) \
+ f32_le$(OBJ) \
+ f32_lt$(OBJ) \
+ f32_eq_signaling$(OBJ) \
+ f32_le_quiet$(OBJ) \
+ f32_lt_quiet$(OBJ) \
+ f32_isSignalingNaN$(OBJ) \
+ f64_to_ui32$(OBJ) \
+ f64_to_ui64$(OBJ) \
+ f64_to_i32$(OBJ) \
+ f64_to_i64$(OBJ) \
+ f64_to_ui32_r_minMag$(OBJ) \
+ f64_to_ui64_r_minMag$(OBJ) \
+ f64_to_i32_r_minMag$(OBJ) \
+ f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
+ f64_to_f32$(OBJ) \
+ f64_to_extF80M$(OBJ) \
+ f64_to_f128M$(OBJ) \
+ f64_roundToInt$(OBJ) \
+ f64_add$(OBJ) \
+ f64_sub$(OBJ) \
+ f64_mul$(OBJ) \
+ f64_mulAdd$(OBJ) \
+ f64_div$(OBJ) \
+ f64_rem$(OBJ) \
+ f64_sqrt$(OBJ) \
+ f64_eq$(OBJ) \
+ f64_le$(OBJ) \
+ f64_lt$(OBJ) \
+ f64_eq_signaling$(OBJ) \
+ f64_le_quiet$(OBJ) \
+ f64_lt_quiet$(OBJ) \
+ f64_isSignalingNaN$(OBJ) \
+ extF80M_to_ui32$(OBJ) \
+ extF80M_to_ui64$(OBJ) \
+ extF80M_to_i32$(OBJ) \
+ extF80M_to_i64$(OBJ) \
+ extF80M_to_ui32_r_minMag$(OBJ) \
+ extF80M_to_ui64_r_minMag$(OBJ) \
+ extF80M_to_i32_r_minMag$(OBJ) \
+ extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
+ extF80M_to_f32$(OBJ) \
+ extF80M_to_f64$(OBJ) \
+ extF80M_to_f128M$(OBJ) \
+ extF80M_roundToInt$(OBJ) \
+ extF80M_add$(OBJ) \
+ extF80M_sub$(OBJ) \
+ extF80M_mul$(OBJ) \
+ extF80M_div$(OBJ) \
+ extF80M_rem$(OBJ) \
+ extF80M_sqrt$(OBJ) \
+ extF80M_eq$(OBJ) \
+ extF80M_le$(OBJ) \
+ extF80M_lt$(OBJ) \
+ extF80M_eq_signaling$(OBJ) \
+ extF80M_le_quiet$(OBJ) \
+ extF80M_lt_quiet$(OBJ) \
+ f128M_to_ui32$(OBJ) \
+ f128M_to_ui64$(OBJ) \
+ f128M_to_i32$(OBJ) \
+ f128M_to_i64$(OBJ) \
+ f128M_to_ui32_r_minMag$(OBJ) \
+ f128M_to_ui64_r_minMag$(OBJ) \
+ f128M_to_i32_r_minMag$(OBJ) \
+ f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
+ f128M_to_f32$(OBJ) \
+ f128M_to_f64$(OBJ) \
+ f128M_to_extF80M$(OBJ) \
+ f128M_roundToInt$(OBJ) \
+ f128M_add$(OBJ) \
+ f128M_sub$(OBJ) \
+ f128M_mul$(OBJ) \
+ f128M_mulAdd$(OBJ) \
+ f128M_div$(OBJ) \
+ f128M_rem$(OBJ) \
+ f128M_sqrt$(OBJ) \
+ f128M_eq$(OBJ) \
+ f128M_le$(OBJ) \
+ f128M_lt$(OBJ) \
+ f128M_eq_signaling$(OBJ) \
+ f128M_le_quiet$(OBJ) \
+ f128M_lt_quiet$(OBJ) \
+
+OBJS_ALL = $(OBJS_PRIMITIVES) $(OBJS_SPECIALIZE) $(OBJS_OTHERS)
+
+$(OBJS_ALL): \
+ $(OTHER_HEADERS) platform.h $(SOURCE_DIR)/include/primitiveTypes.h \
+ $(SOURCE_DIR)/include/primitives.h
+$(OBJS_SPECIALIZE) $(OBJS_OTHERS): \
+ $(SOURCE_DIR)/include/softfloat_types.h $(SOURCE_DIR)/include/internals.h \
+ $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/specialize.h \
+ $(SOURCE_DIR)/include/softfloat.h
+
+$(OBJS_PRIMITIVES) $(OBJS_OTHERS): %$(OBJ): $(SOURCE_DIR)/%.c
+ $(COMPILE_C) $(SOURCE_DIR)/$*.c
+
+$(OBJS_SPECIALIZE): %$(OBJ): $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/%.c
+ $(COMPILE_C) $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/$*.c
+
+softfloat$(LIB): $(OBJS_ALL)
+ $(DELETE) $@
+ $(MAKELIB) $^
+
+.PHONY: clean
+clean:
+ $(DELETE) $(OBJS_ALL) softfloat$(LIB)
+
diff --git a/SoftFloat-3e/build/Linux-Cross-Compile/platform.h b/SoftFloat-3e/build/Linux-Cross-Compile/platform.h
new file mode 100644
index 0000000..1728c15
--- /dev/null
+++ b/SoftFloat-3e/build/Linux-Cross-Compile/platform.h
@@ -0,0 +1,52 @@
+
+/*============================================================================
+
+This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic
+Package, Release 3e, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions, and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of the University nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define LITTLEENDIAN 1
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
+#define INLINE extern inline
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define SOFTFLOAT_BUILTIN_CLZ 1
+#include "opts-GCC.h"
--
2.7.4

View File

@@ -0,0 +1,433 @@
From 3503f7f3845caba454949fdf8408e85ca4fdb943 Mon Sep 17 00:00:00 2001
From: Zong Li <zong.li@sifive.com>
Date: Wed, 6 May 2020 01:25:55 -0700
Subject: [PATCH] Makefile for cross compile TestFloat 3e
This commit adds a Makefile for cross compile on TestFloat
3e version. Almost implementation is based on meta-oe porting
from Fabio Berton <fabio.berton@ossystems.com.br>.
Signed-off-by: Zong Li <zongbox@gmail.com>
---
TestFloat-3e/build/Linux-Cross-Compile/Makefile | 353 ++++++++++++++++++++++
TestFloat-3e/build/Linux-Cross-Compile/platform.h | 48 +++
2 files changed, 401 insertions(+)
create mode 100644 TestFloat-3e/build/Linux-Cross-Compile/Makefile
create mode 100644 TestFloat-3e/build/Linux-Cross-Compile/platform.h
diff --git a/TestFloat-3e/build/Linux-Cross-Compile/Makefile b/TestFloat-3e/build/Linux-Cross-Compile/Makefile
new file mode 100644
index 0000000..d82b9ed
--- /dev/null
+++ b/TestFloat-3e/build/Linux-Cross-Compile/Makefile
@@ -0,0 +1,353 @@
+
+#=============================================================================
+#
+# This Makefile template is part of TestFloat, Release 3b, a package of
+# programs for testing the correctness of floating-point arithmetic complying
+# with the IEEE Standard for Floating-Point, by John R. Hauser.
+#
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions, and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions, and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+# DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#=============================================================================
+
+SOURCE_DIR ?= ../../source
+SOFTFLOAT_DIR ?= ../../../SoftFloat-3e
+PLATFORM ?= Linux-Cross-Compile
+
+SUBJ_SOURCE_DIR = $(SOURCE_DIR)/subj-C
+SOFTFLOAT_INCLUDE_DIR = $(SOFTFLOAT_DIR)/source/include
+
+SOFTFLOAT_H = \
+ $(SOFTFLOAT_INCLUDE_DIR)/softfloat_types.h \
+ $(SOFTFLOAT_INCLUDE_DIR)/softfloat.h
+SOFTFLOAT_LIB = $(SOFTFLOAT_DIR)/build/$(PLATFORM)/softfloat$(LIB)
+
+TESTFLOAT_OPTS ?= -DFLOAT16 -DFLOAT64 -DEXTFLOAT80 -DFLOAT128 -DFLOAT_ROUND_ODD
+
+DELETE = rm -f
+C_INCLUDES = \
+ -I. -I$(SUBJ_SOURCE_DIR) -I$(SOURCE_DIR) -I$(SOFTFLOAT_INCLUDE_DIR)
+COMPILE_C = \
+ ${CC} -c -Werror-implicit-function-declaration \
+ $(TESTFLOAT_OPTS) $(C_INCLUDES) -O2 -o $@
+COMPILE_SLOWFLOAT_C = \
+ ${CC} -c -Werror-implicit-function-declaration \
+ $(TESTFLOAT_OPTS) $(C_INCLUDES) -O3 -o $@
+MAKELIB = ${AR} crs $@
+LINK = ${CC} -o $@ ${LDFLAGS}
+OTHER_LIBS = -lm
+
+OBJ = .o
+LIB = .a
+EXE =
+
+.PHONY: all
+all: \
+ testsoftfloat$(EXE) \
+ timesoftfloat$(EXE) \
+ testfloat_gen$(EXE) \
+ testfloat_ver$(EXE) \
+ testfloat$(EXE) \
+
+OBJS_GENCASES = \
+ genCases_ui32$(OBJ) \
+ genCases_ui64$(OBJ) \
+ genCases_i32$(OBJ) \
+ genCases_i64$(OBJ) \
+ genCases_f16$(OBJ) \
+ genCases_f32$(OBJ) \
+ genCases_f64$(OBJ) \
+ genCases_extF80$(OBJ) \
+ genCases_f128$(OBJ) \
+
+OBJS_WRITECASE = \
+ writeCase_a_ui32$(OBJ) \
+ writeCase_a_ui64$(OBJ) \
+ writeCase_a_f16$(OBJ) \
+ writeCase_ab_f16$(OBJ) \
+ writeCase_abc_f16$(OBJ) \
+ writeCase_a_f32$(OBJ) \
+ writeCase_ab_f32$(OBJ) \
+ writeCase_abc_f32$(OBJ) \
+ writeCase_a_f64$(OBJ) \
+ writeCase_ab_f64$(OBJ) \
+ writeCase_abc_f64$(OBJ) \
+ writeCase_a_extF80M$(OBJ) \
+ writeCase_ab_extF80M$(OBJ) \
+ writeCase_a_f128M$(OBJ) \
+ writeCase_ab_f128M$(OBJ) \
+ writeCase_abc_f128M$(OBJ) \
+ writeCase_z_bool$(OBJ) \
+ writeCase_z_ui32$(OBJ) \
+ writeCase_z_ui64$(OBJ) \
+ writeCase_z_f16$(OBJ) \
+ writeCase_z_f32$(OBJ) \
+ writeCase_z_f64$(OBJ) \
+ writeCase_z_extF80M$(OBJ) \
+ writeCase_z_f128M$(OBJ) \
+
+OBJS_TEST = \
+ test_a_ui32_z_f16$(OBJ) \
+ test_a_ui32_z_f32$(OBJ) \
+ test_a_ui32_z_f64$(OBJ) \
+ test_a_ui32_z_extF80$(OBJ) \
+ test_a_ui32_z_f128$(OBJ) \
+ test_a_ui64_z_f16$(OBJ) \
+ test_a_ui64_z_f32$(OBJ) \
+ test_a_ui64_z_f64$(OBJ) \
+ test_a_ui64_z_extF80$(OBJ) \
+ test_a_ui64_z_f128$(OBJ) \
+ test_a_i32_z_f16$(OBJ) \
+ test_a_i32_z_f32$(OBJ) \
+ test_a_i32_z_f64$(OBJ) \
+ test_a_i32_z_extF80$(OBJ) \
+ test_a_i32_z_f128$(OBJ) \
+ test_a_i64_z_f16$(OBJ) \
+ test_a_i64_z_f32$(OBJ) \
+ test_a_i64_z_f64$(OBJ) \
+ test_a_i64_z_extF80$(OBJ) \
+ test_a_i64_z_f128$(OBJ) \
+ test_a_f16_z_ui32_rx$(OBJ) \
+ test_a_f16_z_ui64_rx$(OBJ) \
+ test_a_f16_z_i32_rx$(OBJ) \
+ test_a_f16_z_i64_rx$(OBJ) \
+ test_a_f16_z_ui32_x$(OBJ) \
+ test_a_f16_z_ui64_x$(OBJ) \
+ test_a_f16_z_i32_x$(OBJ) \
+ test_a_f16_z_i64_x$(OBJ) \
+ test_a_f16_z_f32$(OBJ) \
+ test_a_f16_z_f64$(OBJ) \
+ test_a_f16_z_extF80$(OBJ) \
+ test_a_f16_z_f128$(OBJ) \
+ test_az_f16$(OBJ) \
+ test_az_f16_rx$(OBJ) \
+ test_abz_f16$(OBJ) \
+ test_abcz_f16$(OBJ) \
+ test_ab_f16_z_bool$(OBJ) \
+ test_a_f32_z_ui32_rx$(OBJ) \
+ test_a_f32_z_ui64_rx$(OBJ) \
+ test_a_f32_z_i32_rx$(OBJ) \
+ test_a_f32_z_i64_rx$(OBJ) \
+ test_a_f32_z_ui32_x$(OBJ) \
+ test_a_f32_z_ui64_x$(OBJ) \
+ test_a_f32_z_i32_x$(OBJ) \
+ test_a_f32_z_i64_x$(OBJ) \
+ test_a_f32_z_f16$(OBJ) \
+ test_a_f32_z_f64$(OBJ) \
+ test_a_f32_z_extF80$(OBJ) \
+ test_a_f32_z_f128$(OBJ) \
+ test_az_f32$(OBJ) \
+ test_az_f32_rx$(OBJ) \
+ test_abz_f32$(OBJ) \
+ test_abcz_f32$(OBJ) \
+ test_ab_f32_z_bool$(OBJ) \
+ test_a_f64_z_ui32_rx$(OBJ) \
+ test_a_f64_z_ui64_rx$(OBJ) \
+ test_a_f64_z_i32_rx$(OBJ) \
+ test_a_f64_z_i64_rx$(OBJ) \
+ test_a_f64_z_ui32_x$(OBJ) \
+ test_a_f64_z_ui64_x$(OBJ) \
+ test_a_f64_z_i32_x$(OBJ) \
+ test_a_f64_z_i64_x$(OBJ) \
+ test_a_f64_z_f16$(OBJ) \
+ test_a_f64_z_f32$(OBJ) \
+ test_a_f64_z_extF80$(OBJ) \
+ test_a_f64_z_f128$(OBJ) \
+ test_az_f64$(OBJ) \
+ test_az_f64_rx$(OBJ) \
+ test_abz_f64$(OBJ) \
+ test_abcz_f64$(OBJ) \
+ test_ab_f64_z_bool$(OBJ) \
+ test_a_extF80_z_ui32_rx$(OBJ) \
+ test_a_extF80_z_ui64_rx$(OBJ) \
+ test_a_extF80_z_i32_rx$(OBJ) \
+ test_a_extF80_z_i64_rx$(OBJ) \
+ test_a_extF80_z_ui32_x$(OBJ) \
+ test_a_extF80_z_ui64_x$(OBJ) \
+ test_a_extF80_z_i32_x$(OBJ) \
+ test_a_extF80_z_i64_x$(OBJ) \
+ test_a_extF80_z_f16$(OBJ) \
+ test_a_extF80_z_f32$(OBJ) \
+ test_a_extF80_z_f64$(OBJ) \
+ test_a_extF80_z_f128$(OBJ) \
+ test_az_extF80$(OBJ) \
+ test_az_extF80_rx$(OBJ) \
+ test_abz_extF80$(OBJ) \
+ test_ab_extF80_z_bool$(OBJ) \
+ test_a_f128_z_ui32_rx$(OBJ) \
+ test_a_f128_z_ui64_rx$(OBJ) \
+ test_a_f128_z_i32_rx$(OBJ) \
+ test_a_f128_z_i64_rx$(OBJ) \
+ test_a_f128_z_ui32_x$(OBJ) \
+ test_a_f128_z_ui64_x$(OBJ) \
+ test_a_f128_z_i32_x$(OBJ) \
+ test_a_f128_z_i64_x$(OBJ) \
+ test_a_f128_z_f16$(OBJ) \
+ test_a_f128_z_f32$(OBJ) \
+ test_a_f128_z_f64$(OBJ) \
+ test_a_f128_z_extF80$(OBJ) \
+ test_az_f128$(OBJ) \
+ test_az_f128_rx$(OBJ) \
+ test_abz_f128$(OBJ) \
+ test_abcz_f128$(OBJ) \
+ test_ab_f128_z_bool$(OBJ) \
+
+OBJS_LIB = \
+ uint128_inline$(OBJ) \
+ uint128$(OBJ) \
+ fail$(OBJ) \
+ functions_common$(OBJ) \
+ functionInfos$(OBJ) \
+ standardFunctionInfos$(OBJ) \
+ random$(OBJ) \
+ genCases_common$(OBJ) \
+ $(OBJS_GENCASES) \
+ genCases_writeTestsTotal$(OBJ) \
+ verCases_inline$(OBJ) \
+ verCases_common$(OBJ) \
+ verCases_writeFunctionName$(OBJ) \
+ readHex$(OBJ) \
+ writeHex$(OBJ) \
+ $(OBJS_WRITECASE) \
+ testLoops_common$(OBJ) \
+ $(OBJS_TEST) \
+
+uint128$(OBJ): $(SOURCE_DIR)/uint128.h
+fail$(OBJ): $(SOURCE_DIR)/fail.h
+functions_common$(OBJ): $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h
+functionInfos$(OBJ): $(SOURCE_DIR)/functions.h
+standardFunctionInfos$(OBJ): $(SOURCE_DIR)/functions.h
+random$(OBJ): $(SOURCE_DIR)/random.h
+genCases_common$(OBJ): $(SOURCE_DIR)/fail.h $(SOURCE_DIR)/genCases.h
+$(OBJS_GENCASES): \
+ $(SOURCE_DIR)/random.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h
+genCases_f128$(OBJ): $(SOURCE_DIR)/uint128.h
+genCases_writeTestsTotal$(OBJ): $(SOURCE_DIR)/genCases.h
+verCases_common$(OBJ): $(SOURCE_DIR)/verCases.h
+verCases_writeFunctionName$(OBJ): $(SOURCE_DIR)/verCases.h
+readHex$(OBJ): $(SOURCE_DIR)/readHex.h
+writeHex$(OBJ): $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h
+$(OBJS_WRITECASE): \
+ $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/writeCase.h
+testLoops_common$(OBJ): $(SOURCE_DIR)/testLoops.h
+$(OBJS_TEST): \
+ $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h \
+ $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/testLoops.h
+$(OBJS_LIB): %$(OBJ): platform.h $(SOURCE_DIR)/%.c
+ $(COMPILE_C) $(SOURCE_DIR)/$*.c
+testfloat$(LIB): $(OBJS_LIB)
+ $(MAKELIB) $^
+
+OBJS_TESTSOFTFLOAT = slowfloat$(OBJ) testsoftfloat$(OBJ)
+
+slowfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/slowfloat.h $(SOURCE_DIR)/slowfloat.c
+ $(COMPILE_SLOWFLOAT_C) $(SOURCE_DIR)/slowfloat.c
+testsoftfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/slowfloat.h $(SOURCE_DIR)/functions.h \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
+ $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testsoftfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/testsoftfloat.c
+
+testsoftfloat$(EXE): $(OBJS_TESTSOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ $(OTHER_LIBS)
+
+OBJS_TIMESOFTFLOAT = timesoftfloat$(OBJ)
+
+timesoftfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/timesoftfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/timesoftfloat.c
+
+timesoftfloat$(EXE): $(OBJS_TIMESOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ $(OTHER_LIBS)
+
+OBJS_TESTFLOAT_GEN = genLoops$(OBJ) testfloat_gen$(OBJ)
+
+genLoops$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/genLoops.h \
+ $(SOURCE_DIR)/genLoops.c
+ $(COMPILE_C) $(SOURCE_DIR)/genLoops.c
+testfloat_gen$(OBJ): \
+ $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/genLoops.h \
+ $(SOURCE_DIR)/testfloat_gen.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat_gen.c
+
+testfloat_gen$(EXE): $(OBJS_TESTFLOAT_GEN) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ $(OTHER_LIBS)
+
+OBJS_TESTFLOAT_VER = verLoops$(OBJ) testfloat_ver$(OBJ)
+
+verLoops$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/readHex.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
+ $(SOURCE_DIR)/verLoops.h $(SOURCE_DIR)/verLoops.c
+ $(COMPILE_C) $(SOURCE_DIR)/verLoops.c
+testfloat_ver$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/verCases.h \
+ $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/verLoops.h \
+ $(SOURCE_DIR)/testfloat_ver.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat_ver.c
+
+testfloat_ver$(EXE): $(OBJS_TESTFLOAT_VER) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ $(OTHER_LIBS)
+
+OBJS_TESTFLOAT = subjfloat$(OBJ) subjfloat_functions$(OBJ) testfloat$(OBJ)
+
+subjfloat$(OBJ): \
+ platform.h $(SOFTFLOAT_H) $(SUBJ_SOURCE_DIR)/subjfloat_config.h \
+ $(SOURCE_DIR)/subjfloat.h $(SUBJ_SOURCE_DIR)/subjfloat.c
+ $(COMPILE_C) $(SUBJ_SOURCE_DIR)/subjfloat.c
+subjfloat_functions$(OBJ): \
+ platform.h $(SUBJ_SOURCE_DIR)/subjfloat_config.h $(SOURCE_DIR)/subjfloat.h \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/subjfloat_functions.c
+ $(COMPILE_C) $(SOURCE_DIR)/subjfloat_functions.c
+testfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SUBJ_SOURCE_DIR)/subjfloat_config.h $(SOURCE_DIR)/subjfloat.h \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h \
+ $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat.c
+
+testfloat$(EXE): $(OBJS_TESTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ $(OTHER_LIBS)
+
+.PHONY: clean
+clean:
+ $(DELETE) $(OBJS_LIB) testfloat$(LIB)
+ $(DELETE) $(OBJS_TESTSOFTFLOAT) testsoftfloat$(EXE)
+ $(DELETE) $(OBJS_TIMESOFTFLOAT) timesoftfloat$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT_GEN) testfloat_gen$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT_VER) testfloat_ver$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT) testfloat$(EXE)
+
diff --git a/TestFloat-3e/build/Linux-Cross-Compile/platform.h b/TestFloat-3e/build/Linux-Cross-Compile/platform.h
new file mode 100644
index 0000000..487a43b
--- /dev/null
+++ b/TestFloat-3e/build/Linux-Cross-Compile/platform.h
@@ -0,0 +1,48 @@
+
+/*============================================================================
+
+This C header template is part of TestFloat, Release 3e, a package of programs
+for testing the correctness of floating-point arithmetic complying with the
+IEEE Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions, and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of the University nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define LITTLEENDIAN 1
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
+#define INLINE extern inline
+#endif
--
2.7.4

View File

@@ -0,0 +1,36 @@
SUMMARY = "Berkeley TestFloat 3e"
DESCRIPTION = "Berkeley TestFloat is a small collection of programs for \
testing that an implementation of binary floating-point conforms to the \
IEEE Standard for Floating-Point Arithmetic."
HOMEPAGE = "http://www.jhauser.us/arithmetic/TestFloat.html"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://TestFloat-${PV}/COPYING.txt;md5=d467c2d231054347e8fd885ac06e7b2b"
SRC_URI = "\
http://www.jhauser.us/arithmetic/TestFloat-3e.zip;name=TestFloat \
http://www.jhauser.us/arithmetic/SoftFloat-3e.zip;name=SoftFloat \
file://0001-Makefile-for-cross-compile-SoftFloat.patch \
file://0002-Makefile-for-cross-compile-TestFloat.patch \
"
SRC_URI[TestFloat.md5sum] = "e70a1e6c6732abf79645a6dcca69a654"
SRC_URI[TestFloat.sha256sum] = "6d4bdf0096b48a653aa59fc203a9e5fe18b5a58d7a1b715107c7146776a0aad6"
SRC_URI[SoftFloat.md5sum] = "7dac954ea4aed0697cbfee800ba4f492"
SRC_URI[SoftFloat.sha256sum] = "21130ce885d35c1fe73fc1e1bf2244178167e05c6747cad5f450cc991714c746"
S = "${WORKDIR}"
do_compile(){
oe_runmake -C SoftFloat-${PV}/build/Linux-Cross-Compile/
oe_runmake -C TestFloat-${PV}/build/Linux-Cross-Compile/
}
do_install(){
install -d ${D}/${bindir}
install ${S}/TestFloat-${PV}/build/Linux-Cross-Compile/testfloat ${D}/${bindir}
install ${S}/TestFloat-${PV}/build/Linux-Cross-Compile/testfloat_gen ${D}/${bindir}
install ${S}/TestFloat-${PV}/build/Linux-Cross-Compile/testfloat_ver ${D}/${bindir}
install ${S}/TestFloat-${PV}/build/Linux-Cross-Compile/testsoftfloat ${D}/${bindir}
install ${S}/TestFloat-${PV}/build/Linux-Cross-Compile/timesoftfloat ${D}/${bindir}
}