[PATCH] D51282: Disable calls to *_finite and other glibc-only functions on Musl.
Khem Raj via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 26 23:42:56 PDT 2018
raj.khem created this revision.
raj.khem added a reviewer: rengolin.
Herald added subscribers: llvm-commits, srhines.
glibc's finite lib calls are generated when possible.
However, they are not supported on Musl/linux. This change also
disables other functions not available on Musl.
Repository:
rL LLVM
https://reviews.llvm.org/D51282
Files:
lib/Analysis/TargetLibraryInfo.cpp
Index: lib/Analysis/TargetLibraryInfo.cpp
===================================================================
--- lib/Analysis/TargetLibraryInfo.cpp
+++ lib/Analysis/TargetLibraryInfo.cpp
@@ -415,27 +415,28 @@
// The following functions are available on Linux,
// but Android uses bionic instead of glibc.
- if (!T.isOSLinux() || T.isAndroid()) {
+ if (!T.isOSLinux() || T.isAndroid() || T.isMusl()) {
TLI.setUnavailable(LibFunc_dunder_strdup);
TLI.setUnavailable(LibFunc_dunder_strtok_r);
TLI.setUnavailable(LibFunc_dunder_isoc99_scanf);
TLI.setUnavailable(LibFunc_dunder_isoc99_sscanf);
TLI.setUnavailable(LibFunc_under_IO_getc);
TLI.setUnavailable(LibFunc_under_IO_putc);
- // But, Android has memalign.
- if (!T.isAndroid())
+ // But, Android/Musl has memalign.
+ if (!T.isAndroid() || !T.isMusl() )
TLI.setUnavailable(LibFunc_memalign);
- TLI.setUnavailable(LibFunc_fopen64);
- TLI.setUnavailable(LibFunc_fseeko64);
- TLI.setUnavailable(LibFunc_fstat64);
- TLI.setUnavailable(LibFunc_fstatvfs64);
- TLI.setUnavailable(LibFunc_ftello64);
- TLI.setUnavailable(LibFunc_lstat64);
- TLI.setUnavailable(LibFunc_open64);
- TLI.setUnavailable(LibFunc_stat64);
- TLI.setUnavailable(LibFunc_statvfs64);
- TLI.setUnavailable(LibFunc_tmpfile64);
-
+ if (!T.isMusl()) {
+ TLI.setUnavailable(LibFunc_fopen64);
+ TLI.setUnavailable(LibFunc_fseeko64);
+ TLI.setUnavailable(LibFunc_fstat64);
+ TLI.setUnavailable(LibFunc_fstatvfs64);
+ TLI.setUnavailable(LibFunc_ftello64);
+ TLI.setUnavailable(LibFunc_lstat64);
+ TLI.setUnavailable(LibFunc_open64);
+ TLI.setUnavailable(LibFunc_stat64);
+ TLI.setUnavailable(LibFunc_statvfs64);
+ TLI.setUnavailable(LibFunc_tmpfile64);
+ }
// Relaxed math functions are included in math-finite.h on Linux (GLIBC).
TLI.setUnavailable(LibFunc_acos_finite);
TLI.setUnavailable(LibFunc_acosf_finite);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51282.162615.patch
Type: text/x-patch
Size: 1980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180827/1c3883ce/attachment.bin>
More information about the llvm-commits
mailing list