diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2016-11-21 16:09:47 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2016-11-21 16:09:47 +0000 |
commit | 3115f94f7fe0388f026837b36d165b026032093e (patch) | |
tree | 8f502695fd5b7d4aade9b6b924f17b355a3f0403 /fixincludes | |
parent | 6fce0013981ae41c0b44baa4cd59904ff5762bfc (diff) | |
download | gcc-3115f94f7fe0388f026837b36d165b026032093e.zip gcc-3115f94f7fe0388f026837b36d165b026032093e.tar.gz gcc-3115f94f7fe0388f026837b36d165b026032093e.tar.bz2 |
Don't define libstdc++-internal macros in Solaris 10+ <math.h>
libstdc++-v3:
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments.
(__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ...
(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this.
Add test for C++11 <math.h> integral overloads.
* configure: Regenerate.
* config.h.in: Regenerate.
* include/c_global/cmath [__cplusplus >= 201103L]: Reflect
__CORRECT_ISO_CPP11_MATH_H_PROTO to
__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
* include/c_global/cmath [_GLIBCXX_USE_C99_MATH &&
!_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L]
(std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT.
(std::isfinite): Likewise.
(std::isinf): Likewise.
(std::isnan): Likewise.
(std::isnormal): Likewise.
(std::signbit): Likewise.
(std::isgreater): Likewise.
(std::isgreaterequal): Likewise.
(std::isless): Likewise.
(std::islessequal): Likewise.
(std::islessgreater): Likewise.
(std::isunordered): Likewise.
[__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1]
(std::acosh): Likewise.
(std::asinh): Likewise.
(std::atanh): Likewise.
(std::cbrt): Likewise.
(std::copysign): Likewise.
(std::erf): Likewise.
(std::erfc): Likewise.
(std::exp2): Likewise.
(std::expm1): Likewise.
(std::fdim): Likewise.
(std::fma): Likewise.
(std::fmax): Likewise.
(std::fmin): Likewise.
(std::hypot): Likewise.
(std::ilogb): Likewise.
(std::lgamma): Likewise.
(std::llrint): Likewise.
(std::llround): Likewise.
(std::log1p): Likewise.
(std::log2): Likewise.
(std::logb): Likewise.
(std::lrint): Likewise.
(std::lround): Likewise.
(std::nearbyint): Likewise.
(std::nextafter): Likewise.
(std::nexttoward): Likewise.
(std::remainder): Likewise.
(std::remquo): Likewise.
(std::rint): Likewise.
(std::round): Likewise.
(std::scalbln): Likewise.
(std::scalbn): Likewise.
(std::tgamma): Likewise.
(std::trunc): Likewise.
* include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1 && __cplusplus >=
201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to
__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
fixincludes:
* inclhack.def (solaris_math_12): New fix.
(hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector.
* fixincl.x: Regenerate.
* tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test.
From-SVN: r242671
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 7 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 63 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 19 | ||||
-rw-r--r-- | fixincludes/tests/base/math.h | 6 |
4 files changed, 81 insertions, 14 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index fef9f9f..d447171 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,10 @@ +2016-11-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * inclhack.def (solaris_math_12): New fix. + (hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector. + * fixincl.x: Regenerate. + * tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test. + 2016-11-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR sanitizer/78267 diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 00d03be..b0eeef9 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed November 20, 2016 at 11:44:36 AM by AutoGen 5.16.2 + * It has been AutoGen-ed November 20, 2016 at 12:02:46 PM by AutoGen 5.16.2 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 11:44:37 MET 2016 +/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 12:02:47 MET 2016 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 241 fixup descriptions. + * This file contains 242 fixup descriptions. * * See README for more information. * @@ -4507,7 +4507,9 @@ tSCC zHpux11_FabsfList[] = /* * Machine/OS name selection pattern */ -#define apzHpux11_FabsfMachs (const char**)NULL +tSCC* apzHpux11_FabsfMachs[] = { + "*-hp-hpux11*", + (const char*)NULL }; /* * content selection pattern - do fix if pattern found @@ -4515,15 +4517,8 @@ tSCC zHpux11_FabsfList[] = tSCC zHpux11_FabsfSelect0[] = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*"; -/* - * content bypass pattern - skip fix if pattern found - */ -tSCC zHpux11_FabsfBypass0[] = - "__cplusplus"; - -#define HPUX11_FABSF_TEST_CT 2 +#define HPUX11_FABSF_TEST_CT 1 static tTestDesc aHpux11_FabsfTests[] = { - { TT_NEGREP, zHpux11_FabsfBypass0, (regex_t*)NULL }, { TT_EGREP, zHpux11_FabsfSelect0, (regex_t*)NULL }, }; /* @@ -7583,6 +7578,42 @@ static const char* apzSolaris_Math_11Patch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Math_12 fix + */ +tSCC zSolaris_Math_12Name[] = + "solaris_math_12"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_12List[] = + "math.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzSolaris_Math_12Machs[] = { + "*-*-solaris2*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_12Select0[] = + "#undef.*_GLIBCXX_USE_C99_MATH"; + +#define SOLARIS_MATH_12_TEST_CT 1 +static tTestDesc aSolaris_Math_12Tests[] = { + { TT_EGREP, zSolaris_Math_12Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_12 + */ +static const char* apzSolaris_Math_12Patch[] = { sed_cmd_z, + "-e", "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Once_Init_1 fix */ tSCC zSolaris_Once_Init_1Name[] = @@ -9879,7 +9910,7 @@ static const char* apzX11_SprintfPatch[] = { */ #define REGEX_COUNT 279 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 241 +#define FIX_COUNT 242 /* * Enumerate the fixes @@ -10068,6 +10099,7 @@ typedef enum { SOLARIS_MATH_8_FIXIDX, SOLARIS_MATH_9_FIXIDX, SOLARIS_MATH_11_FIXIDX, + SOLARIS_MATH_12_FIXIDX, SOLARIS_ONCE_INIT_1_FIXIDX, SOLARIS_POSIX_SPAWN_RESTRICT_FIXIDX, SOLARIS_POW_INT_OVERLOAD_FIXIDX, @@ -11044,6 +11076,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SOLARIS_MATH_11_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSolaris_Math_11Tests, apzSolaris_Math_11Patch, 0 }, + { zSolaris_Math_12Name, zSolaris_Math_12List, + apzSolaris_Math_12Machs, + SOLARIS_MATH_12_TEST_CT, FD_MACH_ONLY, + aSolaris_Math_12Tests, apzSolaris_Math_12Patch, 0 }, + { zSolaris_Once_Init_1Name, zSolaris_Once_Init_1List, apzSolaris_Once_Init_1Machs, SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 931161b..240fc74 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2334,9 +2334,9 @@ fix = { */ fix = { hackname = hpux11_fabsf; + mach = "*-hp-hpux11*"; files = math.h; select = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*"; - bypass = "__cplusplus"; c_fix = format; c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; @@ -3868,6 +3868,23 @@ _EOText_; }; /* + * Some versions of Solaris 10+ <math.h> #undef libstdc++-internal macros. + */ +fix = { + hackname = solaris_math_12; + files = math.h; + mach = '*-*-solaris2*'; + select = '#undef.*_GLIBCXX_USE_C99_MATH'; + sed = "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d"; + test_text = << _EOText_ +#if __cplusplus >= 201103L +#undef _GLIBCXX_USE_C99_MATH +#undef _GLIBCXX_USE_C99_MATH_TR1 +#endif +_EOText_; +}; + +/* * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a * structure. As such, it need two levels of brackets, but only * contains one. Wrap the macro definition in an extra layer. diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h index 7660172..c7da15a 100644 --- a/fixincludes/tests/base/math.h +++ b/fixincludes/tests/base/math.h @@ -85,6 +85,12 @@ extern int class(); #endif /* RS6000_DOUBLE_CHECK */ +#if defined( SOLARIS_MATH_12_CHECK ) +#if __cplusplus >= 201103L +#endif +#endif /* SOLARIS_MATH_12_CHECK */ + + #if defined( STRICT_ANSI_NOT_CTD_CHECK ) #if 1 && \ && defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \ |