Skip to content

Fix underlinking#99

Closed
ginggs wants to merge 1 commit intoJuliaMath:masterfrom
ginggs:fix-underlinking
Closed

Fix underlinking#99
ginggs wants to merge 1 commit intoJuliaMath:masterfrom
ginggs:fix-underlinking

Conversation

@ginggs
Copy link
Copy Markdown
Contributor

@ginggs ginggs commented Oct 26, 2015

libopenlibm should be linked to libm to resolve the symbols logl, exp and powl

libopenlibm should be linked to libm to resolve the symbols logl, exp and powl
@ginggs
Copy link
Copy Markdown
Contributor Author

ginggs commented Oct 26, 2015

The following warnings in amd64 and i386 builds were fixed by explicitly linking libm:

dpkg-shlibdeps: warning: symbol logl used by debian/libopenlibm1/usr/lib/i386-linux-gnu/libopenlibm.so.1.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol expl used by debian/libopenlibm1/usr/lib/i386-linux-gnu/libopenlibm.so.1.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol powl used by debian/libopenlibm1/usr/lib/i386-linux-gnu/libopenlibm.so.1.0 found in none of the libraries

See: https://buildd.debian.org/status/fetch.php?pkg=openlibm&arch=i386&ver=0.4.1%2bdfsg-1&stamp=1430399652

@ginggs
Copy link
Copy Markdown
Contributor Author

ginggs commented Oct 26, 2015

I don't know if this is needed for WINNT as well.

@ginggs
Copy link
Copy Markdown
Contributor Author

ginggs commented Oct 26, 2015

What is worrying is that __fpgetprec is still unresolved on i386:

dpkg-shlibdeps: warning: symbol __fpgetprec used by debian/libopenlibm1/usr/lib/i386-linux-gnu/libopenlibm.so.1.0 found in none of the libraries

According to amd64/bsd_ieeefp.h (included from 387/bsd_ieeefp.h) this is an inline function:
static inline fp_prec_t __fpgetprec(void)

This might have something to do with #55.

@ViralBShah
Copy link
Copy Markdown
Member

I would really prefer not linking to libm, and instead getting those functions compiling in openlibm. Even though more work, it is worth getting it right.

@ginggs
Copy link
Copy Markdown
Contributor Author

ginggs commented Oct 28, 2015

I've created PR #103 to fix the unresolved symbol __fpgetprec on i386.

@ViralBShah
Copy link
Copy Markdown
Member

So what should we do here for now? Is there risk that libm versions will get called instead of openlibm?

@petercolberg petercolberg mentioned this pull request Nov 12, 2015
@petercolberg
Copy link
Copy Markdown
Contributor

For further context, please also see this discussion on the Debian Julia list.

@petercolberg
Copy link
Copy Markdown
Contributor

I am glad to note that this issue has already been solved in HEAD.

The underlinking issue applies only to version 0.4.1, which does not yet contain definitions of expl, logl, and powl; hence the following error when linking the tests against the shared library:

make[2]: Entering directory '/build/openlibm-0.4.1+dfsg/test'
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -g test-double.c 
../libopenlibm.so: undefined reference to `powl'
../libopenlibm.so: undefined reference to `logl'
../libopenlibm.so: undefined reference to `expl'

@ViralBShah
Copy link
Copy Markdown
Member

Can we close this PR?

@ginggs ginggs closed this Nov 16, 2015
@ginggs ginggs deleted the fix-underlinking branch June 18, 2018 21:54
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

Successfully merging this pull request may close these issues.

3 participants