Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From 905cac8934fb17e20416a4df712a566e757471a3 Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 21 May 2016 00:33:20 +0000 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 4 | Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they are macros |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | musl defines some functions as macros and not inline functions |
| 7 | if this is the case then make sure to undefine them |
| 8 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 9 | Upstream-Status: Pending |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++ |
| 13 | 1 file changed, 21 insertions(+) |
| 14 | |
| 15 | diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 16 | index 518a85ee1a0..6b4ead4efc6 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 17 | --- a/include/llvm/Analysis/TargetLibraryInfo.def |
| 18 | +++ b/include/llvm/Analysis/TargetLibraryInfo.def |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 19 | @@ -731,6 +731,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | TLI_DEFINE_ENUM_INTERNAL(fopen) |
| 21 | TLI_DEFINE_STRING_INTERNAL("fopen") |
| 22 | /// FILE *fopen64(const char *filename, const char *opentype) |
| 23 | +#ifdef fopen64 |
| 24 | +#undef fopen64 |
| 25 | +#endif |
| 26 | TLI_DEFINE_ENUM_INTERNAL(fopen64) |
| 27 | TLI_DEFINE_STRING_INTERNAL("fopen64") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 28 | /// int fork(); |
| 29 | @@ -778,6 +781,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | /// int fseeko(FILE *stream, off_t offset, int whence); |
| 31 | TLI_DEFINE_ENUM_INTERNAL(fseeko) |
| 32 | TLI_DEFINE_STRING_INTERNAL("fseeko") |
| 33 | +#ifdef fseeko64 |
| 34 | +#undef fseeko64 |
| 35 | +#endif |
| 36 | /// int fseeko64(FILE *stream, off64_t offset, int whence) |
| 37 | TLI_DEFINE_ENUM_INTERNAL(fseeko64) |
| 38 | TLI_DEFINE_STRING_INTERNAL("fseeko64") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 39 | @@ -788,6 +794,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 40 | TLI_DEFINE_ENUM_INTERNAL(fstat) |
| 41 | TLI_DEFINE_STRING_INTERNAL("fstat") |
| 42 | /// int fstat64(int filedes, struct stat64 *buf) |
| 43 | +#ifdef fstat64 |
| 44 | +#undef fstat64 |
| 45 | +#endif |
| 46 | TLI_DEFINE_ENUM_INTERNAL(fstat64) |
| 47 | TLI_DEFINE_STRING_INTERNAL("fstat64") |
| 48 | /// int fstatvfs(int fildes, struct statvfs *buf); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 49 | @@ -803,6 +812,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | TLI_DEFINE_ENUM_INTERNAL(ftello) |
| 51 | TLI_DEFINE_STRING_INTERNAL("ftello") |
| 52 | /// off64_t ftello64(FILE *stream) |
| 53 | +#ifdef ftello64 |
| 54 | +#undef ftello64 |
| 55 | +#endif |
| 56 | TLI_DEFINE_ENUM_INTERNAL(ftello64) |
| 57 | TLI_DEFINE_STRING_INTERNAL("ftello64") |
| 58 | /// int ftrylockfile(FILE *file); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 59 | @@ -929,6 +941,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 60 | TLI_DEFINE_ENUM_INTERNAL(lstat) |
| 61 | TLI_DEFINE_STRING_INTERNAL("lstat") |
| 62 | /// int lstat64(const char *path, struct stat64 *buf); |
| 63 | +#ifdef lstat64 |
| 64 | +#undef lstat64 |
| 65 | +#endif |
| 66 | TLI_DEFINE_ENUM_INTERNAL(lstat64) |
| 67 | TLI_DEFINE_STRING_INTERNAL("lstat64") |
| 68 | /// void *malloc(size_t size); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 69 | @@ -1154,6 +1169,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 70 | TLI_DEFINE_ENUM_INTERNAL(stat) |
| 71 | TLI_DEFINE_STRING_INTERNAL("stat") |
| 72 | /// int stat64(const char *path, struct stat64 *buf); |
| 73 | +#ifdef stat64 |
| 74 | +#undef stat64 |
| 75 | +#endif |
| 76 | TLI_DEFINE_ENUM_INTERNAL(stat64) |
| 77 | TLI_DEFINE_STRING_INTERNAL("stat64") |
| 78 | /// int statvfs(const char *path, struct statvfs *buf); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 79 | @@ -1283,6 +1301,9 @@ TLI_DEFINE_STRING_INTERNAL("times") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 80 | TLI_DEFINE_ENUM_INTERNAL(tmpfile) |
| 81 | TLI_DEFINE_STRING_INTERNAL("tmpfile") |
| 82 | /// FILE *tmpfile64(void) |
| 83 | +#ifdef tmpfile64 |
| 84 | +#undef tmpfile64 |
| 85 | +#endif |
| 86 | TLI_DEFINE_ENUM_INTERNAL(tmpfile64) |
| 87 | TLI_DEFINE_STRING_INTERNAL("tmpfile64") |
| 88 | /// int toascii(int c); |
| 89 | -- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 90 | 2.20.1 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 91 | |