diff options
23 files changed, 50 insertions, 225 deletions
diff --git a/Makefile.in b/Makefile.in index f0034cb4..aa27d611 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,6 +81,7 @@ export LIBS := @LIBS@ export INTL_LIBS := @INTL_LIBS@ export curses_hdr := @ac_ct_curses_hdr@ export gettext := @gettext@ +export CPU_COUNT := @CPU_COUNT@ # config options to push down to kconfig KCONFIG:= @kconfig_options@ @@ -192,6 +193,7 @@ define sed_it -e 's,@@CT_awk@@,$(awk),g;' \ -e 's,@@CT_wget@@,$(wget),g;' \ -e 's,@@CT_curl@@,$(curl),g;' \ + -e 's,@@CT_cpucount@@,$(CPU_COUNT),g;' \ $< >$@ endef diff --git a/configure.ac b/configure.ac index 3c943920..d80a5cd8 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,15 @@ ACX_SET_KCONFIG_OPTION([stat_flavor_BSD]) test "$acx_cv_stat_flavor" = "GNU" && stat_flavor_GNU=y ACX_SET_KCONFIG_OPTION([stat_flavor_GNU]) +#Find out how to count CPUs +AC_CACHE_CHECK([whether to use getconf or sysctl to count CPUs], + [acx_cv_cpu_count], + [getconf _NPROCESSORS_ONLN >/dev/null 2>&1 && \ + acx_cv_cpu_count="getconf _NPROCESSORS_ONLN" + sysctl -n hw.ncpu >/dev/null 2>&1 && \ + acx_cv_cpu_count="sysctl -n hw.ncpu"]) +AC_SUBST(CPU_COUNT, "$acx_cv_cpu_count") + #-------------------------------------------------------------------- # Still boring, but remember the path, now... #-------------------------------------------------------------------- diff --git a/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628c..00000000 --- a/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh index c81874a8..e6a4875d 100644 --- a/scripts/build/companion_libs/100-gmp.sh +++ b/scripts/build/companion_libs/100-gmp.sh @@ -88,7 +88,10 @@ do_gmp_backend() { extra_config+=("--enable-mpbsd") fi + # FIXME: GMP's configure script doesn't respect the host parameter + # when not cross-compiling, ie when build == host. CT_DoExecLog CFG \ + CC="${host}-gcc" \ CFLAGS="${cflags} -fexceptions" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 18ada66a..95fb72b4 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -17,6 +17,9 @@ do_finish() { *darwin*) strip_args="" ;; + *freebsd*) + strip_args="--strip-all" + ;; *) strip_args="--strip-all -v" ;; diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index 9cfc433f..cd4a4566 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -103,24 +103,28 @@ do_kernel_headers() { esac CT_DoLog EXTRA "Installing kernel headers" - CT_DoExecLog ALL \ - make -C "${kernel_path}" \ - CROSS_COMPILE="${CT_TARGET}-" \ - O="${CT_BUILD_DIR}/build-kernel-headers" \ - ARCH=${kernel_arch} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ + CT_DoExecLog ALL \ + make -C "${kernel_path}" \ + BASH="$(which bash)" \ + HOSTCC="${CT_BUILD}-gcc" \ + CROSS_COMPILE="${CT_TARGET}-" \ + O="${CT_BUILD_DIR}/build-kernel-headers" \ + ARCH=${kernel_arch} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ headers_install if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then CT_DoLog EXTRA "Checking installed headers" - CT_DoExecLog ALL \ - make -C "${kernel_path}" \ - CROSS_COMPILE="${CT_TARGET}-" \ - O="${CT_BUILD_DIR}/build-kernel-headers" \ - ARCH=${kernel_arch} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ + CT_DoExecLog ALL \ + make -C "${kernel_path}" \ + BASH="$(which bash)" \ + HOSTCC="${CT_BUILD}-gcc" \ + CROSS_COMPILE="${CT_TARGET}-" \ + O="${CT_BUILD_DIR}/build-kernel-headers" \ + ARCH=${kernel_arch} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ headers_check fi diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index c12a5530..52074579 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -247,6 +247,10 @@ do_libc_backend_once() { [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") touch config.cache + + # Hide host C++ binary from configure + echo "ac_cv_prog_ac_ct_CXX=${CT_TARGET}-g++" >>config.cache + if [ "${CT_LIBC_GLIBC_FORCE_UNWIND}" = "y" ]; then echo "libc_cv_forced_unwind=yes" >>config.cache echo "libc_cv_c_cleanup=yes" >>config.cache @@ -346,13 +350,21 @@ do_libc_backend_once() { build_ldflags="${CT_LDFLAGS_FOR_BUILD}" case "$CT_BUILD" in - *mingw*|*cygwin*|*msys*|*darwin*) + *mingw*|*cygwin*|*msys*|*darwin*|*freebsd*) # When installing headers on Cygwin, Darwin, MSYS2 and MinGW-w64 sunrpc needs # gettext for building cross-rpcgen. build_cppflags="${build_cppflags} -I${CT_BUILDTOOLS_PREFIX_DIR}/include/" build_ldflags="${build_ldflags} -lintl -liconv" + case "$CT_BUILD" in + *cygwin*|*freebsd*) + # Additionally, stat in FreeBSD, Cygwin, and possibly others + # is always 64bit, so replace struct stat64 with stat. + build_cppflags="${build_cppflags} -Dstat64=stat" + ;; + esac ;; esac + extra_make_args+=( "BUILD_CFLAGS=${build_cflags}" ) extra_make_args+=( "BUILD_CPPFLAGS=${build_cppflags}" ) extra_make_args+=( "BUILD_LDFLAGS=${build_ldflags}" ) diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 793c56f5..368f9d24 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -227,7 +227,7 @@ CT_SYS_REVISION=$(uname -r) CT_SYS_OS=$(uname -s) CT_SYS_MACHINE=$(uname -m) CT_SYS_PROCESSOR=$(uname -p) -CT_SYS_GCC=$(gcc -dumpversion) +CT_SYS_GCC=$(${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX} -dumpversion) CT_SYS_TARGET=$(CT_DoConfigGuess) CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_STAR_DATE_HUMAN} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}" @@ -536,7 +536,7 @@ if [ -z "${CT_RESTART}" ]; then fi # Use the number of processors+1 when automatically setting the number of # parallel jobs. Fall back to 1 if the host doesn't use GLIBC. - AUTO_JOBS=$((`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 0` + 1)) + AUTO_JOBS=$((`@@CT_cpucount@@ 2>/dev/null || echo 0` + 1)) [ ${CT_PARALLEL_JOBS} -eq 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${AUTO_JOBS}" [ ${CT_PARALLEL_JOBS} -gt 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}" JOBSFLAGS="${JOBSFLAGS} -l${CT_LOAD}" |