mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-03-02 20:08:35 +00:00
Workaround for static uClibc-ng issue with -lpthread
Also, preserve .config when running test-package.sh. Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
parent
e83a2e2333
commit
1e4eeb5c3b
@ -189,6 +189,8 @@ EOF
|
|||||||
CT_EndStep
|
CT_EndStep
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mv .config .config-saved
|
||||||
. maintainer/package-versions
|
. maintainer/package-versions
|
||||||
|
mv .config-saved .config
|
||||||
|
|
||||||
rm -rf ${CT_TARBALLS_DIR} ${CT_COMMON_SRC_DIR}
|
rm -rf ${CT_TARBALLS_DIR} ${CT_COMMON_SRC_DIR}
|
||||||
|
@ -233,7 +233,11 @@ do_cc_core_pass_2() {
|
|||||||
# later, we need to build libgcc
|
# later, we need to build libgcc
|
||||||
case "${CT_THREADS}" in
|
case "${CT_THREADS}" in
|
||||||
nptl)
|
nptl)
|
||||||
|
if [ "${CT_SHARED_LIBS}" = "y" ]; then
|
||||||
core_opts+=( "mode=shared" )
|
core_opts+=( "mode=shared" )
|
||||||
|
else
|
||||||
|
core_opts+=( "mode=static" )
|
||||||
|
fi
|
||||||
core_opts+=( "build_libgcc=yes" )
|
core_opts+=( "build_libgcc=yes" )
|
||||||
;;
|
;;
|
||||||
win32)
|
win32)
|
||||||
@ -873,10 +877,13 @@ do_gcc_backend() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "${CT_SHARED_LIBS}" = "y" ] || extra_config+=("--disable-shared")
|
|
||||||
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
||||||
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
|
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
|
||||||
|
|
||||||
|
if [ "${CT_SHARED_LIBS}" != "y" ]; then
|
||||||
|
extra_config+=("--disable-shared")
|
||||||
|
fi
|
||||||
|
|
||||||
case "${CT_CC_GCC_SJLJ_EXCEPTIONS}" in
|
case "${CT_CC_GCC_SJLJ_EXCEPTIONS}" in
|
||||||
y) extra_config+=("--enable-sjlj-exceptions");;
|
y) extra_config+=("--enable-sjlj-exceptions");;
|
||||||
m) ;;
|
m) ;;
|
||||||
|
@ -150,6 +150,9 @@ do_libc_backend_once() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# FIXME static version of glibc seems to be broken:
|
||||||
|
# build tries to use libc-modules.h which is generated from
|
||||||
|
# soversions.i, which is only created for builds with shared libs.
|
||||||
case "${CT_SHARED_LIBS}" in
|
case "${CT_SHARED_LIBS}" in
|
||||||
y) extra_config+=("--enable-shared");;
|
y) extra_config+=("--enable-shared");;
|
||||||
*) extra_config+=("--disable-shared");;
|
*) extra_config+=("--disable-shared");;
|
||||||
@ -308,8 +311,6 @@ do_libc_backend_once() {
|
|||||||
"${extra_make_args[@]}" \
|
"${extra_make_args[@]}" \
|
||||||
install-headers
|
install-headers
|
||||||
|
|
||||||
# For glibc, a few headers need to be manually installed
|
|
||||||
if [ "${CT_LIBC}" = "glibc" ]; then
|
|
||||||
# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
|
# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
|
||||||
# so do them by hand. We can tolerate an empty stubs.h for the moment.
|
# so do them by hand. We can tolerate an empty stubs.h for the moment.
|
||||||
# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
|
# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
|
||||||
@ -343,7 +344,6 @@ do_libc_backend_once() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
elif [ "${libc_mode}" = "final" -a -r "${multi_root}/.libc_headers_installed" ]; then
|
elif [ "${libc_mode}" = "final" -a -r "${multi_root}/.libc_headers_installed" ]; then
|
||||||
CT_DoExecLog ALL rm -f "${multi_root}/.libc_headers_installed"
|
CT_DoExecLog ALL rm -f "${multi_root}/.libc_headers_installed"
|
||||||
fi # installing headers
|
fi # installing headers
|
||||||
|
@ -164,9 +164,22 @@ CT_PREFIX_DIR="$( ${sed} -r -e 's:/+:/:g; s:/*$::;' <<<"${CT_PREFIX_DIR}" )"
|
|||||||
# Put user-supplied flags at the end, so that they take precedence.
|
# Put user-supplied flags at the end, so that they take precedence.
|
||||||
CT_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}"
|
CT_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}"
|
||||||
CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
|
CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
|
||||||
|
|
||||||
|
# FIXME move to gcc.sh
|
||||||
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_CORE_EXTRA_CONFIG} "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
|
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_CORE_EXTRA_CONFIG} "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
|
||||||
CT_CC_GCC_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_EXTRA_CONFIG} "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
|
CT_CC_GCC_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_EXTRA_CONFIG} "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
|
||||||
|
|
||||||
|
# Starting with 1.0.20, applications using uClibc-ng do not link with
|
||||||
|
# the default libgcc_c_spec used by GCC if only static libc.a exists - unless
|
||||||
|
# -static is thrown in. The difference is that with -static, gcc passes
|
||||||
|
# "--start-group -lgcc -lc --end-group" and without -static, it passes
|
||||||
|
# "-lgcc -lc -lgcc" instead. The latter leaves a symbol from 2nd libgcc
|
||||||
|
# (dl_iterate_phdr) unresolved because -lc is already done at this point.
|
||||||
|
# Force static link on the target.
|
||||||
|
if [ "${CT_SHARED_LIBS}" != "y" ]; then
|
||||||
|
CT_TARGET_LDFLAGS+=" -static"
|
||||||
|
fi
|
||||||
|
|
||||||
# Compute the package version string
|
# Compute the package version string
|
||||||
if [ "${CT_SHOW_CT_VERSION}" = "y" ]; then
|
if [ "${CT_SHOW_CT_VERSION}" = "y" ]; then
|
||||||
CT_PKGVERSION="crosstool-NG ${CT_VERSION}${CT_TOOLCHAIN_PKGVERSION:+ - ${CT_TOOLCHAIN_PKGVERSION}}"
|
CT_PKGVERSION="crosstool-NG ${CT_VERSION}${CT_TOOLCHAIN_PKGVERSION:+ - ${CT_TOOLCHAIN_PKGVERSION}}"
|
||||||
|
@ -318,10 +318,24 @@ CT_DoExecLog() {
|
|||||||
local level="$1"
|
local level="$1"
|
||||||
local cur_cmd
|
local cur_cmd
|
||||||
local ret
|
local ret
|
||||||
|
local cmd_seen
|
||||||
shift
|
shift
|
||||||
|
|
||||||
(
|
(
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
|
case "${i}" in
|
||||||
|
*=*)
|
||||||
|
if [ -z "${cmd_seen}" ]; then
|
||||||
|
cur_cmd+=" ${i%%=*}='${i#*=}'"
|
||||||
|
else
|
||||||
cur_cmd+=" '${i}'"
|
cur_cmd+=" '${i}'"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cur_cmd+=" '${i}'"
|
||||||
|
cmd_seen=y
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
while true; do
|
while true; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user