This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/69790] LTO compiling GCC does not work (lib/bfd-plugin path has unclear location)


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

--- Comment #4 from Дилян Палаузов <dilyan.palauzov at aegee dot org> ---
I don't know precisely what I did a year ago.

--prefix was either /usr or /usr/local.

Nowadays, the documentation of "ld -plugin" and "nm --plugin" state, both tools
use by default different paths to find the same file, so I have a symlink
between /usr/local/lib/bfd-plugins/ and
/usr/local/x86_64-unknown-linux-gnu/lib/bfd-plugins .

Despite of this, for gcc 8 doing

CFLAGS="-pipe -Wall -Wextra -O3 -fno-fat-lto-objects -flto" CXXFLAGS="-pipe
-Wall -Wextra -O3 -fno-fat-lto-objects -flto" LDFLAGS="-Wl,-O1,-s -flto=12"

./configure --enable-host-shared --enable-threads=posix --enable-targets=all
--enable-nls --with-linker-hash-style=gnu --with-system-zlib --disable-multilib
--enable-languages=c,c++,jit,lto

when compiled with 8.0.0 20170427, fails at stage1 with
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgomp/testsuite'
make[5]: Entering directory '/git/gcc/x86_64-pc-linux-gnu/libgomp'
/bin/bash ./libtool --tag=CC   --mode=compile
/git/gcc/host-x86_64-pc-linux-gnu/gcc/xgcc
-B/git/gcc/host-x86_64-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I.
-I../.././libgomp  -I../.././libgomp/config/linux/x86
-I../.././libgomp/config/linux -I../.././libgomp/config/posix -I../.././libgomp
-I../.././libgomp/../include  -Wall -Werror -ftls-model=initial-exec
-Wc,-pthread -g -O2 -pipe -Wall -Wextra -O3 -fno-fat-lto-objects -flto -MT
alloc.lo -MD -MP -MF .deps/alloc.Tpo -c -o alloc.lo ../.././libgomp/alloc.c
libtool: compile:  /git/gcc/host-x86_64-pc-linux-gnu/gcc/xgcc
-B/git/gcc/host-x86_64-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I.
-I../.././libgomp -I../.././libgomp/config/linux/x86
-I../.././libgomp/config/linux -I../.././libgomp/config/posix -I../.././libgomp
-I../.././libgomp/../include -Wall -Werror -pthread -ftls-model=initial-exec -g
-O2 -pipe -Wall -Wextra -O3 -fno-fat-lto-objects -flto -MT alloc.lo -MD -MP -MF
.deps/alloc.Tpo -c ../.././libgomp/alloc.c  -fPIC -DPIC -o .libs/alloc.o
In file included from ../.././libgomp/libgomp.h:123:0,
                 from ../.././libgomp/alloc.c:30:
../.././libgomp/priority_queue.h: In function ‘priority_queue_free’:
../.././libgomp/priority_queue.h:161:45: error: unused parameter ‘head’
[-Werror=unused-parameter]
 priority_queue_free (struct priority_queue *head)
                                             ^~~~
../.././libgomp/priority_queue.h: In function ‘priority_list_insert’:
../.././libgomp/priority_queue.h:240:13: error: unused parameter ‘priority’
[-Werror=unused-parameter]
         int priority,
             ^~~~~~~~
In file included from ../.././libgomp/libgomp.h:124:0,
                 from ../.././libgomp/alloc.c:30:
../.././libgomp/config/linux/sem.h: In function ‘gomp_sem_destroy’:
../.././libgomp/config/linux/sem.h:52:31: error: unused parameter ‘sem’
[-Werror=unused-parameter]
 gomp_sem_destroy (gomp_sem_t *sem)
                               ^~~
In file included from ../.././libgomp/libgomp.h:125:0,
                 from ../.././libgomp/alloc.c:30:
../.././libgomp/config/linux/mutex.h: In function ‘gomp_mutex_destroy’:
../.././libgomp/config/linux/mutex.h:47:35: error: unused parameter ‘mutex’
[-Werror=unused-parameter]
 gomp_mutex_destroy (gomp_mutex_t *mutex)
                                   ^~~~~
In file included from ../.././libgomp/libgomp.h:126:0,
                 from ../.././libgomp/alloc.c:30:
../.././libgomp/config/linux/bar.h: In function ‘gomp_barrier_destroy’:
../.././libgomp/config/linux/bar.h:70:58: error: unused parameter ‘bar’
[-Werror=unused-parameter]
 static inline void gomp_barrier_destroy (gomp_barrier_t *bar)
                                                          ^~~
In file included from ../.././libgomp/libgomp.h:128:0,
                 from ../.././libgomp/alloc.c:30:
../.././libgomp/config/linux/ptrlock.h: In function ‘gomp_ptrlock_destroy’:
../.././libgomp/config/linux/ptrlock.h:72:58: error: unused parameter ‘ptrlock’
[-Werror=unused-parameter]
 static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock)
                                                          ^~~~~~~
In file included from ../.././libgomp/alloc.c:30:0:
../.././libgomp/libgomp.h: At top level:
../.././libgomp/libgomp.h:774:1: error: ‘inline’ is not at beginning of
declaration [-Werror=old-style-declaration]
 static void inline
 ^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [Makefile:659: alloc.lo] Error 1
make[5]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgomp'
make[4]: *** [Makefile:904: all-recursive] Error 1
make[4]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgomp'
make[3]: *** [Makefile:493: all] Error 2
make[3]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgomp'


and gcc 6.3.1 20170430, when compiled with 6.3.1 20170421, with the FLAGS above
and ./configure --enable-threads=posix --enable-nls --enable-interpreter
--with-system-zlib --enable-libgcj-multifile --enable-languages=all
--enable-targets=all --with-system-unwind --without-x
--with-linker-hash-style=gnu --disable-multilib --enable-shared

fails at stage1 with

make[3]: Leaving directory '/git/gcc/host-x86_64-pc-linux-gnu/libdecnumber'
make[3]: Entering directory '/git/gcc/host-x86_64-pc-linux-gnu/gcc'
make[3]: Leaving directory '/git/gcc/host-x86_64-pc-linux-gnu/gcc'
Checking multilib configuration for libgcc...
make[3]: Entering directory '/git/gcc/x86_64-pc-linux-gnu/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
# Early copyback; see "all" above for the rationale.  The
# early copy is necessary so that the gcc -B options find
# the right startup files when linking shared libgcc.
/bin/sh ../.././libgcc/../mkinstalldirs ../../host-x86_64-pc-linux-gnu/gcc
parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o crtprec32.o
crtprec64.o crtprec80.o crtfastmath.o";                                       
\
for file in $parts; do                                  \
  rm -f ../../host-x86_64-pc-linux-gnu/gcc/$file;               \
  /usr/local/bin/install -c -m 644 $file ../../host-x86_64-pc-linux-gnu/gcc/;  
\
  case $file in                                         \
    *.a)                                                \
      /usr/local/x86_64-pc-linux-gnu/bin/ranlib
../../host-x86_64-pc-linux-gnu/gcc/$file ;;     \
  esac;                                                 \
done
# @multilib_flags@ is still needed because this may use
# /git/gcc/host-x86_64-pc-linux-gnu/gcc/xgcc
-B/git/gcc/host-x86_64-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include    and -O2  -g -O2 -Wall -Wextra
-pipe -O3 -fno-fat-lto-objects -flto -DIN_GCC    -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic
-mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector  directly.
# @multilib_dir@ is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/sh ../.././libgcc/../mkinstalldirs .
/git/gcc/host-x86_64-pc-linux-gnu/gcc/xgcc
-B/git/gcc/host-x86_64-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include    -O2  -g -O2 -Wall -Wextra -pipe
-O3 -fno-fat-lto-objects -flto -DIN_GCC    -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic
-mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1
-Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -Wall -Wextra
-pipe -O3 -fno-fat-lto-objects -flto -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o
_ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o
_trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o
_subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o
_ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o
_ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o
_paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _mulsc3_s.o _muldc3_s.o
_mulxc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _bswapsi2_s.o _bswapdi2_s.o
_clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o
_fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o
_fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o
_floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o
_umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o
addtf3_s.o divtf3_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o
fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o
floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o
floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o
trunctfdf2_s.o trunctfxf2_s.o getf2_s.o letf2_s.o eqtf2_s.o _divtc3_s.o
_multc3_s.o _powitf2_s.o enable-execute-stack_s.o unwind-dw2_s.o
unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc &&
rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1
./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1
&& (echo "/* GNU ld script"; echo "   Use the shared library, but some
functions are only in"; echo "   the static library.  */"; echo "GROUP (
libgcc_s.so.1 -lgcc )" ) > ./libgcc_s.so
/usr/local/x86_64-pc-linux-gnu/bin/ld: error in
/tmp/ccSTKudI.ltrans0.ltrans.o(.eh_frame); no .eh_frame_hdr table will be
created.
dest=../../host-x86_64-pc-linux-gnu/gcc/include/tmp$$-unwind.h; \
cp unwind.h $dest; \
chmod a+r $dest; \
sh ../.././libgcc/../move-if-change $dest
../../host-x86_64-pc-linux-gnu/gcc/include/unwind.h
# Now that we have built all the objects, we need to copy
# them back to the GCC directory.  Too many things (other
# in-tree libraries, and DejaGNU) know about the layout
# of the build tree, for now.
make install-leaf DESTDIR=../../host-x86_64-pc-linux-gnu/gcc \
  slibdir= libsubdir= MULTIOSDIR=.
make[4]: Entering directory '/git/gcc/x86_64-pc-linux-gnu/libgcc'
/bin/sh ../.././libgcc/../mkinstalldirs ../../host-x86_64-pc-linux-gnu/gcc
/usr/local/bin/install -c -m 644 libgcc_eh.a
../../host-x86_64-pc-linux-gnu/gcc/
chmod 644 ../../host-x86_64-pc-linux-gnu/gcc/libgcc_eh.a
/usr/local/x86_64-pc-linux-gnu/bin/ranlib
../../host-x86_64-pc-linux-gnu/gcc/libgcc_eh.a
/usr/local/x86_64-pc-linux-gnu/bin/ranlib:
/git/gcc/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6: undefined
symbol: _ZNSi6ignoreEl

make[4]: *** [Makefile:1115: install-shared] Segmentation fault
make[4]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgcc'
make[3]: *** [Makefile:113: all] Error 2
make[3]: Leaving directory '/git/gcc/x86_64-pc-linux-gnu/libgcc'
make[2]: *** [Makefile:16705: all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/git/gcc'
make[1]: *** [Makefile:22998: stage1-bubble] Error 2
make[1]: Leaving directory '/git/gcc'
make: *** [Makefile:914: all] Error 2

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]