[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/22656] Gold linker oftens fails with Solaris 10 system librari
From: |
binutils at marino dot st |
Subject: |
[Bug gold/22656] Gold linker oftens fails with Solaris 10 system libraries |
Date: |
Mon, 01 Jan 2018 23:01:17 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22656
--- Comment #2 from John Marino <binutils at marino dot st> ---
I had a small mistake recreating a test case. After I fixed the error, it's
easy to reproduce this.
Makefile:
CC=/raven/share/raven/toolchain/gcc7/bin/cc
all: test
test:
${CC} --verbose -fuse-ld=gold \
test.c -o ${.TARGET} \
-Wl,-rpath,/lib/amd64 -lsocket
clean:
rm test
test.c file:
#include <stdio.h>
#include <sys/socket.h>
int main (int argc, char *argv[])
{
int socket_desc;
socket_desc = socket(AF_INET, SOCK_STREAM, 0);
if (socket_desc == -1)
{
printf ("could not create socket");
}
else
{
printf ("success: %d\n", socket_desc);
}
return 0;
}
output:
/raven/share/raven/toolchain/gcc7/bin/cc --verbose -fuse-ld=gold test.c -o
test -Wl,-rpath,/lib/amd64 -lsocket
Using built-in specs.
COLLECT_GCC=/raven/share/raven/toolchain/gcc7/bin/cc
COLLECT_LTO_WRAPPER=/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/lto-wrapper
Target: x86_64-raven-solaris2.10
Configured with: /construction/gcc7/gcc-7.2.0/configure
--enable-languages=c,c++,ada,fortran --with-local-prefix=/raven
--with-system-zlib --with-gmp=/raven --with-mpc=/raven --with-mpfr=/raven
--with-libiconv-prefix=/raven --enable-shared --enable-threads=posix
--enable-checking=release --enable-libquadmath --disable-nls --disable-multilib
--disable-libsanitizer --disable-libvtv --disable-libmpx --disable-libcilkrts
--with-ld=/raven/toolchain/bin/ld --with-as=/raven/toolchain/bin/as
--with-pkgversion=Ravenports --disable-bootstrap --prefix=/raven/toolchain/gcc7
--localstatedir=/var --mandir=/raven/toolchain/gcc7/share/man
--infodir=/raven/toolchain/gcc7/share/info/. --build=x86_64-raven-solaris2.10
Thread model: posix
gcc version 7.2.0 (Ravenports)
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' 'test' '-mtune=generic'
'-march=x86-64'
/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/cc1
-quiet -v -iprefix
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/
test.c -quiet -dumpbase test.c -mtune=generic -march=x86-64 -auxbase test
-version -fuse-ld=gold -o /var/tmp//ccTW9Wdd.s
GNU C11 (Ravenports) version 7.2.0 (x86_64-raven-solaris2.10)
compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.6,
MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../../../x86_64-raven-solaris2.10/include"
ignoring duplicate directory
"/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/../../lib/gcc/x86_64-raven-solaris2.10/7.2.0/include"
ignoring duplicate directory
"/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/../../lib/gcc/x86_64-raven-solaris2.10/7.2.0/include-fixed"
ignoring nonexistent directory
"/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/../../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../../../x86_64-raven-solaris2.10/include"
#include "..." search starts here:
#include <...> search starts here:
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/include
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/include-fixed
/raven/include
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/../../include
/usr/include
End of search list.
GNU C11 (Ravenports) version 7.2.0 (x86_64-raven-solaris2.10)
compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.6,
MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: cd4d8ac904084da056c72dd4a85e0eb9
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' 'test' '-mtune=generic'
'-march=x86-64'
/raven/toolchain/bin/as -v -V -Qy -s --64 -o /var/tmp//ccabLqLm.o
/var/tmp//ccTW9Wdd.s
GNU assembler version 2.29.1 (x86_64-raven-solaris2.10) using BFD version (GNU
Binutils) 2.29.1
COMPILER_PATH=/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/:/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/:/usr/ccs/bin/
LIBRARY_PATH=/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/:/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/:/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../../amd64/:/lib/amd64/:/usr/lib/amd64/:/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' 'test' '-mtune=generic'
'-march=x86-64'
/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/collect2
-plugin
/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/liblto_plugin.so
-plugin-opt=/raven/share/raven/toolchain/gcc7/bin/../libexec/gcc/x86_64-raven-solaris2.10/7.2.0/lto-wrapper
-plugin-opt=-fresolution=/var/tmp//ccdyYPQw.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -V
--enable-new-dtags -rpath /raven/toolchain/gcc7/lib/amd64 -m elf_x86_64 -Y
P,/lib/amd64:/usr/lib/amd64 -Qy -fuse-ld=gold -o test /usr/lib/amd64/crt1.o
/usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/crtbegin.o
-L/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0
-L/raven/share/raven/toolchain/gcc7/bin/../lib/gcc
-L/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../../amd64
-L/lib/amd64 -L/usr/lib/amd64
-L/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/../../..
/var/tmp//ccabLqLm.o -rpath /lib/amd64 -lsocket -lgcc -lgcc_eh -lc -lgcc
-lgcc_eh
/raven/share/raven/toolchain/gcc7/bin/../lib/gcc/x86_64-raven-solaris2.10/7.2.0/crtend.o
/usr/lib/amd64/crtn.o
GNU gold (GNU Binutils 2.29.1) 1.14
Supported targets:
elf64-s390
elf32-s390
elf64-littleaarch64
elf64-bigaarch64
elf32-littleaarch64
elf32-bigaarch64
elf64-tradlittlemips
elf32-tradlittlemips-nacl
elf64-tradbigmips
elf32-tradlittlemips-nacl
elf32-tradlittlemips
elf32-tradlittlemips-nacl
elf32-tradbigmips
elf32-tradlittlemips-nacl
elf32-tilegx-be
elf64-tilegx-be
elf32-tilegx-le
elf64-tilegx-le
elf32-bigarm
elf32-bigarm-nacl
elf32-littlearm
elf32-littlearm-nacl
elf64-powerpcle
elf64-powerpc
elf32-powerpcle
elf32-powerpc
elf64-sparc
elf32-sparc
elf32-x86-64
elf32-x86-64-freebsd
elf32-x86-64-nacl
elf64-x86-64
elf64-x86-64-freebsd
elf64-x86-64-nacl
elf32-iamcu
elf32-i386
elf32-i386-freebsd
elf32-i386-nacl
Supported emulations:
elf64_s390
elf32_s390
aarch64_elf64_le_vec
aarch64_elf64_be_vec
aarch64_elf32_le_vec
aarch64_elf32_be_vec
elf64ltsmip
elf32-tradlittlemips-nacl
elf64btsmip
elf32-tradlittlemips-nacl
elf32ltsmip
elf32-tradlittlemips-nacl
elf32btsmip
elf32-tradlittlemips-nacl
elf32tilegx_be
elf64tilegx_be
elf32tilegx
elf64tilegx
armelfb
armelfb_nacl
armelf
armelf_nacl
elf64lppc
elf64ppc
elf32lppc
elf32ppc
elf64_sparc
elf32_sparc
elf32_x86_64
elf32_x86_64_nacl
elf_x86_64
elf_x86_64_nacl
elf_iamcu
elf_i386
elf_i386_nacl
/raven/toolchain/bin/ld.gold: error: /lib/amd64/libsocket.so: duplicate
definition for version 0
/raven/toolchain/bin/ld.gold: error: /lib/amd64/libsocket.so: duplicate
definition for version 0
/raven/toolchain/bin/ld.gold: error: /lib/amd64/libsocket.so: duplicate
definition for version 0
collect2: error: ld returned 1 exit status
*** Error code 1
Stop.
make: stopped in /export/home/workzone/socket-test
--
You are receiving this mail because:
You are on the CC list for the bug.