Discussion:
Add glibc aliases to some math function
Waldek Kozaczuk
2018-11-20 05:46:21 UTC
Permalink
One of the libraries used by ffmpeg uses following symbols which is missing
on OSv:

***@9c76f35feabb:/git-repos/osv# readelf -s
apps/ffmpeg/ROOTFS/usr/lib/libx265.so.160 | grep finite
4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND
***@GLIBC_2.15 (5)
22: 0000000000000000 0 FUNC GLOBAL DEFAULT UND
***@GLIBC_2.15 (5)
37: 0000000000000000 0 FUNC GLOBAL DEFAULT UND
***@GLIBC_2.15 (5)
40: 0000000000000000 0 FUNC GLOBAL DEFAULT UND
***@GLIBC_2.15 (5)
49: 0000000000000000 0 FUNC GLOBAL DEFAULT UND
***@GLIBC_2.15 (5)

Based on my research these seems to be aliases in glibc to pow, log10, etc
implementations. As I understand we need to add aliases (using weak_alias
macro) to OSv somehow. Given musl subrepo should not be modified we cannot
add it like this to musl source file like so:

diff --git a/src/math/pow.c b/src/math/pow.c
index f257814e..08c6fd22 100644
--- a/src/math/pow.c
+++ b/src/math/pow.c
@@ -314,3 +314,4 @@ double pow(double x, double y)
SET_HIGH_WORD(z, j);
return s*z;
}
+weak_alias(pow,__pow_finite);

I tried to create a corresponding pow.c file under libc, declare pow with
extern and define alias with weak_alias but the compiler complains. Is the
right way then to copy these files from musl dir to libc dir and add
week_alias statements there? Or is there a better way?

Waldek
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Waldek Kozaczuk
2018-11-21 13:14:04 UTC
Permalink
Or maybe use defsym in linker script ? I read that weak_alias needs to be in the same translation unit.
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...