Skip to content

Commit 73da410

Browse files
committed
Fixed prebuilt binary compatibility with musl and ARM64 systems
fixes #1578 (comment) - up until recently, we've never provided musl and arm64 prebuilt binaries to users - to maintain compatibility with older glibc versions, we have a symbol override that gets included at compile time - this didn't take into account ARM64 systems, which ship with a later glibc version which first supported arm64: https://www.phoronix.com/scan.php?page=news_item&px=MTI2MTc - it also didn't take into account musl systems, which don't use glibc and therefore should be ignored
1 parent 241d710 commit 73da410

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/gcc-preinclude.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11

22
// http://web.archive.org/web/20140401031018/http://rjpower9000.wordpress.com:80/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/
33

4-
#if defined(__linux__) && defined(__x86_64__)
4+
#define _GNU_SOURCE
5+
#include <features.h>
6+
#undef _GNU_SOURCE
7+
8+
#if defined(__linux__) && defined(__USE_GNU)
9+
10+
#if defined(__x86_64__)
511
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
12+
__asm__(".symver exp,exp@GLIBC_2.2.5");
13+
__asm__(".symver log,log@GLIBC_2.2.5");
14+
__asm__(".symver pow,pow@GLIBC_2.2.5");
15+
__asm__(".symver fcntl64,fcntl@GLIBC_2.2.5");
16+
#endif
17+
18+
#if defined(__aarch64__) || defined(_M_ARM64)
19+
__asm__(".symver memcpy,memcpy@GLIBC_2.17");
20+
__asm__(".symver exp,exp@GLIBC_2.17");
21+
__asm__(".symver log,log@GLIBC_2.17");
22+
__asm__(".symver pow,pow@GLIBC_2.17");
23+
__asm__(".symver fcntl64,fcntl@GLIBC_2.17");
24+
#endif
25+
626
#endif

0 commit comments

Comments
 (0)