Compare commits

...

4 Commits

Author SHA1 Message Date
Andrius Štikonas 7d2a3137dd Use relative paths and variables instead of hardcoding absolute path. 2023-05-01 22:01:13 +01:00
fosslinux d918b984ad
Merge pull request #287 from emilytrau/heirloom-devtools-snprintf
Fix segfault in yacc
2023-05-01 11:35:57 +00:00
Emily Trau 2c0a1d39d9 Fix segfault in yacc
The patch to heirloom-devtool's yacc used sprintf instead of snprintf.
This incompatibility causes a segfault when those code paths are hit.
Fixing this allows yacc to compile more grammars, and may allow some
packages to drop dependency on bison in favor of yacc.
2023-05-01 21:33:15 +10:00
Andrius Štikonas 725522b901 Make sure we pass MES_ARCH and not ARCH to mes. 2023-05-01 11:23:22 +01:00
4 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
b0a53dfe0f4cd5b9d3c1a459560a957030e52839f29b0d378e5234bf412705d6 /usr/bin/yacc
9f5186c86f8a2c7a0eb39d11f7017fc70d5a3940d56c648f93f6a3189ac1d67f /usr/bin/yacc
0fa43f12e3e32987211a433a9692f939b2c5d0dc32cd5523f9ad50bb441ac580 /usr/bin/lex
ffe696afc1bda32a5f4035e29b3275cab73a27df7635ccbe02ed49a30374ccdd /usr/lib/mes/libl.a
bf3fb293f1ff89ee3dbcb08166c64b7a6793b49a12673d7633e3353ebea80d4d /yaccpar

View File

@ -1,5 +1,6 @@
SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-FileCopyrightText: 2023 Emily Trau <emily@downunderctf.com>
SPDX-License-Identifier: CDDL-1.0
@ -227,7 +228,7 @@ diff -U3 -r yacc/y1.c yacc/y1.c
- q = chcopy(q, L" (");
- swprintf(q, q + isize - sarr, L"%d)", -i);
+ q = chcopy(q, " (");
+ sprintf(q, q + isize - sarr, "%d)", -i);
+ snprintf(q, q + isize - sarr, "%d)", -i);
}
return (sarr);
}
@ -393,7 +394,7 @@ diff -U3 -r yacc/y2.c yacc/y2.c
lrprnt(); /* dump lhs, rhs */
- swprintf(actname, sizeof actname,
- L"$$%d", nprod);
+ sprintf(actname, sizeof actname,
+ snprintf(actname, sizeof actname,
+ "$$%d", nprod);
/*
* make it nonterminal

View File

@ -70,7 +70,7 @@ chmod 755 ${bindir}/mes-m2
mescc_in=scripts/mescc.scm.in
replace --file ${mescc_in} --output ${mescc_in} --match-on @prefix@ --replace-with ${prefix}
replace --file ${mescc_in} --output ${mescc_in} --match-on @VERSION@ --replace-with ${MES_VERSION}
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_cpu@ --replace-with ${ARCH}
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_cpu@ --replace-with ${MES_ARCH}
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_kernel@ --replace-with linux
mescc_scm=${bindir}/mescc.scm

View File

@ -31,10 +31,10 @@ cd ..
cd build
untar --file ../src/${TCC_TAR}.tar
/x86/bin/simple-patch /sysa/tcc-0.9.26/build/tcc-0.9.26-1136-g5bba73cc/tcctools.c \
/sysa/tcc-0.9.26/simple-patches/remove-fileopen.before /sysa/tcc-0.9.26/simple-patches/remove-fileopen.after
/x86/bin/simple-patch /sysa/tcc-0.9.26/build/tcc-0.9.26-1136-g5bba73cc/tcctools.c \
/sysa/tcc-0.9.26/simple-patches/addback-fileopen.before /sysa/tcc-0.9.26/simple-patches/addback-fileopen.after
/x86/bin/simple-patch ${TCC_PKG}/tcctools.c \
../simple-patches/remove-fileopen.before ../simple-patches/remove-fileopen.after
/x86/bin/simple-patch ${TCC_PKG}/tcctools.c \
../simple-patches/addback-fileopen.before ../simple-patches/addback-fileopen.after
untar --non-strict --file ../src/${MES_PKG}.tar