Bug#919573: sagemath ftbfs with ld --as-needed as the default

Tobias Hansen thansen at debian.org
Sun Feb 3 12:55:11 GMT 2019


Control: tags -1 + moreinfo

On 1/17/19 12:46 PM, Matthias Klose wrote:
> Package: src:sagemath
> Version: 8.6-2
> Severity: important
> Tags: sid buster
>
> sagemath ftbfs with ld --as-needed as the default
>
> the build log shows in various locations:
>
> [...]
> [sagelib-8.6] g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv
> -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-bqwtKO/python2.7-2.7.15=.
> -fstack-protector-strong -Wformat -Werror=format-security
> -L/<<PKGBUILDDIR>>/debian/build/usr/lib -Wl,-rpath,/usr/lib/x86_64-linux-gnu/gap
> -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
> build/temp.linux-x86_64-2.7/build/cythonized/sage/matrix/matrix_modn_sparse.o
> -L/<<PKGBUILDDIR>>/debian/build/usr/lib -L/usr/lib/x86_64-linux-gnu/gap
> -llinbox-1.5.2 -llinboxsage-1.5.2 -lntl -liml -lblas -llapack -lgivaro -lflint
> -lmpfr -lgmp -lgmpxx -lstdc++ -o
> build/lib.linux-x86_64-2.7/sage/matrix/matrix_modn_sparse.so -lpari
> [...]
>
> the object file appears *after* the libraries on the command line, so nothing is
> linked.  I didn't grok sage/setup.py where exactly that occurs, but you always
> should place the libraries after the object files on the command line.
>
> You can test that by setting
>
> export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
>
> Please forward that upstream.
>
In your example the libraries do come after the object file (matrix_modn_sparse.o) and I can build sage with --as-needed just fine. Could it be that the only issue here is the missing -fopenmp?

Best,

Tobias



More information about the debian-science-maintainers mailing list