From 2306701d2c4f9ad2dd493e4cff4188b8faa23b83 Mon Sep 17 00:00:00 2001 From: Roy Storey Date: Mon, 24 Sep 2018 23:51:55 +1200 Subject: clang check before add to CT_CFLAGS_FOR_BUILD/HOST diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh index 9804a6c..b15a488 100644 --- a/scripts/crosstool-NG.sh +++ b/scripts/crosstool-NG.sh @@ -523,6 +523,9 @@ if [ -z "${CT_RESTART}" ]; then CT_LDFLAGS_FOR_BUILD="-L${CT_BUILDTOOLS_PREFIX_DIR}/lib" CT_LDFLAGS_FOR_BUILD+=" ${CT_EXTRA_LDFLAGS_FOR_BUILD}" + if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then + CT_CFLAGS_FOR_BUILD+=" -Qunused-arguments" + fi case "${CT_BUILD}" in *darwin*) # Two issues while building on MacOS. Really, we should be checking for @@ -550,6 +553,9 @@ if [ -z "${CT_RESTART}" ]; then CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}" CT_LDFLAGS_FOR_HOST="-L${CT_HOST_COMPLIBS_DIR}/lib" CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}" + if ${CT_HOST}-gcc --version 2>&1 | grep clang; then + CT_CFLAGS_FOR_HOST+=" -Qunused-arguments" + fi case "${CT_HOST}" in *darwin*) # Same as above, for host -- cgit v0.10.2-6-g49f6 From 5d84835f908172cf170045395e203346890f02bd Mon Sep 17 00:00:00 2001 From: Roy Storey Date: Tue, 25 Sep 2018 00:04:02 +1200 Subject: decouple darwin/clang here as per #712 https://github.com/crosstool-ng/crosstool-ng/issues/712#issuecomment-300891861 diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index c73e430..b605392 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -104,18 +104,17 @@ do_debug_gdb_build() { cross_LDFLAGS+=" -static" fi - case "${CT_HOST}" in - *darwin*) - # FIXME: Really, we should be testing for host compiler being clang. - cross_CFLAGS+=" -Qunused-arguments" - cross_CXXFLAGS+=" -Qunused-arguments" - # clang detects the line from gettext's _ macro as format string - # not being a string literal and produces a lot of warnings - which - # ct-ng's logger faithfully relays to user if this happens in the - # error() function. Suppress them. - cross_extra_config+=("--enable-build-warnings=,-Wno-format-nonliteral,-Wno-format-security") - ;; - esac + if ${CT_HOST}-gcc --version 2>&1 | grep clang; then + # FIXME: Now we really are testing for host compiler being clang + # (also in crosstool-NG.sh), commented + # cross_CFLAGS+=" -Qunused-arguments" + cross_CXXFLAGS+=" -Qunused-arguments" + # clang detects the line from gettext's _ macro as format string + # not being a string literal and produces a lot of warnings - which + # ct-ng's logger faithfully relays to user if this happens in the + # error() function. Suppress them. + cross_extra_config+=("--enable-build-warnings=,-Wno-format-nonliteral,-Wno-format-security") + fi # Fix up whitespace. Some older GDB releases (e.g. 6.8a) get confused if there # are multiple consecutive spaces: sub-configure scripts replace them with a -- cgit v0.10.2-6-g49f6 From 841c6fc8c19fb1388119198becaaef7f03dc7ee7 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 13 Feb 2019 13:42:15 -0800 Subject: Use CFLAGS for both CFLAGS/CXXFLAGS in GDB These config variables are documented as such anyway. Signed-off-by: Alexey Neyman diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index b605392..72d13df 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -21,9 +21,6 @@ do_debug_gdb_build() { local CT_HOST_CXX="${CT_HOST}-g++" local CT_HOST_LD="${CT_HOST}-ld" - local CT_CXXFLAGS_FOR_HOST=${CT_CFLAGS_FOR_HOST} - local CT_TARGET_CXXFLAGS=${CT_ALL_TARGET_CFLAGS} - gdb_src_dir="${CT_SRC_DIR}/gdb" if [ "${CT_GDB_HAS_PKGVERSION_BUGURL}" = "y" ]; then @@ -34,7 +31,7 @@ do_debug_gdb_build() { if [ "${CT_GDB_CROSS}" = "y" ]; then local -a cross_extra_config local gcc_version p _p - local cross_CFLAGS cross_CXXFLAGS cross_LDFLAGS + local cross_CFLAGS cross_LDFLAGS CT_DoStep INFO "Installing cross-gdb" CT_DoLog EXTRA "Configuring cross-gdb" @@ -95,20 +92,14 @@ do_debug_gdb_build() { fi cross_CFLAGS="${CT_CFLAGS_FOR_HOST}" - cross_CXXFLAGS="${CT_CXXFLAGS_FOR_HOST}" cross_LDFLAGS="${CT_LDFLAGS_FOR_HOST}" if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then cross_CFLAGS+=" -static" - cross_CXXFLAGS+=" -static" cross_LDFLAGS+=" -static" fi if ${CT_HOST}-gcc --version 2>&1 | grep clang; then - # FIXME: Now we really are testing for host compiler being clang - # (also in crosstool-NG.sh), commented - # cross_CFLAGS+=" -Qunused-arguments" - cross_CXXFLAGS+=" -Qunused-arguments" # clang detects the line from gettext's _ macro as format string # not being a string literal and produces a lot of warnings - which # ct-ng's logger faithfully relays to user if this happens in the @@ -121,7 +112,6 @@ do_debug_gdb_build() { # single space and then complain that $CC value changed from that in # the master directory. cross_CFLAGS=`echo ${cross_CFLAGS}` - cross_CXXFLAGS=`echo ${cross_CXXFLAGS}` cross_LDFLAGS=`echo ${cross_LDFLAGS}` # Disable binutils options when building from the binutils-gdb repo. @@ -137,7 +127,7 @@ do_debug_gdb_build() { CXX="${CT_HOST_CXX}" \ LD="${CT_HOST_LD}" \ CFLAGS="${cross_CFLAGS}" \ - CXXFLAGS="${cross_CXXFLAGS}" \ + CXXFLAGS="${cross_CFLAGS}" \ LDFLAGS="${cross_LDFLAGS}" \ ${CONFIG_SHELL} \ "${gdb_src_dir}/configure" \ @@ -187,7 +177,7 @@ do_debug_gdb_build() { # TBD combine GDB native and gdbserver backends, build either or both in a single pass. if [ "${CT_GDB_NATIVE}" = "y" ]; then local -a native_extra_config - local native_CFLAGS native_CXXFLAGS native_LDFLAGS + local native_CFLAGS native_LDFLAGS CT_DoStep INFO "Installing native gdb" CT_DoLog EXTRA "Configuring native gdb" @@ -240,12 +230,10 @@ do_debug_gdb_build() { fi native_CFLAGS="${CT_ALL_TARGET_CFLAGS}" - native_CXXFLAGS="${CT_ALL_TARGET_CFLAGS}" native_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}" if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then native_CFLAGS+=" -static" - native_CXXFLAGS+=" -static" native_LDFLAGS+=" -static" fi @@ -257,7 +245,6 @@ do_debug_gdb_build() { native_extra_config+=("--disable-gas") native_CFLAGS=`echo ${native_CFLAGS}` - native_CXXFLAGS=`echo ${native_CXXFLAGS}` native_LDFLAGS=`echo ${native_LDFLAGS}` CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'" @@ -268,7 +255,7 @@ do_debug_gdb_build() { CXX="${CT_TARGET_CXX}" \ LD="${CT_TARGET_LD}" \ CFLAGS="${native_CFLAGS}" \ - CXXFLAGS="${native_CXXFLAGS}" \ + CXXFLAGS="${native_CFLAGS}" \ LDFLAGS="${native_LDFLAGS}" \ ${CONFIG_SHELL} \ "${gdb_src_dir}/configure" \ @@ -303,7 +290,7 @@ do_debug_gdb_build() { if [ "${CT_GDB_GDBSERVER}" = "y" ]; then local -a gdbserver_extra_config - local gdbserver_CFLAGS gdbserver_CXXFLAGS gdbserver_LDFLAGS + local gdbserver_CFLAGS gdbserver_LDFLAGS CT_DoStep INFO "Installing gdbserver" CT_DoLog EXTRA "Configuring gdbserver" @@ -337,12 +324,10 @@ do_debug_gdb_build() { gdbserver_extra_config+=("--disable-gas") gdbserver_CFLAGS="${CT_ALL_TARGET_CFLAGS}" - gdbserver_CXXFLAGS="${CT_ALL_TARGET_CFLAGS}" gdbserver_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}" if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then gdbserver_CFLAGS+=" -static" - gdbserver_CXXFLAGS+=" -static" gdbserver_LDFLAGS+=" -static" fi @@ -351,7 +336,6 @@ do_debug_gdb_build() { fi gdbserver_CFLAGS=`echo ${gdbserver_CFLAGS}` - gdbserver_CXXFLAGS=`echo ${gdbserver_CXXFLAGS}` gdbserver_LDFLAGS=`echo ${gdbserver_LDFLAGS}` CT_DoLog DEBUG "Extra config passed: '${gdbserver_extra_config[*]}'" @@ -362,7 +346,7 @@ do_debug_gdb_build() { CXX="${CT_TARGET_CXX}" \ LD="${CT_TARGET_LD}" \ CFLAGS="${gdbserver_CFLAGS}" \ - CXXFLAGS="${gdbserver_CXXFLAGS}" \ + CXXFLAGS="${gdbserver_CFLAGS}" \ LDFLAGS="${gdbserver_LDFLAGS}" \ ${CONFIG_SHELL} \ "${gdb_src_dir}/gdb/gdbserver/configure" \ -- cgit v0.10.2-6-g49f6 From 1a3b562c75e40f9c2914727aa909d7605786eddc Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 13 Feb 2019 14:44:34 -0800 Subject: Check for lzip (some archives are lzipped) Ideally, we should just skip the archives for which we don't have the utilities; let's leave it until I convert the "trivial checks" part of crosstool-NG.sh into a separate configure script. Signed-off-by: Alexey Neyman diff --git a/configure.ac b/configure.ac index f5955b3..729047d 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,7 @@ CTNG_CHECK_PROGS_REQ([readlink], [readlink]) CTNG_CHECK_PROGS_REQ([tar], [tar]) CTNG_CHECK_PROGS_REQ([gzip], [gzip]) CTNG_CHECK_PROGS_REQ([bzip2], [bzip2]) +CTNG_CHECK_PROGS_REQ([lzip], [lzip]) CTNG_CHECK_PROGS_REQ([xz], [xz]) CTNG_CHECK_PROGS_REQ([unzip], [unzip]) CTNG_CHECK_PROGS_REQ([help2man], [help2man]) -- cgit v0.10.2-6-g49f6