Distinguish between gcc and mescc; select LIBS accordingly.
* build-aux/check.sh.in: Distinguish between gcc and mescc; add MES_CHECKING_BUILTIN_LIBS. * build-aux/test-c.sh: Use it to select LIBS accordingly.
This commit is contained in:
parent
56f859200e
commit
237dd8a0f0
|
@ -79,6 +79,8 @@ if test $compiler = gcc; then
|
||||||
cd gcc-lib
|
cd gcc-lib
|
||||||
srcdest=$srcdir/../
|
srcdest=$srcdir/../
|
||||||
srcdir=../$srcdir
|
srcdir=../$srcdir
|
||||||
|
MES_CHECKING_BUILTIN_LIBS="-l gcc"
|
||||||
|
export MES_CHECKING_BUILTIN_LIBS
|
||||||
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
@ -97,7 +99,8 @@ fi
|
||||||
LDFLAGS="
|
LDFLAGS="
|
||||||
-nostdlib
|
-nostdlib
|
||||||
"
|
"
|
||||||
LIBS="-lc -lmescc"
|
MES_CHECKING_BUILTIN_LIBS="-l mescc"
|
||||||
|
export MES_CHECKING_BUILTIN_LIBS
|
||||||
AR="${srcdest}pre-inst-env mesar"
|
AR="${srcdest}pre-inst-env mesar"
|
||||||
CC="${srcdest}pre-inst-env mescc"
|
CC="${srcdest}pre-inst-env mescc"
|
||||||
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
||||||
|
|
|
@ -40,16 +40,25 @@ rm -f "$o"
|
||||||
CC=${CC-gcc}
|
CC=${CC-gcc}
|
||||||
|
|
||||||
i=$(basename "$t" .c)
|
i=$(basename "$t" .c)
|
||||||
|
|
||||||
|
if [ -z "${MES_CHECKING_BUILTIN_LIBS}" ]
|
||||||
|
then
|
||||||
|
MES_CHECKING_BUILTIN_LIBS="`${CC} --print-libgcc-file-name`"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "${i/[012][0-9]-*/}" ]; then
|
if [ -z "${i/[012][0-9]-*/}" ]; then
|
||||||
LIBS='-l mescc'
|
LIBS="${MES_CHECKING_BUILTIN_LIBS}"
|
||||||
elif [ -z "${i/[34][0-9]-*/}" ]; then
|
elif [ -z "${i/[34][0-9]-*/}" ]; then
|
||||||
LIBS='-l c-mini -l mescc'
|
LIBS="-l c-mini ${MES_CHECKING_BUILTIN_LIBS} -l c-mini"
|
||||||
elif [ -z "${i/[78][0-9a-z]-*/}" ]; then
|
elif [ -z "${i/[78][0-9a-z]-*/}" ]; then
|
||||||
LIBS='-l c+tcc -l mescc'
|
LIBS="-l c+tcc ${MES_CHECKING_BUILTIN_LIBS} -l c+tcc"
|
||||||
elif [ -z "${i/9[0-9a-z]-*/}" ]; then
|
elif [ -z "${i/9[0-9a-z]-*/}" ]; then
|
||||||
LIBS='-l c+gnu -l mescc'
|
LIBS="-l c+gnu ${MES_CHECKING_BUILTIN_LIBS} -l c+gnu"
|
||||||
else
|
else
|
||||||
LIBS='-l c -l mescc'
|
# Make it possible to resolve raise(), required by libgcc.a, provided
|
||||||
|
# in libc.a. The final command line has to have "-lc -lgcc -lc".
|
||||||
|
# See <https://www.openwall.com/lists/musl/2018/05/09/1>.
|
||||||
|
LIBS="-l c ${MES_CHECKING_BUILTIN_LIBS} -l c"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $mes_kernel = gnu\
|
if test $mes_kernel = gnu\
|
||||||
|
|
Loading…
Reference in a new issue