https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119680

            Bug ID: 119680
           Summary: [15 Regression] Bootstrap fails with --enable-host-pie
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

We now link libbacktrace.a into collect2 via LIBDEPS where I get the following:

[  275s] g++ -pie   -fmessage-length=0 -grecord-gcc-switches -O2
-funwind-tables
 -fasynchronous-unwind-tables -fstack-clash-protection -g     -DIN_GCC
-DCROSS_D
IRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-
Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute
 -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-va
riadic-macros -Wno-overlength-strings  -DHAVE_CONFIG_H -pie -static-libstdc++
-s
tatic-libgcc  -o Tcollect2 \
[  275s]        collect2.o collect2-aix.o vec.o ggc-none.o collect-utils.o
file-
find.o hash-table.o selftest.o libcommon.a ../libcpp/libcpp.a  
../libbacktrace/
.libs/libbacktrace.a ../libiberty/pic/libiberty.a
../libdecnumber/libdecnumber.a

[  275s]
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld
: ../libbacktrace/.libs/libbacktrace.a(backtrace.o): relocation R_X86_64_32
agai
nst `.text' can not be used when making a PIE object; recompile with -fPIE
[  275s]
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld
: failed to set dynamic section sizes: bad value
[  275s] collect2: error: ld returned 1 exit status
[  275s] make[2]: *** [Makefile:2587: collect2] Error 1

It seems while we have elaborate setup for libiberty:

# Use the "pic" build of libiberty if --enable-host-shared or
--enable-host-pie,
# unless we are building for mingw.
LIBIBERTY_PICDIR=$(if $(findstring mingw,$(target)),,pic)
ifneq ($(enable_host_shared)$(enable_host_pie),)
LIBIBERTY = ../libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
else    
LIBIBERTY = ../libiberty/libiberty.a
endif
ifeq ($(enable_host_shared),yes)
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
else    
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
endif   

we lack any such for libbacktrace.  I'm not sure why we now end up using
libbacktrace.a from collect2 or whether apart from collect2 sth else is
affected as well.  We don't build a PIC host libbacktrace.

Reply via email to