blob: 789c308863408c0de422d2d9e5447ea5969b661e [file] [log] [blame]
Brad Bishop08902b02019-08-20 09:16:51 -04001From 4c08879d2dfbe7face4e679ac8499dc7bff2dd20 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 Bishop08902b02019-08-20 09:16:51 -04004Subject: [PATCH 06/19] llvm: TargetLibraryInfo: Undefine libc functions if
5 they are macros
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006
7musl defines some functions as macros and not inline functions
8if this is the case then make sure to undefine them
9
Brad Bishop19323692019-04-05 15:28:33 -040010Upstream-Status: Pending
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
Brad Bishop08902b02019-08-20 09:16:51 -040013 .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014 1 file changed, 21 insertions(+)
15
Brad Bishop08902b02019-08-20 09:16:51 -040016diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
17index 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 Bishopd7bf8c12018-02-25 22:55:05 -050021 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 Bishop19323692019-04-05 15:28:33 -040029 /// int fork();
Brad Bishop08902b02019-08-20 09:16:51 -040030@@ -829,6 +832,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050031 /// 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 Bishop08902b02019-08-20 09:16:51 -040040@@ -839,6 +845,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050041 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 Bishop08902b02019-08-20 09:16:51 -040050@@ -854,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050051 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 Bishop08902b02019-08-20 09:16:51 -040060@@ -980,6 +992,9 @@ TLI_DEFINE_STRING_INTERNAL("logl")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050061 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 Bishop08902b02019-08-20 09:16:51 -040070@@ -1205,6 +1220,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071 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 Bishop08902b02019-08-20 09:16:51 -040080@@ -1340,6 +1358,9 @@ TLI_DEFINE_STRING_INTERNAL("times")
Brad Bishopd7bf8c12018-02-25 22:55:05 -050081 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 Bishop08902b02019-08-20 09:16:51 -0400912.22.0
Brad Bishopd7bf8c12018-02-25 22:55:05 -050092