* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
@ 2014-11-09 4:21 ` hjl.tools at gmail dot com
2014-11-09 4:34 ` hjl.tools at gmail dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-09 4:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-11-09
Target Milestone|--- |5.0
Ever confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
r216964 disables bootstrap for libcc1 which exposed 2 things:
1. libcc1 isn't compiled with LTO even when GCC is configured with
"--with-build-config=bootstrap-lto". It may be intentional since
libcc1 is disabled for bootstrap.
2. -fPIC isn't used to created libcc1.so, which is OK, if
libcc1 is compiled with LTO which remembers PIC option.
libiberty is bootstrapped with LTO. When libcc1 isn't compiled with LTO,
we are creating libcc1.so without -fPIC, which leads to linker failure
when linking libiberty.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
2014-11-09 4:21 ` [Bug bootstrap/63784] " hjl.tools at gmail dot com
@ 2014-11-09 4:34 ` hjl.tools at gmail dot com
2014-11-09 5:09 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-09 4:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
We have a few choices:
1. Build libcc1 with LTO when GCC is configured with
"--with-build-config=bootstrap-lto". Or
2. Teach libtool to always add -fPIC when linking shared
object to support static archive compiled with LTO. Or
3. Don't compile libiberty with LTO.
I tbink #2 is a better choice since the same thing may happen elsewhere.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
2014-11-09 4:21 ` [Bug bootstrap/63784] " hjl.tools at gmail dot com
2014-11-09 4:34 ` hjl.tools at gmail dot com
@ 2014-11-09 5:09 ` hjl.tools at gmail dot com
2014-11-09 5:16 ` hjl.tools at gmail dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-09 5:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
This part:
@@ -4451,7 +4452,7 @@ _LT_EOF
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
@@ -5517,8 +5518,8 @@ if test "$_lt_caught_CXX_error" != yes; then
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects
$libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o
$lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
in
https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00991.html
may work here.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
` (2 preceding siblings ...)
2014-11-09 5:09 ` hjl.tools at gmail dot com
@ 2014-11-09 5:16 ` hjl.tools at gmail dot com
2014-11-09 16:47 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-09 5:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |markus at trippelsdorf dot net
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
This part:
@@ -4451,7 +4452,7 @@ _LT_EOF
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
@@ -5517,8 +5518,8 @@ if test "$_lt_caught_CXX_error" != yes; then
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects
$libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o
$lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
in
https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00991.html
may work here.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
` (3 preceding siblings ...)
2014-11-09 5:16 ` hjl.tools at gmail dot com
@ 2014-11-09 16:47 ` hjl.tools at gmail dot com
2014-11-10 19:39 ` hjl.tools at gmail dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-09 16:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
A patch is posted at
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00737.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
` (4 preceding siblings ...)
2014-11-09 16:47 ` hjl.tools at gmail dot com
@ 2014-11-10 19:39 ` hjl.tools at gmail dot com
2014-11-21 16:49 ` hjl at gcc dot gnu.org
2014-11-21 16:50 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-10 19:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 33931
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33931&action=edit
A testcase
[hjl@gnu-6 pr63784]$ make
./libtool --tag=CXX --mode=compile
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -g -O2 -c -o foo.lo
foo.cc
libtool: compile: /export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -g -O2
-c foo.cc -fPIC -DPIC -o .libs/foo.o
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/gcc -flto -fPIC -g -O2 -c -o
bar.o bar.c
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/gcc-ar rv libiberty.a bar.o
/usr/local/bin/ar: creating libiberty.a
a - bar.o
CXX=/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ \
./libtool --tag=CXX --mode=link
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -g -O2 -rpath
/export/home/hjl/bugs/gcc/pr63784 -o libcc1.la foo.lo libiberty.a
*** Warning: Linking the shared library libcc1.la against the
*** static library libiberty.a is not portable!
libtool: link: /export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -shared
-nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtbeginS.o .libs/foo.o libiberty.a
-L/usr/lib/gcc/x86_64-redhat-linux/4.8.3
-L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../.. -lstdc++
-lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crtn.o -Wl,-soname
-Wl,libcc1.so.0 -o .libs/libcc1.so.0.0.0
/usr/local/bin/ld: /tmp/ccEkQEhc.ltrans0.ltrans.o: relocation R_X86_64_32S
against `i' can not be used when making a shared object; recompile with -fPIC
/tmp/ccEkQEhc.ltrans0.ltrans.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libcc1.la] Error 1
[hjl@gnu-6 pr63784]$
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
` (5 preceding siblings ...)
2014-11-10 19:39 ` hjl.tools at gmail dot com
@ 2014-11-21 16:49 ` hjl at gcc dot gnu.org
2014-11-21 16:50 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: hjl at gcc dot gnu.org @ 2014-11-21 16:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
--- Comment #7 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Fri Nov 21 16:49:17 2014
New Revision: 217937
URL: https://gcc.gnu.org/viewcvs?rev=217937&root=gcc&view=rev
Log:
Always use PIC option with -shared in libtool
Libtool needs to pass PIC option -shared when creating shared object to
link regular object files with slim-lto archive.
PR bootstrap/63784
* libtool.m4: Add $pic_flag with -shared.
boehm-gc/
PR bootstrap/63784
* configure: Regenerated.
gcc/
PR bootstrap/63784
* configure: Regenerated.
libatomic/
PR bootstrap/63784
* configure: Regenerated.
libbacktrace/
PR bootstrap/63784
* configure: Regenerated.
libcc1/
PR bootstrap/63784
* configure: Regenerated.
libcilkrts/
PR bootstrap/63784
* configure: Regenerated.
libffi/
PR bootstrap/63784
* configure: Regenerated.
libgfortran/
PR bootstrap/63784
* configure: Regenerated.
libgomp/
PR bootstrap/63784
* configure: Regenerated.
libitm/
PR bootstrap/63784
* configure: Regenerated.
libjava/
PR bootstrap/63784
* configure: Regenerated.
libjava/classpath/
PR bootstrap/63784
* configure: Regenerated.
libobjc/
PR bootstrap/63784
* configure: Regenerated.
libquadmath/
PR bootstrap/63784
* configure: Regenerated.
libsanitizer/
PR bootstrap/63784
* configure: Regenerated.
libssp/
PR bootstrap/63784
* configure: Regenerated.
libstdc++-v3/
PR bootstrap/63784
* configure: Regenerated.
libvtv/
PR bootstrap/63784
* configure: Regenerated.
lto-plugin/
PR bootstrap/63784
* configure: Regenerated.
Modified:
trunk/ChangeLog
trunk/boehm-gc/ChangeLog
trunk/boehm-gc/configure
trunk/gcc/ChangeLog
trunk/gcc/configure
trunk/libatomic/ChangeLog
trunk/libatomic/configure
trunk/libbacktrace/ChangeLog
trunk/libbacktrace/configure
trunk/libcc1/ChangeLog
trunk/libcc1/configure
trunk/libcilkrts/ChangeLog
trunk/libcilkrts/configure
trunk/libffi/ChangeLog
trunk/libffi/configure
trunk/libgfortran/ChangeLog
trunk/libgfortran/configure
trunk/libgomp/ChangeLog
trunk/libgomp/configure
trunk/libitm/ChangeLog
trunk/libitm/configure
trunk/libjava/ChangeLog
trunk/libjava/classpath/ChangeLog
trunk/libjava/classpath/configure
trunk/libjava/configure
trunk/libobjc/ChangeLog
trunk/libobjc/configure
trunk/libquadmath/ChangeLog
trunk/libquadmath/configure
trunk/libsanitizer/ChangeLog
trunk/libsanitizer/configure
trunk/libssp/ChangeLog
trunk/libssp/configure
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/configure
trunk/libtool.m4
trunk/libvtv/ChangeLog
trunk/libvtv/configure
trunk/lto-plugin/ChangeLog
trunk/lto-plugin/configure
trunk/zlib/configure
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63784] [5 Regression] profiledbootstrap failure with bootstrap-lto
2014-11-08 21:33 [Bug bootstrap/63784] New: [5 Regression] profiledbootstrap failure with bootstrap-lto hjl.tools at gmail dot com
` (6 preceding siblings ...)
2014-11-21 16:49 ` hjl at gcc dot gnu.org
@ 2014-11-21 16:50 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-21 16:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread