diff options
authorBoud Roukema <boud@cosmo.torun.pl>2021-10-01 03:35:22 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2021-10-01 16:15:41 +0200
commit775fc036e0091f05ff56e41b855bc416b9ed36c8 (patch)
parent3a1b96766c9d5c9845f8baacbbf88978db9c3f49 (diff)
Configuration: GCC not linking to system libunwind (crashed GCC's build)HEADmaneage
This commit provides a hack/correction to the unwrapped GCC source files that sym-links the generic file 'libgcc/unwind-generic.h' to the two directories in which a file includes "unwind.h" or <unwind.h>. The aim is that the gcc compilation system uses this header file from the internal gcc source files instead of searching for a system-level file 'unwind.h'. This commit also unaliases two 'ls' commands in some build recipes of 'basic.mk' in case the host system (normally at user level) has aliased the command to something like 'ls -F'. In the situation that sometimes occurs of library files being given executable status, the '-F' decorative option could lead to an asterisk being included in a string that is not expected to contain asterisks. If the system shell does not contain the 'alias' command at all, then a fallback of 'true' should provide safe behaviour. The notation of the 'sed' command is also clarified. This solves bug #61240: https://savannah.nongnu.org/bugs/index.php?61240
1 files changed, 10 insertions, 1 deletions
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index 0d114db..6910593 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -461,9 +461,10 @@ $(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version)
if [ x$(on_mac_os) = xyes ]; then so="dylib"; else so="so"; fi
if [ -f $(ildir)/libncursesw.$$so ]; then
+ unalias ls || true # avoid decorated 'ls' commands with extra characters
sov=$$(ls -l $(ildir)/libncursesw* \
| awk '/^-/{print $$NF}' \
- | sed -e's|'$(ildir)/libncursesw.'||')
+ | sed -e "s;$(ildir)/libncursesw\.;;")
cd "$(ildir)"
for lib in ncurses ncurses++ form panel menu; do
@@ -690,6 +691,7 @@ $(ibidir)/coreutils-$(coreutils-version): \
# Fix RPATH if necessary.
if [ -f $(ibdir)/patchelf ]; then
make SHELL=$(ibdir)/bash install DESTDIR=junkinst
+ unalias ls || true # avoid decorated 'ls' commands with extra characters
instprogs=$$(ls junkinst/$(ibdir))
for f in $$instprogs; do
$(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/$$f
@@ -1415,6 +1417,13 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
ln -s $$odir/gcc-$(gcc-version) $(ddir)/gcc-$(gcc-version)
cd gcc-$(gcc-version)
+ # Handle bug https://savannah.nongnu.org/bugs/index.php?61240 in
+ # which gcc preferentially uses a system-level 'unwind' library
+ # rather than using its own one.
+ ln -sf ../../libgcc/unwind-generic.h libstdc++-v3/libsupc++/unwind.h
+ ln -sf ../libgcc/unwind-generic.h libitm/unwind.h
mkdir build
cd build