Bug 11748 - gold fails to link on solaris2.10
Summary: gold fails to link on solaris2.10
Status: RESOLVED DUPLICATE of bug 12525
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 05:21 UTC by Daniel Davies
Modified: 2011-07-09 00:16 UTC (History)
1 user (show)

See Also:
Host: i386-pc-solaris2.10
Target: i686-pc-solaris2.10
Build: i686-pc-solaris2.10
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Davies 2010-06-24 05:21:34 UTC
I built gcc-4.5.0 to use gold (FINALLY!!).  When I link my image processing
regression test, I get:

gcc -ansi -march=core2 -m32 -o ../apps/solaris2_x86/debug/ipstest ../testobj/sol
aris2_x86/debug/main.o ../testobj/solaris2_x86/debug/ipstest.o  ../testobj/solar
is2_x86/debug/s_absval.o ../testobj/solaris2_x86/debug/s_aie.o ../testobj/solari
s2_x86/debug/s_binrot.o ../testobj/solaris2_x86/debug/s_bswap.o  ../testobj/sola
ris2_x86/debug/s_ccs.o ../testobj/solaris2_x86/debug/s_cntbit.o ../testobj/solar
is2_x86/debug/s_color.o ../testobj/solaris2_x86/debug/s_cycsed.o ../testobj/sola
ris2_x86/debug/s_dither.o  ../testobj/solaris2_x86/debug/s_dtrans.o ../testobj/s
olaris2_x86/debug/s_expmsk.o ../testobj/solaris2_x86/debug/s_exprc.o ../testobj/
solaris2_x86/debug/s_fill.o ../testobj/solaris2_x86/debug/s_filter.o  ../testobj
/solaris2_x86/debug/s_frame.o ../testobj/solaris2_x86/debug/s_glyph.o ../testobj
/solaris2_x86/debug/s_gprop.o ../testobj/solaris2_x86/debug/s_grad.o ../testobj/
solaris2_x86/debug/s_grybin.o  ../testobj/solaris2_x86/debug/s_grycpy.o ../testo
bj/solaris2_x86/debug/s_grymph.o ../testobj/solaris2_x86/debug/s_gryprj.o ../tes
tobj/solaris2_x86/debug/s_gryrot.o  ../testobj/solaris2_x86/debug/s_gthrsh.o ../
testobj/solaris2_x86/debug/s_haus.o ../testobj/solaris2_x86/debug/s_histeq.o ../
testobj/solaris2_x86/debug/s_histo.o ../testobj/solaris2_x86/debug/s_rl4d.o ../t
estobj/solaris2_x86/debug/s_ibmmrd.o  ../testobj/solaris2_x86/debug/s_jpeg.o ../
testobj/solaris2_x86/debug/s_minmax.o ../testobj/solaris2_x86/debug/s_morph.o ..
/testobj/solaris2_x86/debug/s_othrot.o ../testobj/solaris2_x86/debug/s_rabb.o  .
./testobj/solaris2_x86/debug/s_rastln.o ../testobj/solaris2_x86/debug/s_rastop.o
 ../testobj/solaris2_x86/debug/s_recdil.o ../testobj/solaris2_x86/debug/s_red2d.
o ../testobj/solaris2_x86/debug/s_redexp.o  ../testobj/solaris2_x86/debug/s_redh
v.o ../testobj/solaris2_x86/debug/s_redio.o ../testobj/solaris2_x86/debug/s_redm
m.o ../testobj/solaris2_x86/debug/s_redrc.o ../testobj/solaris2_x86/debug/s_resc
al.o  ../testobj/solaris2_x86/debug/s_rnmrph.o ../testobj/solaris2_x86/debug/s_r
unflt.o ../testobj/solaris2_x86/debug/s_runprj.o ../testobj/solaris2_x86/debug/s
_scgry.o  ../testobj/solaris2_x86/debug/s_skew.o ../testobj/solaris2_x86/debug/s
_subsmp.o ../testobj/solaris2_x86/debug/s_symcmp.o ../testobj/solaris2_x86/debug
/s_tagrun.o ../testobj/solaris2_x86/debug/s_thresh.o  ../testobj/solaris2_x86/de
bug/s_tpdil.o ../testobj/solaris2_x86/debug/s_warp.o ../testobj/solaris2_x86/deb
ug/s_wave.o ../testobj/solaris2_x86/debug/s_xm2.o \
        ../testlib/solaris2_x86/debug/libtestw.a  ../../ipwrap/lib/solaris2_x86/
debug/libformw.a ../../ipwrap/lib/solaris2_x86/debug/libflogow.a ../../ipwrap/li
b/solaris2_x86/debug/libglyw.a ../../ipshared/lib/solaris2_x86/debug/libglyf.a .
./../ipwrap/lib/solaris2_x86/debug/libappsw.a ../../ipshared/lib/solaris2_x86/de
bug/libappf.a  ../../ipwrap/lib/solaris2_x86/debug/libadtw.a ../../ipwrap/lib/so
laris2_x86/debug/libskeww.a ../../ipshared/lib/solaris2_x86/debug/libskewf.a ../
../ipwrap/lib/solaris2_x86/debug/libpattw.a ../../ipshared/lib/solaris2_x86/debu
g/libpatts.a  ../../ipwrap/lib/solaris2_x86/debug/libiow.a ../../ipwrap/lib/sola
ris2_x86/debug/libtifw.a  ../../ipwrap/lib/solaris2_x86/debug/libcmprw.a ../../i
pshared/lib/solaris2_x86/debug/libcmprf.a ../../ipwrap/lib/solaris2_x86/debug/li
bwavew.a ../../ipshared/lib/solaris2_x86/debug/libwaves.a ../../ipwrap/lib/solar
is2_x86/debug/libhvqw.a ../../ipwrap/lib/solaris2_x86/debug/libjpegw.a ../../ips
hared/lib/solaris2_x86/debug/libjpegf.a  ../../ipwrap/lib/solaris2_x86/debug/lib
ccw.a ../../ipshared/lib/solaris2_x86/debug/libccf.a ../../ipwrap/lib/solaris2_x
86/debug/libipw.a ../../ipshared/lib/solaris2_x86/debug/libipf.a ../../ipshared/
lib/solaris2_x86/debug/libmorpf.a ../../ipwrap/lib/solaris2_x86/debug/libscalw.a
 ../../ipshared/lib/solaris2_x86/debug/libscalf.a  ../../ipwrap/lib/solaris2_x86
/debug/libpixrw.a ../../ipshared/lib/solaris2_x86/debug/libpixrf.a ../../ipwrap/
lib/solaris2_x86/debug/libutilw.a ../../ipshared/lib/solaris2_x86/debug/libutils
.a ../../ipwrap/lib/solaris2_x86/debug/libstrlw.a ../../ipshared/lib/solaris2_x8
6/debug/libfxpmf.a  ../../ipshared/lib/solaris2_x86/debug/librastf.a ../../ipsha
red/lib/solaris2_x86/debug/libheaps.a ../../ipshared/lib/solaris2_x86/debug/libc
achf.a  ../testlib/solaris2_x86/debug/libdocuw.a -lm
*** Error code 1
*** Error code 1
-rw-rw---- 1 ddavies adoc 612 Jun 23 22:00 tstmake.err
23 ddavies-metro:/adoc/ddavies/ipcore/ipwrap/testsrc:> cat tstmake.err
/tool/gcc/4.5.0/i386-pc-solaris2.10/lib/gcc/i686-pc-solaris2.10/4.5.0/../../../.
./i686-pc-solaris2.10/bin/ld: error: /usr/lib/libm.so: duplicate definition for 
version 0
/tool/gcc/4.5.0/i386-pc-solaris2.10/lib/gcc/i686-pc-solaris2.10/4.5.0/../../../.
./i686-pc-solaris2.10/bin/ld: fatal error: ../testobj/solaris2_x86/debug/ipstest
.o: readv failed: Invalid argument
collect2: ld returned 1 exit status
make: Fatal error: Command failed for target `../apps/solaris2_x86/debug/ipstest
'
Current working directory /adoc/ddavies/ipcore/ipwrap/testsrc
make: Fatal error: Command failed for target `gccdebugsolaris_x86'
24 ddavies-metro:/adoc/ddavies/ipcore/ipwrap/testsrc:> /tool/gcc/4.5.0/i386-pc-s
olaris2.10/lib/gcc/i686-pc-solaris2.10/4.5.0/../../../../i686-pc-solaris2.10/bin
/ld --version
GNU gold (GNU Binutils 2.20) 1.9
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

Apparently, gold doesn't like the version of libm.so found on Solaris.

This next one is probably gcc's bug, but gold and gcc don't seem to agree on the
flag used to invoke the Link time Optimization plugin that looks through
archives for GIMPLE bytecodes.

gcc -ansi -O3 -fno-strict-aliasing -funroll-loops -fwrapv -flto
-fuse-linker-plugin -march=core2 -m32 -o ../apps/solaris2_x86/nodebug/ipstest
../testobj/solaris2_x86/nodebug/main.o ../testobj/solaris2_x86/nodebug/ipstest.o
 ../testobj/solaris2_x86/nodebug/s_absval.o
../testobj/solaris2_x86/nodebug/s_aie.o
../testobj/solaris2_x86/nodebug/s_binrot.o
../testobj/solaris2_x86/nodebug/s_bswap.o 
../testobj/solaris2_x86/nodebug/s_ccs.o
../testobj/solaris2_x86/nodebug/s_cntbit.o
../testobj/solaris2_x86/nodebug/s_color.o
../testobj/solaris2_x86/nodebug/s_cycsed.o
../testobj/solaris2_x86/nodebug/s_dither.o 
../testobj/solaris2_x86/nodebug/s_dtrans.o
../testobj/solaris2_x86/nodebug/s_expmsk.o
../testobj/solaris2_x86/nodebug/s_exprc.o
../testobj/solaris2_x86/nodebug/s_fill.o
../testobj/solaris2_x86/nodebug/s_filter.o 
../testobj/solaris2_x86/nodebug/s_frame.o
../testobj/solaris2_x86/nodebug/s_glyph.o
../testobj/solaris2_x86/nodebug/s_gprop.o
../testobj/solaris2_x86/nodebug/s_grad.o
../testobj/solaris2_x86/nodebug/s_grybin.o 
../testobj/solaris2_x86/nodebug/s_grycpy.o
../testobj/solaris2_x86/nodebug/s_grymph.o
../testobj/solaris2_x86/nodebug/s_gryprj.o
../testobj/solaris2_x86/nodebug/s_gryrot.o 
../testobj/solaris2_x86/nodebug/s_gthrsh.o
../testobj/solaris2_x86/nodebug/s_haus.o
../testobj/solaris2_x86/nodebug/s_histeq.o
../testobj/solaris2_x86/nodebug/s_histo.o
../testobj/solaris2_x86/nodebug/s_rl4d.o
../testobj/solaris2_x86/nodebug/s_ibmmrd.o 
../testobj/solaris2_x86/nodebug/s_jpeg.o
../testobj/solaris2_x86/nodebug/s_minmax.o
../testobj/solaris2_x86/nodebug/s_morph.o
../testobj/solaris2_x86/nodebug/s_othrot.o
../testobj/solaris2_x86/nodebug/s_rabb.o 
../testobj/solaris2_x86/nodebug/s_rastln.o
../testobj/solaris2_x86/nodebug/s_rastop.o
../testobj/solaris2_x86/nodebug/s_recdil.o
../testobj/solaris2_x86/nodebug/s_red2d.o
../testobj/solaris2_x86/nodebug/s_redexp.o 
../testobj/solaris2_x86/nodebug/s_redhv.o
../testobj/solaris2_x86/nodebug/s_redio.o
../testobj/solaris2_x86/nodebug/s_redmm.o
../testobj/solaris2_x86/nodebug/s_redrc.o
../testobj/solaris2_x86/nodebug/s_rescal.o 
../testobj/solaris2_x86/nodebug/s_rnmrph.o
../testobj/solaris2_x86/nodebug/s_runflt.o
../testobj/solaris2_x86/nodebug/s_runprj.o
../testobj/solaris2_x86/nodebug/s_scgry.o 
../testobj/solaris2_x86/nodebug/s_skew.o
../testobj/solaris2_x86/nodebug/s_subsmp.o
../testobj/solaris2_x86/nodebug/s_symcmp.o
../testobj/solaris2_x86/nodebug/s_tagrun.o
../testobj/solaris2_x86/nodebug/s_thresh.o 
../testobj/solaris2_x86/nodebug/s_tpdil.o
../testobj/solaris2_x86/nodebug/s_warp.o
../testobj/solaris2_x86/nodebug/s_wave.o ../testobj/solaris2_x86/nodebug/s_xm2.o \
        ../testlib/solaris2_x86/nodebug/libtestw.a 
../../ipwrap/lib/solaris2_x86/nodebug/libformw.a
../../ipwrap/lib/solaris2_x86/nodebug/libflogow.a
../../ipwrap/lib/solaris2_x86/nodebug/libglyw.a
../../ipshared/lib/solaris2_x86/nodebug/libglyf.a
../../ipwrap/lib/solaris2_x86/nodebug/libappsw.a
../../ipshared/lib/solaris2_x86/nodebug/libappf.a 
../../ipwrap/lib/solaris2_x86/nodebug/libadtw.a
../../ipwrap/lib/solaris2_x86/nodebug/libskeww.a
../../ipshared/lib/solaris2_x86/nodebug/libskewf.a
../../ipwrap/lib/solaris2_x86/nodebug/libpattw.a
../../ipshared/lib/solaris2_x86/nodebug/libpatts.a 
../../ipwrap/lib/solaris2_x86/nodebug/libiow.a
../../ipwrap/lib/solaris2_x86/nodebug/libtifw.a 
../../ipwrap/lib/solaris2_x86/nodebug/libcmprw.a
../../ipshared/lib/solaris2_x86/nodebug/libcmprf.a
../../ipwrap/lib/solaris2_x86/nodebug/libwavew.a
../../ipshared/lib/solaris2_x86/nodebug/libwaves.a
../../ipwrap/lib/solaris2_x86/nodebug/libhvqw.a
../../ipwrap/lib/solaris2_x86/nodebug/libjpegw.a
../../ipshared/lib/solaris2_x86/nodebug/libjpegf.a 
../../ipwrap/lib/solaris2_x86/nodebug/libccw.a
../../ipshared/lib/solaris2_x86/nodebug/libccf.a
../../ipwrap/lib/solaris2_x86/nodebug/libipw.a
../../ipshared/lib/solaris2_x86/nodebug/libipf.a
../../ipshared/lib/solaris2_x86/nodebug/libmorpf.a
../../ipwrap/lib/solaris2_x86/nodebug/libscalw.a
../../ipshared/lib/solaris2_x86/nodebug/libscalf.a 
../../ipwrap/lib/solaris2_x86/nodebug/libpixrw.a
../../ipshared/lib/solaris2_x86/nodebug/libpixrf.a
../../ipwrap/lib/solaris2_x86/nodebug/libutilw.a
../../ipshared/lib/solaris2_x86/nodebug/libutils.a
../../ipwrap/lib/solaris2_x86/nodebug/libstrlw.a
../../ipshared/lib/solaris2_x86/nodebug/libfxpmf.a 
../../ipshared/lib/solaris2_x86/nodebug/librastf.a
../../ipshared/lib/solaris2_x86/nodebug/libheaps.a
../../ipshared/lib/solaris2_x86/nodebug/libcachf.a 
../testlib/solaris2_x86/nodebug/libdocuw.a -lm
*** Error code 1
*** Error code 1
-rw-rw---- 1 ddavies adoc 532 Jun 23  2010 tstmake.err
26 ddavies-metro:/adoc/ddavies/ipcore/ipwrap/testsrc:> cat tstmake.err
/tool/gcc/4.5.0/i386-pc-solaris2.10/lib/gcc/i686-pc-solaris2.10/4.5.0/../../../../i686-pc-solaris2.10/bin/ld:
-plugin: unknown option
/tool/gcc/4.5.0/i386-pc-solaris2.10/lib/gcc/i686-pc-solaris2.10/4.5.0/../../../../i686-pc-solaris2.10/bin/ld:
use the --help option for usage information
collect2: ld returned 1 exit status
make: Fatal error: Command failed for target `../apps/solaris2_x86/nodebug/ipstest'
Current working directory /adoc/ddavies/ipcore/ipwrap/testsrc
make: Fatal error: Command failed for target `gccsolaris_x86'

I'm attempting to follow the instructions on using -flto on
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Optimize-Options.html#Optimize-Options.
 Are they incorrect?
Comment 1 Ian Lance Taylor 2010-08-03 14:26:32 UTC
The issue with the -plugin option is simply that you need to use --enable-plugins 
when you configure gold.

I don't know what the duplicate definition of version 0 problem is.  I would need 
to be able to recreate the problem somehow, but I don't have access to a Solaris 
system.  If you can point me at files that I can use to recreate the problem, I 
will try to take a look.
Comment 2 Daniel Davies 2010-08-03 17:19:34 UTC
Thanks very much for your time.  I've gotten involved with other projects and
interest in using 4.5.x on Solaris has waned.  I'll wait until 4.5.x becomes
part of a standard Linux release and try again.
Comment 3 Ian Lance Taylor 2011-07-09 00:16:08 UTC
I believe that these problems have been fixed in the course of fixing PR 12525.

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