blob: 6dbbced7eb7b39fddec0ce996f3d5497453a7c79 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 905cac8934fb17e20416a4df712a566e757471a3 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 May 2016 00:33:20 +0000
Brad Bishop19323692019-04-05 15:28:33 -04004Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they are macros
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6musl defines some functions as macros and not inline functions
7if this is the case then make sure to undefine them
8
Brad Bishop19323692019-04-05 15:28:33 -04009Upstream-Status: Pending
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++
13 1 file changed, 21 insertions(+)
14
15diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def
Brad Bishop19323692019-04-05 15:28:33 -040016index 518a85ee1a0..6b4ead4efc6 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017--- a/include/llvm/Analysis/TargetLibraryInfo.def
18+++ b/include/llvm/Analysis/TargetLibraryInfo.def
Brad Bishop19323692019-04-05 15:28:33 -040019@@ -731,6 +731,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020 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 Bishop19323692019-04-05 15:28:33 -040028 /// int fork();
29@@ -778,6 +781,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030 /// 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 Bishop19323692019-04-05 15:28:33 -040039@@ -788,6 +794,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040 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 Bishop19323692019-04-05 15:28:33 -040049@@ -803,6 +812,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050 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 Bishop19323692019-04-05 15:28:33 -040059@@ -929,6 +941,9 @@ TLI_DEFINE_STRING_INTERNAL("logl")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060 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 Bishop19323692019-04-05 15:28:33 -040069@@ -1154,6 +1169,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050070 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 Bishop19323692019-04-05 15:28:33 -040079@@ -1283,6 +1301,9 @@ TLI_DEFINE_STRING_INTERNAL("times")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050080 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 Bishop19323692019-04-05 15:28:33 -0400902.20.1
Brad Bishopd7bf8c12018-02-25 22:55:05 -050091