yeah, i see where you mean - as you say, with the trylink script I
just modified it and then rebuilt and didn't worry about it since the
build worked, so that was pretty stupid of me. i've attached a patch
correcting the points you mention in case it's needed.
Quoting Kang-Che Sung <[email protected]>:
On Sun, Jan 22, 2017 at 6:56 AM, J <[email protected]> wrote:
Hello mailing list,
i found (the hard way) that scripts/gen_build_files.sh is making unsafe
assumptions about the nature of /bin/sh; it appears to be presuming that
it's bash or dash or something:
--
GEN runit/Kbuild
/usr/src/install/busybox-1.26.2/scripts/gen_build_files.sh[23]: local: not
found [No such file or directory]
GEN runit/Config.in
HOSTCC scripts/basic/fixdep
/usr/src/install/busybox-1.26.2/scripts/gen_build_files.sh[23]: local: not
found [No such file or directory]
sed: can't read : No such file or directory
sed: can't read : No such file or directory
GEN
mv: cannot rename .tmp to : No such file or directory
/usr/src/install/busybox-1.26.2/scripts/gen_build_files.sh[23]: local: not
found [No such file or directory]
sed: can't read : No such file or directory
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/split-include
sed: can't read : No such file or directory
GEN
mv: cannot rename .tmp to : No such file or directory
/usr/src/install/busybox-1.26.2/scripts/gen_build_files.sh[23]: local: not
found [No such file or directory]
/usr/src/install/busybox-1.26.2/scripts/gen_build_files.sh[23]: local: not
found [No such file or directory]
--
and so on. attached is a patch which fixes this script and thus allows
busybox to build. while i was in scripts/ i also noticed that the "trylink"
script is making the same wrong assumption, so i went ahead and patched it
as well to be safe, and i've attached that also.
Your attached scripts.trylink.diff has bugs. It seems that you just
found-and-
replaced the variables without verifying the script further.
It should give you "cc_r: command not found" and "lig_r: command not found".
I hope you know where I'm talking about.
--- scripts/trylink.orig Sat Jan 21 21:41:30 2017
+++ scripts/trylink Sat Jan 21 21:43:12 2017
@@ -46,23 +46,23 @@
}
check_cc() {
- local tempname="$(mktemp tmp.XXXXXXXXXX)"
- local r
- echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c
+ cc_tempname="$(mktemp tmp.XXXXXXXXXX)"
+ echo "int main(int argc,char**argv){return argv?argc:0;}" >"$cc_tempname".c
# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# Was using "-xc /dev/null", but we need a valid C program.
# "eval" may be needed if CFLAGS can contain
# '... -D"BB_VER=KBUILD_STR(1.N.M)" ...'
# and we need shell to process quotes!
- $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1
- r=$?
- rm -f "$tempname" "$tempname".c "$tempname".o
- return $r
+ $CC $CFLAGS $LDFLAGS $1 "$cc_tempname".c -o "$cc_tempname" >/dev/null 2>&1
+ cc_r=$?
+ rm -f "$cc_tempname" "$cc_tempname".c "$cc_tempname".o
+ return $cc_r
}
check_libc_is_glibc() {
- local tempname="$(mktemp tmp.XXXXXXXXXX)"
- local r
+ lig_tempname="$(mktemp tmp.XXXXXXXXXX)"
echo "\
#include <stdlib.h>
/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
@@ -69,11 +69,11 @@
#if defined(__GLIBC__) && !defined(__UCLIBC__)
syntax error here
#endif
- " >"$tempname".c
- ! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1
- r=$?
- rm -f "$tempname" "$tempname".c "$tempname".o
- return $r
+ " >"$lig_tempname".c
+ ! $CC $CFLAGS "$lig_tempname".c -c -o "$lig_tempname".o >/dev/null 2>&1
+ lig_r=$?
+ rm -f "$lig_tempname" "$lig_tempname".c "$lig_tempname".o
+ return $lig_r
}
EXE="$1"
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox