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