[llvm-commits] [llvm-gcc-4.2] r76170 - /llvm-gcc-4.2/trunk/fixincludes/inclhack.def
Duncan Sands
baldrick at free.fr
Fri Jul 17 04:20:00 PDT 2009
Author: baldrick
Date: Fri Jul 17 06:19:33 2009
New Revision: 76170
URL: http://llvm.org/viewvc/llvm-project?rev=76170&view=rev
Log:
In my commit r61519, which backported gcc's revision
126377 of fixincludes, it seems I forgot to port the
actual definitions of the fixes (pointed out by Anton)!
So here is an appropriately updated inclhack.def.
Modified:
llvm-gcc-4.2/trunk/fixincludes/inclhack.def
Modified: llvm-gcc-4.2/trunk/fixincludes/inclhack.def
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/fixincludes/inclhack.def?rev=76170&r1=76169&r2=76170&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/fixincludes/inclhack.def (original)
+++ llvm-gcc-4.2/trunk/fixincludes/inclhack.def Fri Jul 17 06:19:33 2009
@@ -178,6 +178,7 @@
files = asm/posix_types.h;
mach = 'i[34567]86-*-linux*';
bypass = '} while';
+ bypass = 'x86_64';
/*
* Define _POSIX_TYPES_H_WRAPPER at the end of the wrapper, not
@@ -691,7 +692,8 @@
*/
fix = {
hackname = alpha___extern_prefix;
- select = "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n(#[ \t]*pragma[ \t]*extern_prefix.*)";
+ select = "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n"
+ "(#[ \t]*pragma[ \t]*extern_prefix.*)";
mach = "alpha*-dec-osf*";
c_fix = format;
@@ -718,7 +720,8 @@
c_fix = format;
c_fix_arg = "%0 && !defined(__PRAGMA_EXTERN_PREFIX)";
- test_text = "#if (_ISO_C_SOURCE>=19990L) && !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)";
+ test_text = "#if (_ISO_C_SOURCE>=19990L) "
+ "&& !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)";
};
@@ -751,7 +754,8 @@
select = '(#define assert\(EX\).*)\(\(int\) \(EX\)\)';
c_fix = format;
c_fix_arg = "%1(EX)";
- test_text = '#define assert(EX) (((int) (EX)) ? (void)0 : __assert(#EX, __FILE__, __LINE__))';
+ test_text = '#define assert(EX) (((int) (EX)) ? (void)0 '
+ ': __assert(#EX, __FILE__, __LINE__))';
};
@@ -819,14 +823,17 @@
fix = {
hackname = alpha_pthread;
files = pthread.h;
- select = "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)|def _PTHREAD_ENV_DECC)(.*))\n"
+ select = "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)"
+ "|def _PTHREAD_ENV_DECC)(.*))\n"
"(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
mach = "alpha*-dec-osf*";
c_fix = format;
- c_fix_arg = "%2 defined (_PTHREAD_ENV_DECC)%4 || defined (__PRAGMA_EXTERN_PREFIX)\n%5";
+ c_fix_arg = "%2 defined (_PTHREAD_ENV_DECC)%4 "
+ "|| defined (__PRAGMA_EXTERN_PREFIX)\n%5";
- test_text = "# if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC)\n"
+ test_text = "# if defined (_PTHREAD_ENV_DECC) "
+ "|| defined (_PTHREAD_ENV_EPCC)\n"
"# define _PTHREAD_USE_PTDNAM_\n"
"# endif\n"
"# ifdef _PTHREAD_ENV_DECC\n"
@@ -924,8 +931,12 @@
mach = "alpha*-dec-osf4*";
select = "#define wcstok wcstok_r";
- sed = "s@#define wcstok wcstok_r at extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@";
- sed = "s@#define wcsftime __wcsftime_isoc at extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@";
+ sed = "s@#define wcstok wcstok_r@"
+ "extern wchar_t *wcstok __((wchar_t *, const wchar_t *, "
+ "wchar_t **)) __asm__(\"wcstok_r\");@";
+ sed = "s@#define wcsftime __wcsftime_isoc@"
+ "extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *"
+ ", const struct tm *)) __asm__(\"__wcsftime_isoc\");@";
test_text = "#define wcstok wcstok_r\n"
"#define wcsftime __wcsftime_isoc";
};
@@ -1065,9 +1076,7 @@
*/
fix = {
hackname = broken_cabs;
- files = "math.h";
- files = "architecture/ppc/math.h";
- files = "architecture/i386/math.h";
+ files = math.h, "architecture/*/math.h";
select = "^extern[ \t]+double[ \t]+cabs";
sed = "s/^extern[ \t]*double[ \t]*cabs[ \t]*\([^\\\)]*\);//";
@@ -1091,8 +1100,14 @@
fix = {
hackname = broken_nan;
+ /*
+ * It is tempting to omit the first "files" entry. Do not.
+ * The testing machinery will take the first "files" entry as the name
+ * of a test file to play with. It would be a nuisance to have a directory
+ * with the name "*".
+ */
files = "architecture/ppc/math.h";
- files = "architecture/i386/math.h";
+ files = "architecture/*/math.h";
select = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
bypass = "powl";
c_fix = format;
@@ -1390,6 +1405,85 @@
};
+/*
+ * Some versions of glibc don't expect the C99 inline semantics.
+ */
+fix = {
+ hackname = glibc_c99_inline_1;
+ files = features.h, '*/features.h';
+ select = "^ *&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__$";
+ c_fix = format;
+ c_fix_arg = "%0 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)";
+ test_text = <<-EOT
+#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
+# define __USE_EXTERN_INLINES 1
+#endif
+EOT;
+};
+
+
+/*
+ * The glibc_c99_inline_1 fix should have fixed everything. Unfortunately
+ * there are many glibc headers which do not respect __USE_EXTERN_INLINES.
+ * The remaining glibc_c99_inline_* fixes deal with some of those headers.
+ */
+fix = {
+ hackname = glibc_c99_inline_2;
+ files = sys/stat.h, '*/sys/stat.h';
+ select = "extern __inline__ int";
+ sed = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
+ "__inline__ int \\1/";
+ sed = "s/extern int __REDIRECT\\(_NTH\\|\\) (\\(stat\\|lstat\\|fstat\\)/"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
+ "__inline__ int __REDIRECT\\1 (\\2/";
+ sed = "s/^extern __inline__ int/"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
+ "__inline__ int/";
+ test_text = <<-EOT
+ extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+ extern __inline__ int
+ __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
+ {}
+ EOT;
+};
+
+
+fix = {
+ hackname = glibc_c99_inline_3;
+ files = bits/string2.h, '*/bits/string2.h';
+ select = "extern __inline";
+ bypass = "__STDC_VERSION__";
+ c_fix = format;
+ c_fix_arg = "# if defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)";
+ c_fix_arg = "^# ifdef __cplusplus$";
+ test_text = <<-EOT
+ # ifdef __cplusplus
+ # define __STRING_INLINE inline
+ # else
+ # define __STRING_INLINE extern __inline
+ # endif
+ EOT;
+};
+
+
+fix = {
+ hackname = glibc_c99_inline_4;
+ files = sys/sysmacros.h, '*/sys/sysmacros.h';
+ bypass = "__STDC_VERSION__";
+ select = "extern __inline";
+ c_fix = format;
+ c_fix_arg = "\n#ifdef __GNUC_GNU_INLINE__\nextern\n#endif\n";
+ c_fix_arg = '(^| )extern ';
+ test_text = <<-EOT
+ __extension__ extern __inline unsigned int
+ __extension__ __extern_inline unsigned int
+ extern __inline unsigned int
+ EOT;
+};
+
+
/* glibc-2.3.5 defines pthread mutex initializers incorrectly,
* so we replace them with versions that correspond to the
* definition.
@@ -1566,6 +1660,27 @@
};
+fix = {
+ hackname = hppa_hpux_fp_macros;
+ mach = "hppa*-hp-hpux11*";
+ files = math.h;
+ select = "#[ \t]*define[ \t]*FP_NORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_ZERO.*\n"
+ "#[ \t]*define[ \t]*FP_INFINITE.*\n"
+ "#[ \t]*define[ \t]*FP_SUBNORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_NAN.*\n";
+ c_fix = format;
+ c_fix_arg = "#endif /* _INCLUDE_HPUX_SOURCE */\n\n#if defined(_INCLUDE_HPUX_SOURCE) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))\n%0#endif\n\n#ifdef _INCLUDE_HPUX_SOURCE\n";
+
+ test_text =
+ "# define FP_NORMAL 0\n"
+ "# define FP_ZERO 1\n"
+ "# define FP_INFINITE 2\n"
+ "# define FP_SUBNORMAL 3\n"
+ "# define FP_NAN 4\n";
+};
+
+
/*
* Fix hpux 10.X missing ctype declarations 1
*/
@@ -2294,13 +2409,7 @@
fix = {
hackname = kandr_concat;
files = "sparc/asm_linkage.h";
- files = "sun3/asm_linkage.h";
- files = "sun3x/asm_linkage.h";
- files = "sun4/asm_linkage.h";
- files = "sun4c/asm_linkage.h";
- files = "sun4m/asm_linkage.h";
- files = "sun4c/debug/asm_linkage.h";
- files = "sun4m/debug/asm_linkage.h";
+ files = "sun*/asm_linkage.h";
files = "arm/as_support.h";
files = "arm/mc_type.h";
files = "arm/xcb.h";
@@ -2551,7 +2660,7 @@
' : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");';
};
/* LLVM local end */
-
+
/*
* nested comment
*/
@@ -2602,6 +2711,22 @@
/*
+ * Some versions of NetBSD don't expect the C99 inline semantics.
+ */
+fix = {
+ hackname = netbsd_c99_inline_1;
+ mach = "*-*-netbsd*";
+ files = signal.h;
+ select = "extern __inline int";
+
+ c_fix = format;
+ c_fix_arg = "extern\n#ifdef __GNUC_STDC_INLINE__\n__attribute__((__gnu_inline__))\n#endif\n__inline int";
+
+ test_text = "extern __inline int\nsigaddset(sigset_t *set, int signo)\n{}";
+};
+
+
+/*
* NetBSD has a semicolon after the ending '}' for some extern "C".
*/
fix = {
@@ -2911,14 +3036,7 @@
*/
fix = {
hackname = sco_math;
- files = math.h;
- files = ansi/math.h;
- files = posix/math.h;
- files = xpg4/math.h;
- files = xpg4v2/math.h;
- files = xpg4plus/math.h;
- files = ods_30_compat/math.h;
- files = oldstyle/math.h;
+ files = math.h, '*/math.h';
select = "inline double abs";
bypass = "__GNUG__";
sed = "/#define.*__fp_class(a) \\\\/i\\\n"
More information about the llvm-commits
mailing list