diff options
Diffstat (limited to 'recipes-extended/dev86')
7 files changed, 231 insertions, 38 deletions
diff --git a/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch new file mode 100644 index 00000000..85f3aef8 --- /dev/null +++ b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch @@ -0,0 +1,25 @@ +From 12f3a54801e15f3bdd5222ca1487f2fe36141c5d Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Fri, 14 May 2021 06:30:18 -0700 +Subject: [PATCH] cpp/Makefile: respect LDFLAGS when building bcc-cpp + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + cpp/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpp/Makefile b/cpp/Makefile +index 0ea43cc..303b43c 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -3,7 +3,7 @@ CFLAGS=-Wall -Wstrict-prototypes + all: bcc-cpp + + bcc-cpp: main.o cpp.o hash.o token1.o token2.o +- $(CC) $(CFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o + + clean realclean: + rm -f bcc-cpp main.o cpp.o hash.o token1.o token2.o tmp.h diff --git a/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch b/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch new file mode 100644 index 00000000..e009e01a --- /dev/null +++ b/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch @@ -0,0 +1,45 @@ +Upstream-Status: Submitted [https://github.com/jbruchon/dev86/pull/23] +Signed-off-by: Ross Burton <ross.burton@arm.com> + +From f507ee398ae20e4e97f01dfbd9a8709a90bc760f Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@arm.com> +Date: Fri, 29 Apr 2022 16:44:08 +0100 +Subject: [PATCH] cpp: fix race writing token.h files + +The rules for token1.h and token2.h both write to a temporary file tmp.h +before renaming to token1.h or token2.h. However, in a parallel build +these will execute at the same time and race. + + gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h + gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > tmp.h + mv tmp.h token1.h + mv tmp.h token2.h + mv: cannot stat 'tmp.h': No such file or directory + +By using gperf --output-file, the race is avoided entirely. + +Upstream-Status: Inappropriate [embedded specific] + +--- + cpp/Makefile | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/cpp/Makefile b/cpp/Makefile +index 0ea43cc..743694f 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -20,9 +20,7 @@ token1.o: token1.h + token2.o: token2.h + + token1.h: token1.tok +- gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h +- mv tmp.h token1.h ++ gperf -aptTc -N is_ctok -H hash1 --output-file $@ $< + + token2.h: token2.tok +- gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > tmp.h +- mv tmp.h token2.h ++ gperf -aptTc -k1,3 -N is_ckey -H hash2 --output-file $@ $< +-- +2.25.1 + diff --git a/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch new file mode 100644 index 00000000..47c283b2 --- /dev/null +++ b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch @@ -0,0 +1,30 @@ +From e908a3ad04bb40e425542b85fbb3a1eb5a38e194 Mon Sep 17 00:00:00 2001 +From: Tee-Kiah Chia <tkchia@users.noreply.github.com> +Date: Thu, 27 Feb 2020 00:52:05 +0800 +Subject: [PATCH] [cpp] update token1.tok to make new gperf happy; regen. + token1.h + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +Upstream-Status: Pending [it was submitted in https://github.com/jbruchon/dev86/pull/19 +but then closed by author] + +Remove regenerated token1.h as we'll force it to regenerate in do_compile. + +--- + cpp/token1.h | 170 +++++++++++++++++++++++++++++++++---------------- + cpp/token1.tok | 2 +- + 2 files changed, 115 insertions(+), 57 deletions(-) + +diff --git a/cpp/token1.tok b/cpp/token1.tok +index cd668ce..a98926f 100644 +--- a/cpp/token1.tok ++++ b/cpp/token1.tok +@@ -7,7 +7,7 @@ struct token_trans { char * name; int token; }; + -=, TK_SUB_ASSIGN + *=, TK_MUL_ASSIGN + /=, TK_DIV_ASSIGN +-%=, TK_MOD_ASSIGN ++"%=", TK_MOD_ASSIGN + &=, TK_AND_ASSIGN + ^=, TK_XOR_ASSIGN + |=, TK_OR_ASSIGN diff --git a/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch new file mode 100644 index 00000000..4a5bb25e --- /dev/null +++ b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch @@ -0,0 +1,59 @@ +From ce2b9747d51df2a4c358a037950f0464f3f53fe8 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Fri, 14 May 2021 14:31:50 +0000 +Subject: [PATCH] regen token2.h, token1.h with gperf-3.1 + +* update cc.h, token1.c, token2.c to be compatible with + gperf-3.1 output + +Upstream-Status: Pending +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +Remove regenerated token2.h as we'll force it to regenerate in do_compile. +--- + cpp/cc.h | 4 +- + cpp/token1.c | 2 +- + cpp/token1.h | 22 ++---- + cpp/token2.c | 2 +- + cpp/token2.h | 211 +++++++++++++++++++++++++++++++-------------------- + 5 files changed, 140 insertions(+), 101 deletions(-) + +diff --git a/cpp/cc.h b/cpp/cc.h +index 9c298e7..3724543 100644 +--- a/cpp/cc.h ++++ b/cpp/cc.h +@@ -25,8 +25,8 @@ extern int dialect; + extern int gettok P((void)); + + struct token_trans { char * name; int token; }; +-struct token_trans * is_ctok P((const char *str, unsigned int len)); +-struct token_trans * is_ckey P((const char *str, unsigned int len)); ++struct token_trans * is_ctok P((register const char *str, register size_t len)); ++struct token_trans * is_ckey P((register const char *str, register size_t len)); + + #define WORDSIZE 128 + #define TK_WSPACE 256 +diff --git a/cpp/token1.c b/cpp/token1.c +index f3aa420..cc47f3e 100644 +--- a/cpp/token1.c ++++ b/cpp/token1.c +@@ -6,6 +6,6 @@ + #ifdef __GNUC__ + __inline + #endif +-static unsigned int hash1 P((register const char *, register unsigned int)); ++static unsigned int hash1 P((register const char *, register size_t)); + + #include "token1.h" +diff --git a/cpp/token2.c b/cpp/token2.c +index b4d22b1..fbc790d 100644 +--- a/cpp/token2.c ++++ b/cpp/token2.c +@@ -6,6 +6,6 @@ + #ifdef __GNUC__ + __inline + #endif +-static unsigned int hash2 P((register const char *, register unsigned int)); ++static unsigned int hash2 P((register const char *, register size_t)); + + #include "token2.h" diff --git a/recipes-extended/dev86/dev86/cross.patch b/recipes-extended/dev86/dev86/cross.patch new file mode 100644 index 00000000..fd62c5dd --- /dev/null +++ b/recipes-extended/dev86/dev86/cross.patch @@ -0,0 +1,29 @@ +Build ifdef using BUILD_CC, not CC. + +Upstream-Status: Submitted [https://github.com/jbruchon/dev86/pull/22] +Signed-off-by: Ross Burton <ross.burton@arm.com> + +diff --git a/Makefile b/Makefile +index 8a61b65..99f41de 100644 +--- a/Makefile ++++ b/Makefile +@@ -22,6 +22,10 @@ CFLAGS= -O + IFDEFNAME= ifdef + WD=$(shell pwd) + ++BUILD_CC ?= $(CC) ++BUILD_CFLAGS ?= $(CFLAGS) ++BUILD_LDFLAGS ?= $(LDFLAGS) ++ + # Some makes take the last of a list as the default ... + all: make.fil + PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@ +@@ -65,7 +69,7 @@ make.fil: $(IFDEFNAME) makefile.in + @rm -f tmp.mak tmp.sed + + $(IFDEFNAME): ifdef.c +- $(CC) $(IFDEFARCH) $(CFLAGS) $(IFDEFFLAGS) $(LDFLAGS) -o $(IFDEFNAME) ifdef.c ++ $(BUILD_CC) $(IFDEFARCH) $(BUILD_CFLAGS) $(IFDEFFLAGS) $(BUILD_LDFLAGS) -o $(IFDEFNAME) ifdef.c + + uninstall: + @echo 'Sorry, no go; it was just wrong.' diff --git a/recipes-extended/dev86/dev86_0.16.20.bb b/recipes-extended/dev86/dev86_0.16.20.bb deleted file mode 100644 index d93e4871..00000000 --- a/recipes-extended/dev86/dev86_0.16.20.bb +++ /dev/null @@ -1,38 +0,0 @@ -DESCRIPTION = "This is a cross development C compiler, assembler and linker environment for the production of 8086 executables (Optionally MSDOS COM)" -HOMEPAGE = "http://www.debath.co.uk/dev86/" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -SECTION = "console/tools" -PR="r0" - -SRC_URI="https://github.com/lkundrak/dev86/archive/v${PV}.tar.gz" - -SRC_URI[md5sum] = "288af53f256300777efc91d97c082fda" -SRC_URI[sha256sum] = "533f2a0d2ed61223040f27e5cd007a11d969aaf34f6b709ece122b1e6fc50580" - -S = "${WORKDIR}/dev86-${PV}" - -BBCLASSEXTEND = "native" -EXTRA_OEMAKE = "VERSION=${PV} PREFIX=${prefix} DIST=${D}" - -do_compile() { - - oe_runmake make.fil - oe_runmake -f make.fil bcc86 as86 ld86 - -} - -do_install() { - - if [ "${prefix}"=="" ] ; then - export prefix=/usr - fi - - oe_runmake install-bcc - ln -s ../lib/bcc/bcc-cpp ${D}${prefix}/bin/bcc-cpp - ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1 - -} -COMPATIBLE_HOST = "(i.86|x86_64).*-linux" -FILES_${PN} += "${libdir}/bcc" -INSANE_SKIP_${PN} = "already-stripped" diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb new file mode 100644 index 00000000..a3d0fded --- /dev/null +++ b/recipes-extended/dev86/dev86_git.bb @@ -0,0 +1,43 @@ +DESCRIPTION = "This is a cross development C compiler, assembler and linker environment for the production of 8086 executables (Optionally MSDOS COM)" +HOMEPAGE = "http://www.debath.co.uk/dev86/" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +SECTION = "console/tools" + +BASE_PV="0.16.21" +PV = "${BASE_PV}+git" +SRCREV = "e254e0b19651d3b8a20225b40281c9974a95dec4" +SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https;branch=master \ + file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \ + file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \ + file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \ + file://cross.patch \ + file://0001-cpp-fix-race-writing-token.h-files.patch \ +" + +S = "${WORKDIR}/git" + +DEPENDS = "gperf-native" + +BBCLASSEXTEND = "native nativesdk" +EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}' INEXE=''" + +do_compile() { + # always regenerate token1.h, token2.h for deterministic behavior + rm -f ${S}/cpp/token1.h ${S}/cpp/token2.h + oe_runmake make.fil + oe_runmake -f make.fil bcc86 as86 ld86 +} + +do_install() { + + if [ "${prefix}"=="" ] ; then + export prefix=/usr + fi + + oe_runmake install-bcc + ln -s ../lib/bcc/bcc-cpp ${D}${prefix}/bin/bcc-cpp + ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1 +} + +FILES:${PN} += "${libdir}/bcc" |