libelektra: musl build fails with gcc 6(+?) on debian stretch

When I try to replicate the elektra-gcc-configure-debian-musl locally I get the following errors during build:

jenkins@5391be09a3a0:~/ws/build$ ../scripts/configure-debian-musl -DINSTALL_SYSTEM_FILES=OFF -DCMAKE_INSTALL_PREFIX=$WORKSPACE/local -DKDB_DB_SYSTEM=$WORKSPACE/system -DBUILD_DOCUMENTATION=OFF  ..
<snip>
jenkins@5391be09a3a0:~/ws/build$ make -j 10
<snip>
[ 10%] Linking C shared library ../../../lib/libelektra-core.so
/usr/bin/ld: CMakeFiles/elektra-core.dir/internal.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/keyhelpers.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/keyname.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/keyset.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/keytest.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/keyvalue.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/nolog.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/opmphm.c.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/owner.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: CMakeFiles/elektra-core.dir/__/loader/dl.c.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

Any idea why it works on the (old) build server but not for me?

logs

https://build.libelektra.org/jenkins/blue/organizations/jenkins/libelektra/detail/PR-2063/48/pipeline https://build.libelektra.org/jenkins/job/elektra-gcc-configure-debian-musl/lastSuccessfulBuild/consoleText

update

musl and gcc 6 is not the problem as it builds fine on alpine or via openwrt toolchain. Seems like debian gcc does something it should not.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

Resolved as we have a working musl build now.

@markus2330 I will probably add an alpine image and test it that way. I feel like it is the best option for the following reasons:

  • build whole system against musl (so we check musl compat)
  • use different shell (ash) so we test that as well
  • check all our definition scripts and fix stuff like #2075 in the process

Sounds good?