Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
Hi Tristan, Your recomendation did work thank you very much. Would it make sense maybe to check the output of GCC -v during build and adjust the options in GRT_ELF_OPTS depending on --enable-default-pie being present? Thanks again, Stelios ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 20/11/16 18:32, Stelios Loukadakis wrote: 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? Try to add -no-pie instead of -Wl,-no-pie 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 This is a little bit strange as /usr/lib/gcc/x86_64-linux-gnu/6 is in the search path. Apologies but I'm out of my depth on this. Any help much appreciated. Would it mean that libgrt needs to be a
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 16/11/16 09:31, Svenn Are Bjerkem wrote: On 15 November 2016 at 20:00, Tristan Gingold wrote: Which distribution are you using ? I am running Debian Sid, but mostly only do upgrade and not dist-upgrade to not break my system too often. Try to also add -Wl,-Wl,-v just after -v. I tried this, but I could not make any sense out of the extra logging. The output would have been useful however. What I do see is that it doesn't matter if I use 'CC=gcc-5 make' during build of ghdl, because ghdl picks up gcc (which is gcc-6) during elaboration of the vhdl project. I then switched to gcc-5 as command-line compiler by update-alternatives so that when I run 'gcc --version' on the command line I see that I get gcc-5. (5.4.1-3) Now ghdl will elaborate the project without any messages related to shared library. Maybe this is a problem with mixing gcc-5/gcc-6 for build/runtime. I don't know. Since I can switch to use gcc-5 at will for command line compiler, this is the workaround for me in the current situation. Maybe ghdl must eventually switch to use gcc-6 for build at some point? I suppose that gcc-6 is configured with --enable-default-pie, so you need to link with -Wl,-no-pie Tristan. ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 15 November 2016 at 20:00, Tristan Gingold wrote: > > Which distribution are you using ? I am running Debian Sid, but mostly only do upgrade and not dist-upgrade to not break my system too often. > > Try to also add -Wl,-Wl,-v just after -v. I tried this, but I could not make any sense out of the extra logging. What I do see is that it doesn't matter if I use 'CC=gcc-5 make' during build of ghdl, because ghdl picks up gcc (which is gcc-6) during elaboration of the vhdl project. I then switched to gcc-5 as command-line compiler by update-alternatives so that when I run 'gcc --version' on the command line I see that I get gcc-5. (5.4.1-3) Now ghdl will elaborate the project without any messages related to shared library. Maybe this is a problem with mixing gcc-5/gcc-6 for build/runtime. I don't know. Since I can switch to use gcc-5 at will for command line compiler, this is the workaround for me in the current situation. Maybe ghdl must eventually switch to use gcc-6 for build at some point? Thank you for your support. -- Svenn ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 15/11/16 08:09, Svenn Are Bjerkem wrote: On 14 November 2016 at 20:34, Tristan Gingold wrote: Try to add -v options: ghdl -m -v -v ... ghdl -m -v -v --ieee=synopsys mc8051_top_struc_cfg ... lots of lines indicating that /usr/local/bin/ghdl1-llvm is doing its job ... Looks ok. Which distribution are you using ? Try to also add -Wl,-Wl,-v just after -v. Tristan. ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 15/11/16 08:19, Svenn Are Bjerkem wrote: Just an observation. When building with make, I see that gcc-5 and gcc are used like this example: gcc-5 -c -I./src -I./src/vhdl -I./src/psl -I./src/vhdl/translate -I./src/ghdldrv -I./src/grt -I./src/ortho -I./src/ortho/llvm-nodebug -I./src/ghdldrv -gnaty3befhkmr -gnatwae -gnatf -gnat05 -g -gnata default_pathes.ads gnatbind-5 -aI./src -aI./src/vhdl -aI./src/psl -aI./src/vhdl/translate -aI./src/ghdldrv -aI./src/grt -aI./src/ortho -aI./src/ortho/llvm-nodebug -aI./src/ghdldrv -aO. -E -x ghdl_llvm.ali gnatlink-5 ghdl_llvm.ali -g gcc -c -g -o jumps.o src/grt/config/jumps.c gcc -c -g -o times.o src/grt/config/times.c gcc -c -g -o grt-cbinding.o src/grt/grt-cbinding.c gcc -c -g -o grt-cvpi.o src/grt/grt-cvpi.c gcc -c -g -o fstapi.o -I./src/grt/fst src/grt/fst/fstapi.c gcc -c -g -o lz4.o src/grt/fst/lz4.c gcc -c -g -o fastlz.o src/grt/fst/fastlz.c echo "with Grt.Backtraces.Jit;" > grt-backtraces-impl.ads echo "package Grt.Backtraces.Impl renames Grt.Backtraces.Jit;" >> grt-backtraces-impl.ads I don't know what it means that gcc-5 and gcc is used intermingled through the build process of ghdl. This is OK. One is used to compile C the other to compile Ada. You could use 'make CC=gcc-5' to always use gcc-5 Tristan. ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
Just an observation. When building with make, I see that gcc-5 and gcc are used like this example: gcc-5 -c -I./src -I./src/vhdl -I./src/psl -I./src/vhdl/translate -I./src/ghdldrv -I./src/grt -I./src/ortho -I./src/ortho/llvm-nodebug -I./src/ghdldrv -gnaty3befhkmr -gnatwae -gnatf -gnat05 -g -gnata default_pathes.ads gnatbind-5 -aI./src -aI./src/vhdl -aI./src/psl -aI./src/vhdl/translate -aI./src/ghdldrv -aI./src/grt -aI./src/ortho -aI./src/ortho/llvm-nodebug -aI./src/ghdldrv -aO. -E -x ghdl_llvm.ali gnatlink-5 ghdl_llvm.ali -g gcc -c -g -o jumps.o src/grt/config/jumps.c gcc -c -g -o times.o src/grt/config/times.c gcc -c -g -o grt-cbinding.o src/grt/grt-cbinding.c gcc -c -g -o grt-cvpi.o src/grt/grt-cvpi.c gcc -c -g -o fstapi.o -I./src/grt/fst src/grt/fst/fstapi.c gcc -c -g -o lz4.o src/grt/fst/lz4.c gcc -c -g -o fastlz.o src/grt/fst/fastlz.c echo "with Grt.Backtraces.Jit;" > grt-backtraces-impl.ads echo "package Grt.Backtraces.Impl renames Grt.Backtraces.Jit;" >> grt-backtraces-impl.ads I don't know what it means that gcc-5 and gcc is used intermingled through the build process of ghdl. -- Svenn ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 14 November 2016 at 20:34, Tristan Gingold wrote: > Try to add -v options: ghdl -m -v -v ... ghdl -m -v -v --ieee=synopsys mc8051_top_struc_cfg ... lots of lines indicating that /usr/local/bin/ghdl1-llvm is doing its job ... /usr/local/bin/ghdl1-llvm:note: List of units not used: /usr/bin/gcc -o mc8051_top_struc_cfg e~mc8051_top_struc_cfg.o /usr/local/lib/ghdl/v93/std/std_standard.o /usr/local/lib/ghdl/v93/synopsys/std_logic_1164.o /usr/local/lib/ghdl/v93/synopsys/std_logic_1164_body.o /usr/local/lib/ghdl/v93/synopsys/std_logic_arith.o mc8051_p.o mc8051_top_.o mc8051_core_.o mc8051_control_.o control_fsm_.o control_fsm_rtl.o control_fsm_rtl_cfg.o control_mem_.o control_mem_rtl.o control_mem_rtl_cfg.o mc8051_control_struc.o mc8051_control_struc_cfg.o mc8051_alu_.o alumux_.o alumux_rtl.o alumux_rtl_cfg.o alucore_.o alucore_rtl.o alucore_rtl_cfg.o addsub_core_.o addsub_ovcy_.o addsub_ovcy_rtl.o addsub_ovcy_rtl_cfg.o addsub_cy_.o addsub_cy_rtl.o addsub_cy_rtl_cfg.o addsub_core_struc.o addsub_core_struc_cfg.o comb_mltplr_.o comb_mltplr_rtl.o comb_mltplr_rtl_cfg.o comb_divider_.o comb_divider_rtl.o comb_divider_rtl_cfg.o dcml_adjust_.o dcml_adjust_rtl.o dcml_adjust_rtl_cfg.o mc8051_alu_struc.o mc8051_alu_struc_cfg.o mc8051_siu_.o mc8051_siu_rtl.o mc8051_siu_rtl_cfg.o mc8051_tmrctr_.o mc8051_tmrctr_rtl.o mc8051_tmrctr_rtl_cfg.o mc8051_core_struc.o mc8051_core_struc_cfg.o /usr/local/lib/ghdl/v93/std/textio.o /usr/local/lib/ghdl/v93/std/textio_body.o/usr/local/lib/ghdl/v93/synopsys/std_logic_textio.o mc8051_rom_.o mc8051_rom_sim.o mc8051_rom_sim_cfg.o mc8051_ram_.o mc8051_ram_sim.o mc8051_ram_sim_cfg.o mc8051_ramx_.o mc8051_ramx_sim.o mc8051_ramx_sim_cfg.o mc8051_top_struc.o mc8051_top_struc_cfg.o /usr/local/lib/ghdl/libgrt.a -ldl -lm -Wl,--version-script=/usr/local/lib/ghdl/grt.ver -Wl,--export-dynamic -L./ -lz /usr/bin/ld: e~mc8051_top_struc_cfg.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC ... lots of lines indicating that /usr/bin/ld has a problem, and want me to recompile with -fPIC ... $> gcc --version gcc (Debian 6.2.0-11) 6.2.0 20161103 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $> ld --version GNU ld (GNU Binutils for Debian) 2.27.51.20161108 Copyright (C) 2016 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. If I only knew what I should look for. I'll try to build a couple of older versions of ghdl from git and see what happens. -- Svenn ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
Re: [Ghdl-discuss] Something wrong with my build of ghdl, but I don't know what failed.
On 14/11/16 15:48, Svenn Are Bjerkem wrote: Hi, just pulled latest ghdl from github and rebuild the way I usually do: git pull make distclean ./configure --with-llvm-config make sudo make install First thing I notice is when building a project I have built before is: ghdl -m --ieee=synopsys mc8051_top_struc_cfg elaborate mc8051_top_struc_cfg /usr/bin/ld: e~mc8051_top_struc_cfg.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC ... one such error line for each file ... I guess I have done something wrong somewhere, but I don't quite grok what it is. Try to add -v options: ghdl -m -v -v ... I suppose something has changed with gcc or ld. Maybe an implicit -fpie Regards, Tristan. ___ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss