Hello,
I also seem to have exactly the same issue but I'm totally confused on how
to solve it.I'm using debian testing with GGC 6.2 and GNAT 6.2 and llvm 3.5
for building the latest version of ghdl source.
This is the output from GCC -v
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.2.0-13'
--with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin
--enable-default-pie --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20161109 (Debian 6.2.0-13)
Running the simple adder example provided in the documentation area I get
the relocation R_X86_64_32 error. I've added the extra option suggested by
Tristan on the grt.lst file
@/libgrt.a
-ldl
-lm
-Wl,--version-script=@/grt.ver
-Wl,--export-dynamic
-Wl,-no-pie
-L./
-lz
Is this the right place or have I misunderstood?
ghdl -m -v -Wl,-Wl,-v adder
link due to no binary file
/usr/bin/ghdl1-llvm -P/usr/lib/ghdl/v93/std/ -P/usr/lib/ghdl/v93/ieee/
--elab adder -l e~adder.lst -c -o e~adder.o e~adder
/usr/bin/gcc -o adder e~adder.o /usr/lib/ghdl/v93/std/std_standard.o
adder.o -Wl,-v /usr/lib/ghdl/libgrt.a -ldl -lm
-Wl,--version-script=/usr/lib/ghdl/grt.ver -Wl,--export-dynamic -Wl,-no-pie
-L./ -lz
collect2 version 6.2.0 20161109
/usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
-plugin-opt=-fresolution=/tmp/cc3s3lhA.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o adder
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o -L./
-L/usr/lib/gcc/x86_64-linux-gnu/6
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. e~adder.o
/usr/lib/ghdl/v93/std/std_standard.o adder.o -v /usr/lib/ghdl/libgrt.a -ldl
-lm --version-script=/usr/lib/ghdl/grt.ver --export-dynamic -no-pie -lz
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
GNU ld (GNU Binutils for Debian) 2.27.51.20161108
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
ghdl: compilation error
When I search for the gcc_s library I get the following
locate gcc_s
/lib/x86_64-linux-gnu/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s_32.so
/usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s_x32.so
/usr/lib/gcc/x86_64-linux-gnu/5/32/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/5/x32/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s_32.so
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s_x32.so
/usr/lib/gcc/x86_64-linux-gnu/6/32/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/6/32/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/6/x32/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/6/x32/libgcc_s.so.1
/usr/lib32/libgcc_s.so.1
/usr/libx32/libgcc_s.so.1
Apologies but I'm out of my depth on this. Any help much appreciated. Would
it mean that libgrt needs to be a shared library build with -fPIC or the
ada equivalent?
Because this is the first time I post in this list and I'm not very
familiar, is there an easy way to search past entries on this list?
Thank you,
Stelios