From 32c5952980984a8ecf3753edd543401f2f324803 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 23 Oct 2015 18:09:41 -0700 Subject: [PATCH 1/2] Revert "Remove ltrace from samples" This reverts commit a3bb2aeb4445bef4250acaaff99fc8dbb0599f8b. --- samples/arm-cortex_a8-linux-gnueabi/crosstool.config | 1 + samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config | 1 + samples/arm-unknown-linux-gnueabi/crosstool.config | 1 + samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 1 + samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config | 1 + samples/armeb-unknown-linux-gnueabi/crosstool.config | 1 + samples/i686-nptl-linux-gnu/crosstool.config | 1 + 7 files changed, 7 insertions(+) diff --git a/samples/arm-cortex_a8-linux-gnueabi/crosstool.config b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config index b9c424c8..3680597b 100644 --- a/samples/arm-cortex_a8-linux-gnueabi/crosstool.config +++ b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config @@ -20,4 +20,5 @@ CT_DEBUG_gdb=y # CT_GDB_CROSS_PYTHON is not set CT_GDB_NATIVE=y CT_GDB_NATIVE_STATIC=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config b/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config index 54c6d8fb..a64912c8 100644 --- a/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config +++ b/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config @@ -25,4 +25,5 @@ CT_DEBUG_duma=y CT_DEBUG_gdb=y CT_GDB_CROSS_STATIC=y CT_GDB_NATIVE=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/arm-unknown-linux-gnueabi/crosstool.config b/samples/arm-unknown-linux-gnueabi/crosstool.config index 9f98caf9..9105b6f4 100644 --- a/samples/arm-unknown-linux-gnueabi/crosstool.config +++ b/samples/arm-unknown-linux-gnueabi/crosstool.config @@ -17,4 +17,5 @@ CT_DEBUG_duma=y CT_DEBUG_gdb=y # CT_GDB_CROSS_PYTHON is not set CT_GDB_NATIVE=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config b/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config index 486c0918..06b279f2 100644 --- a/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config +++ b/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config @@ -20,4 +20,5 @@ CT_DEBUG_gdb=y CT_GDB_CROSS_STATIC=y CT_GDB_NATIVE=y CT_GDB_NATIVE_STATIC=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config b/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config index bbb503b2..f3162f8d 100644 --- a/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config +++ b/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config @@ -23,4 +23,5 @@ CT_DEBUG_gdb=y CT_GDB_CROSS_STATIC=y CT_GDB_NATIVE=y CT_GDB_NATIVE_STATIC=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/armeb-unknown-linux-gnueabi/crosstool.config b/samples/armeb-unknown-linux-gnueabi/crosstool.config index 6c10fd7b..a16a867a 100644 --- a/samples/armeb-unknown-linux-gnueabi/crosstool.config +++ b/samples/armeb-unknown-linux-gnueabi/crosstool.config @@ -18,4 +18,5 @@ CT_DEBUG_duma=y CT_DEBUG_gdb=y # CT_GDB_CROSS_PYTHON is not set CT_GDB_NATIVE=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y diff --git a/samples/i686-nptl-linux-gnu/crosstool.config b/samples/i686-nptl-linux-gnu/crosstool.config index 668881ac..78ab5007 100644 --- a/samples/i686-nptl-linux-gnu/crosstool.config +++ b/samples/i686-nptl-linux-gnu/crosstool.config @@ -16,4 +16,5 @@ CT_DEBUG_duma=y CT_DEBUG_gdb=y # CT_GDB_CROSS_PYTHON is not set CT_GDB_NATIVE=y +CT_DEBUG_ltrace=y CT_DEBUG_strace=y From 0a050d339044d6d0638fd20bcb181d4cb00191f5 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 26 Oct 2015 18:31:54 -0700 Subject: [PATCH 2/2] Clean up *.la after installing compiler/libraries. Having *.la in the installation directory breaks ltrace: in ltrace, libtool somehow considers libsupc++ to be an "accessory library" and does not add -lsupc++ to the link flags. Neither Ubuntu, nor RedHat include *.la files into their packages for libstdc++. Signed-off-by: Alexey Neyman --- scripts/build/cc/100-gcc.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 1056221d..28dda1d5 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -535,6 +535,16 @@ do_gcc_core_backend() { CT_DoLog EXTRA "Installing ${log_txt}" CT_DoExecLog ALL make ${JOBSFLAGS} ${extra_user_env} ${core_targets_install} + # Remove the libtool "pseudo-libraries": having them in the installed + # tree makes the libtoolized utilities that are built next assume + # that, for example, libsupc++ is an "accessory library", and not include + # -lsupc++ to the link flags. That breaks ltrace, for example. + CT_DoLog EXTRA "Housekeeping for final gcc compiler" + CT_Pushd "${prefix}" + find . -type f -name "*.la" -exec rm {} \; |CT_DoLog ALL + CT_Popd + + if [ "${build_manuals}" = "yes" ]; then CT_DoLog EXTRA "Building the GCC manuals" CT_DoExecLog ALL make pdf html @@ -932,6 +942,15 @@ do_gcc_backend() { CT_DoLog EXTRA "Installing final gcc compiler" CT_DoExecLog ALL make ${JOBSFLAGS} install + # Remove the libtool "pseudo-libraries": having them in the installed + # tree makes the libtoolized utilities that are built next assume + # that, for example, libsupc++ is an "accessory library", and not include + # -lsupc++ to the link flags. That breaks ltrace, for example. + CT_DoLog EXTRA "Housekeeping for final gcc compiler" + CT_Pushd "${prefix}" + find . -type f -name "*.la" -exec rm {} \; |CT_DoLog ALL + CT_Popd + if [ "${build_manuals}" = "yes" ]; then CT_DoLog EXTRA "Building the GCC manuals" CT_DoExecLog ALL make pdf html