diegoferigo / development-iit

Docker-based isolated development environment for my activities @ Italian Institute of Technology
https://github.com/diegoferigo/devenv
7 stars 4 forks source link

ign-launch in conda image fails compiling with binutils >= 2.36 #9

Open diegoferigo opened 3 years ago

diegoferigo commented 3 years ago

As workaround, pinning a previous version solves the problem:

RUN echo 'binutils < 2.36' >> $CONDA_PREFIX/conda-meta/pinned
root@9d42f6e35016:/usr/local/src/workspace/build/ignition-launch4# ninja
[1/8] Linking CXX shared library lib/libignition-launch4.so.4.0.0
FAILED: lib/libignition-launch4.so.4.0.0 
: && /conda/bin/x86_64-conda-linux-gnu-c++ -fPIC -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /conda/include -O3 -DNDEBUG  -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic  -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/conda/lib -Wl,-rpath-link,/conda/lib -L/conda/lib -shared -Wl,-soname,libignition-launch4.so.4 -o lib/libignition-launch4.so.4.0.0 src/CMakeFiles/ignition-launch4.dir/ign.cc.o src/CMakeFiles/ignition-launch4.dir/Manager.cc.o  -Wl,-rpath,/usr/local/src/workspace/install/lib:  /conda/lib/libtinyxml2.a  /usr/local/src/workspace/install/lib/libignition-common4.so.4.1.0  /usr/local/src/workspace/install/lib/libignition-math6.so.6.8.0  /conda/lib/libbfd.a  /conda/x86_64-conda-linux-gnu/sysroot/usr/lib/libdl.so  -liberty  -lz  /usr/local/src/workspace/install/lib/libignition-plugin1-loader.so.1.2.0  /usr/local/src/workspace/install/lib/libignition-plugin1.so.1.2.0  /conda/lib/libtinyxml2.a  /conda/lib/libuuid.so  /conda/lib/libuuid.so  -lpthread && :
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(format.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(hash.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(libbfd.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(opncls.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(section.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(targets.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(binary.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(ihex.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(srec.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(tekhex.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(verilog.o): relocation R_X86_64_32S against symbol `bfd_default_arch_struct' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf64-x86-64.o): relocation R_X86_64_32S against symbol `_bfd_elf_large_com_section' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elfxx-x86.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-ifunc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-vxworks.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf64.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf.o): relocation R_X86_64_32S against symbol `_bfd_std_section' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elflink.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-attrs.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-strtab.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-eh-frame.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(dwarf1.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(dwarf2.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf32-i386.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf32.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(pei-i386.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(peigen.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(cofflink.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(coffgen.o): relocation R_X86_64_32 against symbol `_bfd_std_section' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(pe-x86_64.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(pex64igen.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(pei-x86_64.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf64-gen.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf32-gen.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(plugin.o): relocation R_X86_64_32S against symbol `plugin_vec' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(archive.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(archures.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(bfd.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(bfdio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(cache.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(elf-properties.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(linker.o): relocation R_X86_64_32S against symbol `_bfd_std_section' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(merge.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(reloc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(simple.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(stabs.o): relocation R_X86_64_32S against symbol `_bfd_std_section' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(syms.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(cpu-i386.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(archive64.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /conda/lib/libbfd.a(cpu-iamcu.o): warning: relocation in read-only section `.rodata'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
traversaro commented 3 years ago

Are you sure you are not accidentally installing the defaults version? See https://github.com/robotology/robotology-superbuild/issues/669 and the issue linked there.

diegoferigo commented 3 years ago

I no longer have the docker image with the recent binutils (and I don't want to build it again just to check) but I still have the output of the downgrade:

Screenshot_20210730_123436

Searching the binutils versions I get:

# Name                       Version           Build  Channel             
binutils                       1.0.0               0  conda-forge         
binutils                       1.0.1               0  conda-forge         
binutils                       1.0.1               1  conda-forge         
binutils                        2.26               0  conda-forge         
binutils                        2.27               0  conda-forge         
binutils                        2.28               0  conda-forge         
binutils                        2.30               0  conda-forge         
binutils                        2.31               0  conda-forge         
binutils                        2.32      h53a641e_4  conda-forge         
binutils                        2.32      h53a641e_5  conda-forge         
binutils                        2.32      h53a641e_6  conda-forge         
binutils                        2.32      he1b5a44_3  conda-forge         
binutils                        2.32      hf484d3e_0  conda-forge         
binutils                        2.32      hf484d3e_2  conda-forge         
binutils                      2.33.1      h53a641e_5  conda-forge         
binutils                      2.33.1      h53a641e_6  conda-forge         
binutils                      2.33.1      h53a641e_7  conda-forge         
binutils                      2.33.1      h53a641e_7  pkgs/main           
binutils                      2.33.1      h53a641e_8  conda-forge         
binutils                        2.34      h2122c62_8  conda-forge         
binutils                        2.34      h2122c62_9  conda-forge         
binutils                        2.34      h53a641e_0  conda-forge         
binutils                        2.34      h53a641e_5  conda-forge         
binutils                        2.34      h53a641e_6  conda-forge         
binutils                        2.34      h53a641e_7  conda-forge         
binutils                        2.34      h53a641e_8  conda-forge         
binutils                        2.35      h2122c62_9  conda-forge         
binutils                      2.35.1      h9e65a1e_9  pkgs/main           
binutils                      2.35.1      hdd6e379_0  conda-forge         
binutils                      2.35.1      hdd6e379_1  conda-forge         
binutils                      2.35.1      hdd6e379_2  conda-forge         
binutils                      2.36.1      hdd6e379_0  conda-forge         
binutils                      2.36.1      hdd6e379_1  conda-forge         
binutils                      2.36.1      hdd6e379_2  conda-forge 

It seems coming from conda-forge. The default channel does not seem having yet 2.36.*. Good point anyway @traversaro, thanks!