Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 1 | From 4c08879d2dfbe7face4e679ac8499dc7bff2dd20 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 | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 4 | Subject: [PATCH 06/19] llvm: TargetLibraryInfo: Undefine libc functions if |
| 5 | they are macros |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | |
| 7 | musl defines some functions as macros and not inline functions |
| 8 | if this is the case then make sure to undefine them |
| 9 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 10 | Upstream-Status: Pending |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 13 | .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | 1 file changed, 21 insertions(+) |
| 15 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 16 | diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
| 17 | index afed404f04c..876888656f2 100644 |
| 18 | --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
| 19 | +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
| 20 | @@ -782,6 +782,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | TLI_DEFINE_ENUM_INTERNAL(fopen) |
| 22 | TLI_DEFINE_STRING_INTERNAL("fopen") |
| 23 | /// FILE *fopen64(const char *filename, const char *opentype) |
| 24 | +#ifdef fopen64 |
| 25 | +#undef fopen64 |
| 26 | +#endif |
| 27 | TLI_DEFINE_ENUM_INTERNAL(fopen64) |
| 28 | TLI_DEFINE_STRING_INTERNAL("fopen64") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 29 | /// int fork(); |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 30 | @@ -829,6 +832,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 31 | /// int fseeko(FILE *stream, off_t offset, int whence); |
| 32 | TLI_DEFINE_ENUM_INTERNAL(fseeko) |
| 33 | TLI_DEFINE_STRING_INTERNAL("fseeko") |
| 34 | +#ifdef fseeko64 |
| 35 | +#undef fseeko64 |
| 36 | +#endif |
| 37 | /// int fseeko64(FILE *stream, off64_t offset, int whence) |
| 38 | TLI_DEFINE_ENUM_INTERNAL(fseeko64) |
| 39 | TLI_DEFINE_STRING_INTERNAL("fseeko64") |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 40 | @@ -839,6 +845,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | TLI_DEFINE_ENUM_INTERNAL(fstat) |
| 42 | TLI_DEFINE_STRING_INTERNAL("fstat") |
| 43 | /// int fstat64(int filedes, struct stat64 *buf) |
| 44 | +#ifdef fstat64 |
| 45 | +#undef fstat64 |
| 46 | +#endif |
| 47 | TLI_DEFINE_ENUM_INTERNAL(fstat64) |
| 48 | TLI_DEFINE_STRING_INTERNAL("fstat64") |
| 49 | /// int fstatvfs(int fildes, struct statvfs *buf); |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 50 | @@ -854,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | TLI_DEFINE_ENUM_INTERNAL(ftello) |
| 52 | TLI_DEFINE_STRING_INTERNAL("ftello") |
| 53 | /// off64_t ftello64(FILE *stream) |
| 54 | +#ifdef ftello64 |
| 55 | +#undef ftello64 |
| 56 | +#endif |
| 57 | TLI_DEFINE_ENUM_INTERNAL(ftello64) |
| 58 | TLI_DEFINE_STRING_INTERNAL("ftello64") |
| 59 | /// int ftrylockfile(FILE *file); |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 60 | @@ -980,6 +992,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 61 | TLI_DEFINE_ENUM_INTERNAL(lstat) |
| 62 | TLI_DEFINE_STRING_INTERNAL("lstat") |
| 63 | /// int lstat64(const char *path, struct stat64 *buf); |
| 64 | +#ifdef lstat64 |
| 65 | +#undef lstat64 |
| 66 | +#endif |
| 67 | TLI_DEFINE_ENUM_INTERNAL(lstat64) |
| 68 | TLI_DEFINE_STRING_INTERNAL("lstat64") |
| 69 | /// void *malloc(size_t size); |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 70 | @@ -1205,6 +1220,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 71 | TLI_DEFINE_ENUM_INTERNAL(stat) |
| 72 | TLI_DEFINE_STRING_INTERNAL("stat") |
| 73 | /// int stat64(const char *path, struct stat64 *buf); |
| 74 | +#ifdef stat64 |
| 75 | +#undef stat64 |
| 76 | +#endif |
| 77 | TLI_DEFINE_ENUM_INTERNAL(stat64) |
| 78 | TLI_DEFINE_STRING_INTERNAL("stat64") |
| 79 | /// int statvfs(const char *path, struct statvfs *buf); |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 80 | @@ -1340,6 +1358,9 @@ TLI_DEFINE_STRING_INTERNAL("times") |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 81 | TLI_DEFINE_ENUM_INTERNAL(tmpfile) |
| 82 | TLI_DEFINE_STRING_INTERNAL("tmpfile") |
| 83 | /// FILE *tmpfile64(void) |
| 84 | +#ifdef tmpfile64 |
| 85 | +#undef tmpfile64 |
| 86 | +#endif |
| 87 | TLI_DEFINE_ENUM_INTERNAL(tmpfile64) |
| 88 | TLI_DEFINE_STRING_INTERNAL("tmpfile64") |
| 89 | /// int toascii(int c); |
| 90 | -- |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 91 | 2.22.0 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 92 | |