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

            Bug ID: 110550
           Summary: libintl build without -fPIC even though
                    --enable-shared is configured
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: swi...@sha-bang.de
  Target Milestone: ---

This is kind of a sequel to #100096

Building on NetBSD 9.3 amd64

Configured with:
LDFLAGS="-L/usr/local/lib -R/usr/local/lib" ../gcc-12.3.0/configure \
  --enable-shared \
  --enable-host-shared \
  --enable-checking=release \
  --enable-languages=jit \
  --disable-multilib \
  --disable-libssp \
  --disable-lto \
  --disable-libquadmath \
  --disable-liboffloadmic \
  --disable-libada \
  --disable-libsanitizer \
  --disable-libquadmath-support \
  --disable-libgomp \
  --disable-libvtv \
  --disable-libsanitizer \
  --with-gmp=/usr/local \
  --with-mpc=/usr/local \
  --with-mpfr=/usr/local

building fails, because libintl.a is build without -fPIC:

/usr/bin/ld: ./../intl/libintl.a(bindtextdom.o): relocation R_X86_64_32 against
symbol `libintl_nl_default_dirname' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: ./../intl/libintl.a(loadmsgcat.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: ./../intl/libintl.a(textdomain.o): relocation R_X86_64_32 against
symbol `libintl_nl_default_default_domain' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: ./../intl/libintl.a(dcigettext.o): relocation R_X86_64_32S against
`.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ./../intl/libintl.a(plural-exp.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: ./../intl/libintl.a(localcharset.o): relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a shared object; recompile
with -fPIC
/usr/bin/ld: ./../intl/libintl.a(localename.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: ./../intl/libintl.a(log.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: ./../intl/libintl.a(finddomain.o): relocation R_X86_64_32 against
`.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ./../intl/libintl.a(localealias.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: ./../intl/libintl.a(plural.o): relocation R_X86_64_32S against
`.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
gmake[3]: *** [../../gcc-12.3.0/gcc/jit/Make-lang.in:168: libgccjit.so.0.0.1]
Error 1
gmake[3]: *** Waiting for unfinished jobs....
rm gcc.pod
gmake[3]: Leaving directory '/home/wilde/src/gcc/gcc-12.3.0-build_noboot/gcc'
gmake[2]: *** [Makefile:5038: all-stage3-gcc] Error 2
gmake[2]: Leaving directory '/home/wilde/src/gcc/gcc-12.3.0-build_noboot'
gmake[1]: *** [Makefile:22605: stage3-bubble] Error 2
gmake[1]: Leaving directory '/home/wilde/src/gcc/gcc-12.3.0-build_noboot'
gmake: *** [Makefile:1067: all] Error 2

Strange enough, when manually entering the directory `intl` and
rebuilding the library simply by issuing `make clean ; make` it _will_
be build with -fPIC as expected.

Reply via email to