public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold
@ 2011-05-10 11:28 gmarkhor at gmail dot com
  2011-05-10 12:29 ` [Bug lto/48947] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-10 11:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

           Summary: 4.6.0 fails to link ffmpeg with LTO and gold
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gmarkhor@gmail.com


I am trying to make ffmpeg snapshot. I configure ffmpeg with the following
line:

../configure --enable-shared --cc='gcc -flto -fuse-linker-plugin -fPIC'
--prefix=/home/markhor/ffmpeg/install --arch=x86_64

It fails to build with
LD    libavcodec/libavcodec.so.53
ffmpeg/libavcodec/jpegls.h:46:0: warning: type of ‘ff_log2_run’ does not match
original declaration [enabled by default]
ffmpeg/libavcodec/jpegls.h:46:0: warning: type of ‘ff_log2_run’ does not match
original declaration [enabled by default]
ffmpeg/libavcodec/bitstream.c:35:15: note: previously declared here
x86_64-unknown-linux-gnu/bin/ld.gold: error: /tmp/ccla9ktI.ltrans3.ltrans.o:
requires dynamic reloc which may overflow at runtime; recompile with -fPIC
x86_64-unknown-linux-gnu/bin/ld.gold: error: /tmp/ccla9ktI.ltrans10.ltrans.o:
requires dynamic reloc which may overflow at runtime; recompile with -fPIC
x86_64-unknown-linux-gnu/bin/ld.gold: error: /tmp/ccla9ktI.ltrans16.ltrans.o:
requires dynamic reloc which may overflow at runtime; recompile with -fPIC
x86_64-unknown-linux-gnu/bin/ld.gold: error: /tmp/ccla9ktI.ltrans21.ltrans.o:
requires dynamic reloc which may overflow at runtime; recompile with -fPIC
collect2: ld returned 1 exit status


--cc='gcc -flto -fPIC' fails the same way. Snapshot is successfully built
without LTO with the BFD linker.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
@ 2011-05-10 12:29 ` rguenth at gcc dot gnu.org
  2011-05-11 12:13 ` gmarkhor at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-10 12:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.05.10 12:06:14
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-10 12:06:14 UTC ---
Please make sure the ffmpeg makefiles properly pass compiler options,
including -fPIC, to the gcc driver used at link time.  It looks like it
does not do so (especially using libtool or cmake may have issues here).


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
  2011-05-10 12:29 ` [Bug lto/48947] " rguenth at gcc dot gnu.org
@ 2011-05-11 12:13 ` gmarkhor at gmail dot com
  2011-05-11 12:27 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-11 12:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #2 from Vadim Markovtsev <gmarkhor at gmail dot com> 2011-05-11 11:43:03 UTC ---
I ensured that. ffmpeg does not use cmake, just ordinary GNU make; no libtool
is called at all down to the point where gcc fails (checked it with "make -n"
and "configure --cc='gcc -v ...'"). fPIC is passed correctly to each CC and LD
call, it is always in COLLECT_GCC_OPTIONS.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
  2011-05-10 12:29 ` [Bug lto/48947] " rguenth at gcc dot gnu.org
  2011-05-11 12:13 ` gmarkhor at gmail dot com
@ 2011-05-11 12:27 ` rguenth at gcc dot gnu.org
  2011-05-11 17:53 ` gmarkhor at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-11 12:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-11 12:02:53 UTC ---
Ok.  The error seems to be gold-specific though - what binutils version are
you using?  Does the error persist if you use GNU ld (you need at least
binutils 2.21 for that to support -fuse-linker-plugin)?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (2 preceding siblings ...)
  2011-05-11 12:27 ` rguenth at gcc dot gnu.org
@ 2011-05-11 17:53 ` gmarkhor at gmail dot com
  2011-05-12  9:28 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-11 17:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #4 from Vadim Markovtsev <gmarkhor at gmail dot com> 2011-05-11 17:29:32 UTC ---
I checked those errors with both binutils 2.21 release and 2.22 CVS (10th of
May).


gcc -###
Using built-in specs.
COLLECT_GCC=/???/x86_64-gcc-4.6.0/bin/gcc
COLLECT_LTO_WRAPPER=/???/x86_64-gcc-4.6.0/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/???/x86_64-gcc-4.6.0 --enable-shared
--with-arch=native --enable-languages=c,c++ --enable-lto --enable-plugin
--enable-gold --enable-linker-build-id --disable-multilib --enable-ld=default
--with-plugin-ld=ld.gold
Thread model: posix
gcc version 4.6.0 (GCC)

If you mean CC=gcc -flto -fuse-linker-plugin, I get the same errors.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (3 preceding siblings ...)
  2011-05-11 17:53 ` gmarkhor at gmail dot com
@ 2011-05-12  9:28 ` rguenth at gcc dot gnu.org
  2011-05-12 19:56 ` ian at airs dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-12  9:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iant at google dot com

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-12 08:51:25 UTC ---
(In reply to comment #4)
> I checked those errors with both binutils 2.21 release and 2.22 CVS (10th of
> May).
> 
> 
> gcc -###
> Using built-in specs.
> COLLECT_GCC=/???/x86_64-gcc-4.6.0/bin/gcc
> COLLECT_LTO_WRAPPER=/???/x86_64-gcc-4.6.0/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
> Target: x86_64-unknown-linux-gnu
> Configured with: ../configure --prefix=/???/x86_64-gcc-4.6.0 --enable-shared
> --with-arch=native --enable-languages=c,c++ --enable-lto --enable-plugin
> --enable-gold --enable-linker-build-id --disable-multilib --enable-ld=default
> --with-plugin-ld=ld.gold
> Thread model: posix
> gcc version 4.6.0 (GCC)
> 
> If you mean CC=gcc -flto -fuse-linker-plugin, I get the same errors.

With "using GNU ld" I mean configuring with --with-plugin-ld=ld.bfd
(or omitting that configure option).

I'm CCing a gold expert, maybe he can shed some light on that error.  I suppose
all object files _are_ built with -fPIC (eventually LTO takes some symbols
local by making them have hidden visibility - can that cause issues?).


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (4 preceding siblings ...)
  2011-05-12  9:28 ` rguenth at gcc dot gnu.org
@ 2011-05-12 19:56 ` ian at airs dot com
  2011-05-24 12:01 ` gmarkhor at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ian at airs dot com @ 2011-05-12 19:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com

--- Comment #6 from Ian Lance Taylor <ian at airs dot com> 2011-05-12 19:36:23 UTC ---
I believe that gold will issue these warnings in some cases that GNU ld will
not, but as far as I know gold will never issue them for code which was in fact
compiled with -fPIC.  Can you get a copy of a failing ltransNN.ltrans.o and
attach it here, or at least attach the output of readelf -r on the file?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (5 preceding siblings ...)
  2011-05-12 19:56 ` ian at airs dot com
@ 2011-05-24 12:01 ` gmarkhor at gmail dot com
  2011-05-24 12:02 ` gmarkhor at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-24 12:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #9 from Vadim Markovtsev <gmarkhor at gmail dot com> 2011-05-24 11:23:43 UTC ---
Here they are


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (6 preceding siblings ...)
  2011-05-24 12:01 ` gmarkhor at gmail dot com
@ 2011-05-24 12:02 ` gmarkhor at gmail dot com
  2011-05-24 12:12 ` gmarkhor at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-24 12:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #8 from Vadim Markovtsev <gmarkhor at gmail dot com> 2011-05-24 11:23:22 UTC ---
Created attachment 24339
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24339
Objects which cause the error (2)

Last 2 (of 4) binaries


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (7 preceding siblings ...)
  2011-05-24 12:02 ` gmarkhor at gmail dot com
@ 2011-05-24 12:12 ` gmarkhor at gmail dot com
  2012-07-14 20:45 ` leif.walsh at gmail dot com
  2014-09-06 10:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: gmarkhor at gmail dot com @ 2011-05-24 12:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

--- Comment #7 from Vadim Markovtsev <gmarkhor at gmail dot com> 2011-05-24 11:22:34 UTC ---
Created attachment 24338
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24338
Objects which cause the error

First 2 (of 4) binaries


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (8 preceding siblings ...)
  2011-05-24 12:12 ` gmarkhor at gmail dot com
@ 2012-07-14 20:45 ` leif.walsh at gmail dot com
  2014-09-06 10:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: leif.walsh at gmail dot com @ 2012-07-14 20:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48947

leif.walsh at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leif.walsh at gmail dot com

--- Comment #10 from leif.walsh at gmail dot com 2012-07-14 20:44:46 UTC ---
I have this error too, with 4.7.1 and ld.gold. I've confirmed that all my
objects are being compiled with fPIC, and even made it the first argument to
g++ (someone suggested that). It only seems to be an issue for c++ symbols. I
have a large codebase in c to which I'm trying to add a few c++11 features. The
linker only complains about c++ (templated) functions.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug lto/48947] 4.6.0 fails to link ffmpeg with LTO and gold
  2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
                   ` (9 preceding siblings ...)
  2012-07-14 20:45 ` leif.walsh at gmail dot com
@ 2014-09-06 10:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-06 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |trippels at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
dup.

*** This bug has been marked as a duplicate of bug 57703 ***


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-09-06 10:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10 11:28 [Bug lto/48947] New: 4.6.0 fails to link ffmpeg with LTO and gold gmarkhor at gmail dot com
2011-05-10 12:29 ` [Bug lto/48947] " rguenth at gcc dot gnu.org
2011-05-11 12:13 ` gmarkhor at gmail dot com
2011-05-11 12:27 ` rguenth at gcc dot gnu.org
2011-05-11 17:53 ` gmarkhor at gmail dot com
2011-05-12  9:28 ` rguenth at gcc dot gnu.org
2011-05-12 19:56 ` ian at airs dot com
2011-05-24 12:01 ` gmarkhor at gmail dot com
2011-05-24 12:02 ` gmarkhor at gmail dot com
2011-05-24 12:12 ` gmarkhor at gmail dot com
2012-07-14 20:45 ` leif.walsh at gmail dot com
2014-09-06 10:29 ` trippels at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).