Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error on Ubuntu 16.04 with conda-forge libraries (-fno-plt) #117

Open
pitrou opened this issue Jan 16, 2019 · 5 comments
Open

Linker error on Ubuntu 16.04 with conda-forge libraries (-fno-plt) #117

pitrou opened this issue Jan 16, 2019 · 5 comments

Comments

@pitrou
Copy link

pitrou commented Jan 16, 2019

On a Travis-CI Xenial VM, building Apache Arrow and linking it with some conda-forge libraries (here libprotobuf.a) produces a linker error at some point:

/usr/bin/ld: /home/travis/build/pitrou/arrow/cpp-toolchain/lib/libprotobuf.a(common.o): TLS transition from R_X86_64_TLSGD to R_X86_64_GOTTPOFF against `_ZSt15__once_callable' at 0x38e in section `.text' failed
/home/travis/build/pitrou/arrow/cpp-toolchain/lib/libprotobuf.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

(full log at https://travis-ci.org/pitrou/arrow/jobs/480342375#L1220)

This is related to the conda-forge toolchain migration (previously things would work fine on the even older Trusty VMs).

The error may be due to a new GNU ld feature that is not recognized by Xenial's GNU ld version. According to one of the binutils maintainers, not using -fno-plt when building libraries would solve the issue:
https://sourceware.org/ml/binutils/2019-01/msg00115.html
https://sourceware.org/ml/binutils/2019-01/msg00131.html

@wesm
Copy link

wesm commented Jan 16, 2019

Is this something that would have to be fixed in conda-forge's toolchain flags or somewhere else?

@pitrou
Copy link
Author

pitrou commented Jan 16, 2019

AFAICT it's the ctng-compilers-feedstock recipe in this repository.

@jjhelmus
Copy link
Contributor

-fno-plt is a security flag, this is not something that should be removed.

binutils and other toolchain related packages are created by the ctng-compilers-feedstock. The various compiler and linker flags are set in ctng-compilers-activation-feedstock.

@jjhelmus
Copy link
Contributor

A similar issue was found when using system compilers to build python extensions, conda/conda#6030. The solution was to use the system compilers but link with newer version of ld that was included with the Python package. I suspect that a similar solution would be possible here, Apache Arrow can be compiled with system provided compilers but linking will need to be done with a compatible linker.

@pitrou
Copy link
Author

pitrou commented Jan 16, 2019

It seems like using the conda-forge binutils package is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants