aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
AgeCommit message (Collapse)AuthorFilesLines
10 daysRevert "fixincludes: skip stdio_stdarg_h on darwin"Iain Sandoe1-1/+0
This reverts commit 7d454cae9d7df1f2936ad02d0742674a85396736. The change breaks bootstrap on some x86_64 OS versions.
10 daysfixincludes: skip stdio_stdarg_h on darwinFrancois-Xavier Coudert1-0/+1
The fix is unnecessary on macOS. fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (stdio_stdarg_h): Skip on darwin.
10 daysfixincludes: add bypass to darwin_objc_runtime_1Francois-Xavier Coudert1-0/+1
Headers are now fixed in the macOS 15 SDK, and the fix should be bypassed there. fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (darwin_objc_runtime_1): Add bypass.
2024-06-27fixincludes: adjust stdio fix for macOS 15 headersFrancois-Xavier Coudert1-0/+1
fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (apple_local_stdio_fn_deprecation): Also apply to _stdio.h.
2024-06-11fixincludes: bypass the math_exception fix on __cplusplusFrancois-Xavier Coudert1-11/+1
fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (math_exception): Bypass on __cplusplus. * tests/base/math.h: Regenerate.
2024-06-07fixincludes: bypass some fixes for recent darwin headersFrancois-Xavier Coudert1-0/+4
fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (darwin_stdint_7, darwin_dispatch_object_1, darwin_os_trace_2, darwin_os_base_1): Include bypasses for recent headers, fixed by Apple.
2023-08-17fixincludes: Update darwin_flt_eval_method for macOS 14Rainer Orth1-3/+4
On macOS 14, a guard in <math.h> changed: -- MacOSX13.3.sdk/usr/include/math.h 2023-04-19 01:54:44 +++ MacOSX14.0.sdk/usr/include/math.h 2023-08-01 08:42:43 @@ -22,0 +23 @@ + @@ -43 +44 @@ -#if __FLT_EVAL_METHOD__ == 0 +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 @@ -49 +50 @@ -#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 +#elif __FLT_EVAL_METHOD__ == 2 Therefore the darwin_flt_eval_method fixincludes fix doesn't match any longer, leading to a large number of testsuite failures like /private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__." where __FLT_EVAL_METHOD__ = 16. This patch adjusts the fix to allow for both forms. Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and verifying that <math.h> has indeed been fixed as expected. 2023-08-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> fixincludes: * inclhack.def (darwin_flt_eval_method): Handle macOS 14 guard variant. * fixincl.x: Regenerate. * tests/base/math.h [DARWIN_FLT_EVAL_METHOD_CHECK]: Update test.
2023-02-17fixincludes: Bypass solaris_math_12 on newer Solaris 11.4Rainer Orth1-0/+1
Solaris 11 <math.h> long had this snippet which badly broke libstdc++. This has long been undone using fixincludes in [fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+ <math.h> https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00330.html However, the issue came up again recently when that code broke the LLVM build, too, which unfortunately doesn't know about GCC's include-fixed directory. The issue was reinvestigated and it turned out that the workaround/hack is only needed for specific old versions of the Sun/Oracle Studio compilers. So <math.h> now looks like /* Accommodate historical C++11 -std=c++03 behavior of Studio 12.4 and 12.5 */ ((__SUNPRO_CC == 0x5130) || (__SUNPRO_CC == 0x5140) || \ defined(__MATH_PREEMPTS_GLIBCXX_C99_MATH)) If this change is in place, there's no longer a need for the fixincludes fix, so this patch bypasses it as appropriate. Tested on Solaris 11.3 (without the fixed header) and recent 11.4 (with the fixed header). 2022-11-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> fixincludes: * inclhack.def (solaris_math_12): Add bypass. * fixincl.x: Regenerate.
2023-01-21Darwin, fixincludes: Handle Apple Blocks in objc/runtime.h.Iain Sandoe1-0/+35
The macOS 13 SDK has unguarded Apple Blocks use in objc/runtime.h which causes most of the objective-c tests to fail. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (darwin_objc_runtime_1): New hack. * tests/base/objc/runtime.h: New file.
2023-01-21Darwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].Iain Sandoe1-0/+12
The SDK for MacOS13 includes Apple-specific deprecations of some functions that are not deprecated in Posix, C or C++ and widely used in GCC. The fix makes the deprecation conditional on __APPLE_LOCAL_DEPRECATIONS so that end users may still observe them but they are hidden from normal compilations. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR target/107568 fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def: Add a fix for MacOS13 SDK function deprecations in stdio.h. * tests/base/stdio.h (__deprecated_msg): New test.
2022-10-07fixincludes: Deal also with the _Float128x cases [PR107059]Jakub Jelinek1-0/+17
On Wed, Sep 28, 2022 at 08:19:43PM +0200, Jakub Jelinek via Gcc-patches wrote: > Another case are the following 3 snippets: > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128X supported but no constant suffix" > # else > # define __f128x(x) x##f128x > # endif > ... > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128X supported but no complex type" > # else > # define __CFLOAT128X _Complex _Float128x > # endif > ... > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128x supported but no type" > # endif > but as no target has _Float128x right now and don't see it > coming soon, it isn't a big deal (on the glibc side it is of > course ok to adjust those). This incremental patch deals handles the above 3 cases, so we fixinclude what glibc itself changed too. 2022-10-07 Jakub Jelinek <jakub@redhat.com> PR bootstrap/107059 * inclhack.def (glibc_cxx_floatn_5): New. * fixincl.x: Regenerated. * tests/base/bits/floatn.h: Regenerated.
2022-10-07fixincludes: Fix up powerpc floatn.h tweaks [PR107059]Jakub Jelinek1-2/+22
On Wed, Sep 28, 2022 at 12:23:31AM +0000, Joseph Myers wrote: > In general the changes match those made by fixincludes, though I think > the ones in sysdeps/powerpc/bits/floatn.h, where the header tests > __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing > fixincludes patterns. You're right, missed that. The header has: /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if __LDBL_MANT_DIG__ == 113 && defined __cplusplus typedef long double _Float128; # define __CFLOAT128 _Complex long double # elif !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The type _Float128 exist for powerpc only since GCC 7.0. */ typedef __float128 _Float128; /* Add a typedef for older GCC and C++ compilers which don't natively support _Complex _Float128. */ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__))); # define __CFLOAT128 __cfloat128 # else # define __CFLOAT128 _Complex _Float128 # endif # endif and my current rules don't do anything about that. The following patch fixes that. I've run additionally MACRO_LIST=`pwd`/../gcc/macro_list TARGET_MACHINE=x86_64-pc-linux-gnu \ ../fixincludes/fixinc.sh /tmp/include-fixed \ `echo /usr/src/libc | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` in the builddir/fixincludes directory where /usr/src/libc is latest glibc trunk checkout and seems the remaining defined __cplusplus cases in the floatn.h and floatn-common.h headers are ok or acceptable. The remaining cases are: #if __GNUC_PREREQ (7, 0) && !defined __cplusplus # define __HAVE_FLOATN_NOT_TYPEDEF 1 #else # define __HAVE_FLOATN_NOT_TYPEDEF 0 #endif which is IMHO ok because this is only used in tgmath.h or tgmath-like math.h stuff which is C only, as C++ doesn't have _Generic. Another case are the following 3 snippets: # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no constant suffix" # else # define __f128x(x) x##f128x # endif ... # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no complex type" # else # define __CFLOAT128X _Complex _Float128x # endif ... # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128x supported but no type" # endif but as no target has _Float128x right now and don't see it coming soon, it isn't a big deal (on the glibc side it is of course ok to adjust those). OT, besides floatn.h and floatn-common.h headers, the only one remaining in /tmp/include-fixed is sysdeps/arm/unwind.h, perhaps -#if defined(linux) || defined(__NetBSD__) +#if defined(__linux__) || defined(__NetBSD__) should be done in that header (and libgcc/config/arm/unwind-arm.h too). 2022-10-07 Jakub Jelinek <jakub@redhat.com> PR bootstrap/107059 * inclhack.def (glibc_cxx_floatn_2): Handle #elif the same as #if. (glibc_cxx_floatn_4): New. * fixincl.x: Regenerated. * tests/base/bits/floatn.h: Regenerated.
2022-09-27fixincludes: FIx up for Debian/Ubuntu includesJakub Jelinek1-3/+3
As reported by Tobias, my C++ _Float{16,32,64,128,32x,64x,128x} support patch broke Debian/Ubuntu bootstraps. The problem is that there glibc bits/floatn.h and bits/floatn-common.h isn't in /usr/include/ directly, but in a subdirectory like /usr/include/x86_64-linux-gnu/ Seems other fixinclude rules for bits/* headers use files = bits/whatever.h, "*/bits/whatever.h"; so this patch just follows the suit. 2022-06-27 Jakub Jelinek <jakub@redhat.com> * inclhack.def (glibc_cxx_floatn_1, glibc_cxx_floatn_2, glibc_cxx_floatn_3): Add to files also "*/bits/floatn.h" and "*/bits/floatn-common.h". * fixincl.x: Regenerated.
2022-09-27c++: Implement P1467R9 - Extended floating-point types and standard names ↵Jakub Jelinek1-0/+96
compiler part except for bfloat16 [PR106652] The following patch implements the compiler part of C++23 P1467R9 - Extended floating-point types and standard names compiler part by introducing _Float{16,32,64,128} as keywords and builtin types like they are implemented for C already since GCC 7, with DF{16,32,64,128}_ mangling. It also introduces _Float{32,64,128}x for C++ with the https://github.com/itanium-cxx-abi/cxx-abi/pull/147 proposed mangling of DF{32,64,128}x. The patch doesn't add anything for bfloat16_t support, as right now __bf16 type refuses all conversions and arithmetic operations. The patch wants to keep backwards compatibility with how __float128 has been handled in C++ before, both for mangling and behavior in binary operations, overload resolution etc. So, there are some backend changes where for C __float128 and _Float128 are the same type (float128_type_node and float128t_type_node are the same pointer), but for C++ they are distinct types which mangle differently and _Float128 is treated as extended floating-point type while __float128 is treated as non-standard floating point type. The various C++23 changes about how floating-point types are changed are actually implemented as written in the spec only if at least one of the types involved is _Float{16,32,64,128,32x,64x,128x} (_FloatNx are also treated as extended floating-point types) and kept previous behavior otherwise. For float/double/long double the rules are actually written that they behave the same as before. There is some backwards incompatibility at least on x86 regarding _Float16, because that type was already used by that name and with the DF16_ mangling (but only since GCC 12 and I think it isn't that widely used in the wild yet). E.g. config/i386/avx512fp16intrin.h shows the issues, where in C or in GCC 12 in C++ one could pass 0.0f to a builtin taking _Float16 argument, but with the changes that is not possible anymore, one needs to either use 0.0f16 or (_Float16) 0.0f. We have also a problem with glibc headers, where since glibc 2.27 math.h and complex.h aren't compilable with these changes. One gets errors like: In file included from /usr/include/math.h:43, from abc.c:1: /usr/include/bits/floatn.h:86:9: error: multiple types in one declaration 86 | typedef __float128 _Float128; | ^~~~~~~~~~ /usr/include/bits/floatn.h:86:20: error: declaration does not declare anything [-fpermissive] 86 | typedef __float128 _Float128; | ^~~~~~~~~ In file included from /usr/include/bits/floatn.h:119: /usr/include/bits/floatn-common.h:214:9: error: multiple types in one declaration 214 | typedef float _Float32; | ^~~~~ /usr/include/bits/floatn-common.h:214:15: error: declaration does not declare anything [-fpermissive] 214 | typedef float _Float32; | ^~~~~~~~ /usr/include/bits/floatn-common.h:251:9: error: multiple types in one declaration 251 | typedef double _Float64; | ^~~~~~ /usr/include/bits/floatn-common.h:251:16: error: declaration does not declare anything [-fpermissive] 251 | typedef double _Float64; | ^~~~~~~~ This is from snippets like: /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT128 /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef __float128 _Float128; # endif where it hardcodes that C++ doesn't have _Float{16,32,64,128,32x,64x,128x} support nor {f,F}{16,32,64,128}{,x} literal suffixes nor _Complex _Float{16,32,64,128,32x,64x,128x}. The patch fixincludes this for now and hopefully if this is committed, then glibc can change those. The patch changes those # if !__GNUC_PREREQ (7, 0) || defined __cplusplus conditions to # if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) Another thing is mangling, as said above, Itanium C++ ABI specifies DF <number> _ as _Float{16,32,64,128} mangling, but GCC was implementing a mangling incompatible with that starting with DF for fixed point types. Fixed point was never supported in C++ though, I believe the reason why the mangling has been added was that due to a bug it would leak into the C++ FE through decltype (0.0r) etc. But that has been shortly after the mangling was added fixed (I think in the same GCC release cycle), so we now reject 0.0r etc. in C++. If we ever need the fixed point mangling, I think it can be readded but better with a different prefix so that it doesn't conflict with the published standard manglings. So, this patch also kills the fixed point mangling and implements the DF <number> _ demangling. The patch predefines __STDCPP_FLOAT{16,32,64,128}_T__ macros when those types are available, but only for C++23, while the underlying types are available in C++98 and later including the {f,F}{16,32,64,128} literal suffixes (but those with a pedwarn for C++20 and earlier). My understanding is that it needs to be predefined by the compiler, on the other side predefining even for older modes when <stdfloat> is a new C++23 header would be weird. One can find out if _Float{16,32,64,128,32x,64x,128x} is supported in C++ by __GNUC__ >= 13 && defined(__FLT{16,32,64,128,32X,64X,128X}_MANT_DIG__) (but that doesn't work well with older G++ 13 snapshots). As for std::bfloat16_t, three targets (aarch64, arm and x86) apparently "support" __bf16 type which has the bfloat16 format, but isn't really usable, e.g. {aarch64,arm,ix86}_invalid_conversion disallow any conversions from or to type with BFmode, {aarch64,arm,ix86}_invalid_unary_op disallows any unary operations on those except for ADDR_EXPR and {aarch64,arm,ix86}_invalid_binary_op disallows any binary operation on those. So, I think we satisfy: "If the implementation supports an extended floating-point type with the properties, as specified by ISO/IEC/IEEE 60559, of radix (b) of 2, storage width in bits (k) of 16, precision in bits (p) of 8, maximum exponent (emax) of 127, and exponent field width in bits (w) of 8, then the typedef-name std::bfloat16_t is defined in the header <stdfloat> and names such a type, the macro __STDCPP_BFLOAT16_T__ is defined, and the floating-point literal suffixes bf16 and BF16 are supported." because we don't really support those right now. 2022-09-27 Jakub Jelinek <jakub@redhat.com> PR c++/106652 PR c++/85518 gcc/ * tree-core.h (enum tree_index): Add TI_FLOAT128T_TYPE enumerator. * tree.h (float128t_type_node): Define. * tree.cc (build_common_tree_nodes): Initialize float128t_type_node. * builtins.def (DEF_FLOATN_BUILTIN): Adjust comment now that _Float<N> is supported in C++ too. * config/i386/i386.cc (ix86_mangle_type): Only mangle as "g" float128t_type_node. * config/i386/i386-builtins.cc (ix86_init_builtin_types): Use float128t_type_node for __float128 instead of float128_type_node and create it if NULL. * config/i386/avx512fp16intrin.h (_mm_setzero_ph, _mm256_setzero_ph, _mm512_setzero_ph, _mm_set_sh, _mm_load_sh): Use 0.0f16 instead of 0.0f. * config/ia64/ia64.cc (ia64_init_builtins): Use float128t_type_node for __float128 instead of float128_type_node and create it if NULL. * config/rs6000/rs6000-c.cc (is_float128_p): Also return true for float128t_type_node if non-NULL. * config/rs6000/rs6000.cc (rs6000_mangle_type): Don't mangle float128_type_node as "u9__ieee128". * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Use float128t_type_node for __float128 instead of float128_type_node and create it if NULL. gcc/c-family/ * c-common.cc (c_common_reswords): Change _Float{16,32,64,128} and _Float{32,64,128}x flags from D_CONLY to 0. (shorten_binary_op): Punt if common_type returns error_mark_node. (shorten_compare): Likewise. (c_common_nodes_and_builtins): For C++ record _Float{16,32,64,128} and _Float{32,64,128}x builtin types if available. For C++ clear float128t_type_node. * c-cppbuiltin.cc (c_cpp_builtins): Predefine __STDCPP_FLOAT{16,32,64,128}_T__ for C++23 if supported. * c-lex.cc (interpret_float): For q/Q suffixes prefer float128t_type_node over float128_type_node. Allow {f,F}{16,32,64,128} suffixes for C++ if supported with pedwarn for C++20 and older. Allow {f,F}{32,64,128}x suffixes for C++ with pedwarn. Don't call excess_precision_type for C++. gcc/cp/ * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement P1467R9 - Extended floating-point types and standard names except for std::bfloat16_t for now. Declare. (extended_float_type_p): New inline function. * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts with that. * typeck2.cc (check_narrowing): If one of ftype or type is extended floating-point type, compare floating-point conversion ranks. * parser.cc (cp_keyword_starts_decl_specifier_p): Handle CASE_RID_FLOATN_NX. (cp_parser_simple_type_specifier): Likewise and diagnose missing _Float<N> or _Float<N>x support if not supported by target. * typeck.cc (cp_compare_floating_point_conversion_ranks): New function. (cp_common_type): If both types are REAL_TYPE and one or both are extended floating-point types, select common type based on comparison of floating-point conversion ranks and subranks. (cp_build_binary_op): Diagnose operation with floating point arguments with unordered conversion ranks. * call.cc (standard_conversion): For floating-point conversion, if either from or to are extended floating-point types, set conv->bad_p for implicit conversion from larger to smaller conversion rank or with unordered conversion ranks. (convert_like_internal): Emit a pedwarn on such conversions. (build_conditional_expr): Diagnose operation with floating point arguments with unordered conversion ranks. (convert_arg_to_ellipsis): Don't promote extended floating-point types narrower than double to double. (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes. gcc/testsuite/ * g++.dg/cpp23/ext-floating1.C: New test. * g++.dg/cpp23/ext-floating2.C: New test. * g++.dg/cpp23/ext-floating3.C: New test. * g++.dg/cpp23/ext-floating4.C: New test. * g++.dg/cpp23/ext-floating5.C: New test. * g++.dg/cpp23/ext-floating6.C: New test. * g++.dg/cpp23/ext-floating7.C: New test. * g++.dg/cpp23/ext-floating8.C: New test. * g++.dg/cpp23/ext-floating9.C: New test. * g++.dg/cpp23/ext-floating10.C: New test. * g++.dg/cpp23/ext-floating.h: New file. * g++.target/i386/float16-1.C: Adjust expected diagnostics. libcpp/ * expr.cc (interpret_float_suffix): Allow {f,F}{16,32,64,128} and {f,F}{32,64,128}x suffixes for C++. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE. (struct demangle_component): Add u.s_extended_builtin member. libiberty/ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE. Don't handle DEMANGLE_COMPONENT_FIXED_TYPE. (d_make_extended_builtin_type): New function. (cplus_demangle_builtin_types): Add _Float entry. (cplus_demangle_type): For DF demangle it as _Float<N> or _Float<N>x rather than fixed point which conflicts with it. (d_count_templates_scopes): Handle DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE. Just break; for DEMANGLE_COMPONENT_FIXED_TYPE. (d_find_pack): Handle DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE. Don't handle DEMANGLE_COMPONENT_FIXED_TYPE. (d_print_comp_inner): Likewise. * cp-demangle.h (D_BUILTIN_TYPE_COUNT): Bump. * testsuite/demangle-expected: Replace _Z3xxxDFyuVb test with _Z3xxxDF16_DF32_DF64_DF128_CDF16_Vb. Add _Z3xxxDF32xDF64xDF128xCDF32xVb test. fixincludes/ * inclhack.def (glibc_cxx_floatn_1, glibc_cxx_floatn_2, glibc_cxx_floatn_3): New fixes. * tests/base/bits/floatn.h: New file. * fixincl.x: Regenerated.
2022-02-27Fix declarations of _DINFINITY, _SINFINITY and _SQNANJohn David Anglin1-0/+18
The declarations of _DINFINITY, _SINFINITY and _SQNAN need to be constant expressions. 2022-02-27 John David Anglin <danglin@gcc.gnu.org> fixincludes/ChangeLog: * inclhack.def (hpux_math_constexpr): New hack. * fixincl.x: Regenerate. * tests/base/math.h: Update.
2022-01-16Add VxWorks fixincludes hack, open posix API for C++Olivier Hainque1-0/+41
When system headers expose a strict "open" prototype with 3 args, arrange to expose a C++ overload with only two. 2021-01-10 Olivier Hainque <hainque@adacore.com> * inclhack.def (vxworks_math_h_fp_c99): New hack. * tests/base/fcntl.h: Update. * fixincl.x: Regenerate.
2022-01-16Add VxWorks fixincludes hack, #include sysLib.h in time.hOlivier Hainque1-0/+32
Make sure there is a visible prototype of sysClkRateGet() when CLOCKS_PER_SEC is #defined to that in time.h for VxWorks. This would typically be provided by sysLib.h. 2021-01-10 Olivier Hainque <hainque@adacore.com> * inclhack.def (vxworks_time_h_syslib): New hack. * tests/base/time.h: Update. * fixincl.x: Regenerate.
2022-01-16Add VxWorks fixincludes hack, C99 FP classificationOlivier Hainque1-0/+50
Arrange to provide missing defs for C99 FP classification functions and constants queried by libstdc++ configure checks (C99 support for C++98) 2021-01-10 Olivier Hainque <hainque@adacore.com> * inclhack.def (vxworks_math_h_fp_c99): New hack. * tests/base/math.h: Update. * fixincl.x: Regenerate.
2022-01-06Add VxWworks fixincludes hack, don't expect yvals.h from gccOlivier Hainque1-0/+22
yvals.h on VxWorks expects the toolchain to provide its own version of the header, which we don't do. Arrange to fallback on the common system definitions instead. 2021-12-16 Olivier Hainque <hainque@adacore.com> fixincludes/ * inclhack.def (vxworks_next_yvals): New hack. * tests/base/yvals.h: New expected test result. * fixincl.x: Regenerate.
2022-01-04Adjust VxWorks fixincludes hack for mkdir to work for C++Olivier Hainque1-5/+7
For VxWorks, replace an attempt at providing a posix API for mkdir via macro by a varargs prototype, which works better for C++ references like std::mkdir(arg1, arg2). 2021-12-16 Olivier Hainque <hainque@adacore.com> fixincludes/ * inclhack.def (vxworks_posix_mkdir): Refine to expose a varargs interface. * tests/base/sys/stat.h: Update expected results. * fixincl.x: Regenerate.
2022-01-01Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwinFrancois-Xavier Coudert1-0/+11
The darwin system headers error out on __FLT_EVAL_METHOD__ == 16, which occurs when the compiler is called with -mavx512fp16 on i386. Allow this value to proceed past the check (nothing else depends on it in the system headers). fixincludes/ChangeLog: * inclhack.def: Add new fix on darwin. * fixincl.x: Regenerate. * tests/base/math.h: Regenerate.
2021-08-30Fix libgfortran build on hppa*-hp-hpux[01]*John David Anglin1-0/+28
Add include hack to define PRIdPTR, PRIiPTR, PRIoPTR, PRIuPTR, PRIxPTR and PRIXPTR in inttypes.h. 2021-08-30 John David Anglin <danglin@gcc.gnu.org> fixincludes/ChangeLog: * inclhack.def (hpux_c99_inttypes5): New hack to define PRIdPTR, etc. * fixincl.x: Regenerate. * tests/base/inttypes.h: Update.
2021-07-06fixincludes: AIX socket.h.Clément Chigot1-3/+6
Add more context to aix_externcpp1 selection to ensure that the fix is correctly applied even in future AIX versions. fixincludes/Changelog: 2021-07-01 Clément Chigot <clement.chigot@atos.net> * inclhack.def (aix_externcpp1): Improve select regexp. * fixincl.x: Regenerate. * tests/base/sys/socket.h: Update.
2021-06-30fixinc: don't "fix" machine names in __has_include(...) [PR91085]Xi Ruoyao1-1/+2
fixincludes/ PR other/91085 * fixfixes.c (check_has_inc): New static function. (machine_name_fix): Don't replace header names in __has_include(...). * inclhack.def (machine_name): Adjust test. * tests/base/testing.h: Update.
2020-12-14aix: Fixinclude updates [PR98208]Ilya Leoshkevich1-1/+1
After 92648faa1cb2 ("aix: Fixinclude") make check-fixincludes began to fail (at least on gcc121 machine). Fix by updating fixincludes/tests and rerunning genfixes. Co-developed-by: Nathan Sidwell <nathan@acm.org> fixincludes/ChangeLog: 2020-12-11 Ilya Leoshkevich <iii@linux.ibm.com> * fixincl.x: Rerun genfixes. * inclhack.def(aix_physadr_t): Change test_text to something that needs to be replaced. * tests/base/sys/types.h(aix_physadr_t): Add expectation.
2020-11-18aix: FixincludeNathan Sidwell1-0/+14
This fixes an ODR violation in the AIX headers that is detected by C++ modules. While unnamed structs with typedef names for linkage purposes are accepted, this case is an anonymous struct without such a typedef name -- the typedef is attached to the pointer-to-struct type. Fixed by naming the struct. fixincludes/ * inclhack.def (aix_physaddr_t): New. * fixincl.x: Regenerated.
2020-10-03aix: apply aix_malloc more narrowly.Clément Chigot1-3/+9
In recent Technology Levels of AIX 7.2, new "#ifdef __cplusplus" have been added. Thus, the aix_malloc fix was applied in wrong locations. This patch increases the context to avoid this. fixincludes/ChangeLog: 2020-10-03 Clément Chigot <clement.chigot@atos.net> * inclhack.def (aix_malloc): Add more context to select. * fixincl.x: Regenerate. * tests/base/malloc.h: Update expected results.
2020-09-26aix: Fix _STDC_FORMAT_MACROS in inttypes.h [PR97044]David Edelsohn1-0/+13
AIX protects the STDC Format Macros in a manner that can prevent the definition of the macros depending on the order of header inclusion. The protection of the macros was referenced in C99, removed in C11, and never specified in any C++ standard. Also, the macros are in the namespace reserved to the implementation (compiler) so the compiler is permitted to choose to inject those names. fixincludes/ChangeLog: 2020-09-17 David Edelsohn <dje.gcc@gmail.com> PR target/97044 * inclhack.def (aix_inttypes): New fix. * fixincl.x: Regenerate. * tests/base/sys/inttypes.h: New file.
2020-09-17aix: apply socket.h extern "C++" more narrowly.David Edelsohn1-8/+12
Recent Technology Levels of AIX 7.2 have made sys/socket.h more C++-aware, which causes the fix to be applied in too many locations. This patch adds more context for the selection to apply the fix more narrowly. fixincludes/ChangeLog: 2020-09-17 David Edelsohn <dje.gcc@gmail.com> * inclhack.def (aix_externcpp1): Add more context to select. (aix_externcpp2): Same. * fixincl.x: Regenerate. * tests/base/sys/socket.h: Update expected results.
2020-01-25Fix missing SCNuMAX defines in inttypes.h on hpux11.[01]*John David Anglin1-0/+15
2020-01-25 John David Anglin <danglin@gcc.gnu.org> * inclhack.def (hpux_c99_inttypes4): New, add missing SCNuMAX defines. * fixincl.x: Regenerate. * tests/base/inttypes.h: Update for above fix.
2019-12-30re PR libgomp/93066 (libgomp/target.c:525:46: error: expected expression ↵John David Anglin1-0/+26
before ')' token) PR libgomp/93066 * inclhack.def (hpux_c99_inttypes3): Fix defines for INTPTR_MAX and UINTPTR_MAX, and missing define for SIZE_MAX. * fixincl.x: Regenerate. * tests/base/inttypes.h: Update for above fix. From-SVN: r279773
2019-08-18[Darwin, fixincludes] Fix PR83531C.G. Dogan1-0/+27
There is no reasonable chance that the SDKs in question will be re- issued, so the only viable solution is a fixincludes. 2019-08-18 C.G. Dogan <gcc+cgdogan.00@gmail.com> Iain Sandoe <iain@sandoe.co.uk> PR target/83531 * inclhack.def (darwin_api_availability): New, strip leading underscores from API_XXXX defines. * fixincl.x: Regenerate. * tests/base/os/availability.h: New file. Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk> From-SVN: r274624
2019-06-21[Darwin, fixincludes] Fix Darwin9/10 math.h issues.Iain Sandoe1-4/+20
Darwin has had long long functions for some considerable time and these are exposed in Darwin8 and Darwin11+ headers. However, for some reason it was elected to hide them behind __STRICT_ANSI__ and __STDC_VERSION__ on Darwin9 and Darwin10. This is a problem for G++/libstdc++ that expects the functions to be available for strict ansi (-std=c++14, for example) and without defining __STDC_VERSION__. The fix here follows the pattern used in Darwin11+ headers where the functions may be explicitly hidden by defining __DARWIN_NO_LONG_LONG. This fixes the tr1 testsuite fails seen on Darwin9 and 10. 2019-06-21 Iain Sandoe <iain@sandoe.co.uk> * inclhack.def: Replace the complex test using __STRICT_ANSI__ and __STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG. Ensure that the top level math.h uses <> to wrap included headers rather than "". * fixincl.x: Regenerated. * tests/base/architecture/ppc/math.h: Update test to include the __DARWIN_NO_LONG_LONG case. From-SVN: r272563
2019-06-21[Darwin, fixincludes] Fix Darwin14 header issues.Iain Sandoe1-0/+43
There are two issues with the Darwin14 (SDK) headers in which unguarded advanced syntax elements causes any code including these headers to fail. 2019-06-21 Iain Sandoe <iain@sandoe.co.uk> * inclhack.def: Guard __has_attribute and __has_extension in os/base.h. Guard Apple blocks syntax in dispatch/object.h. * fixincl.x: Regenerate. * tests/base/dispatch/object.h: New file. * tests/base/os/base.h: New file. From-SVN: r272561
2019-05-11fixincludes - fix PR90379Iain Sandoe1-1/+1
One should not provide test_text for wrap style fixes this was causing the test to fail. No change to the actual fix. 2019-05-11 Iain Sandoe <iain@sandoe.co.uk> PR target/90379 PR bootstrap/89864 * inclhack.def (darwin_ucred__Atomic): Do not supply test_text for wrap fixes. * fixincl.x: Regenerated. From-SVN: r271098
2019-04-18re PR bootstrap/89864 (gcc fails to build/bootstrap with XCode 10.2)Erik Schnetter1-0/+19
fix PR89864 2019-04-18 Erik Schnetter <schnetter@gmail.com> Jakub Jelinek <jakub@redhat.com> Iain Sandoe <iain@sandoe.co.uk> PR bootstrap/89864 * inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword use in headers included by C++. * fixincl.x: Regenerated. Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk> Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r270435
2018-10-16fixincludes: vxworks: regs.h: Fix includes in regs.h wrapperRasmus Villemoes1-0/+10
A quick experiment reveals that this hack is needed for C code - simply removing this hack entirely breaks the build of libstdc++, since regs.h (more accurately, the cpu-specific header it pulls in) defines structs in terms of types from vxTypesOld. Those definitions are properly guarded by #ifndef _ASMLANGUAGE, but the cpu-files do not take care to include vxTypesOld.h for the types they depend on. But when using regs.h from some assembly file, the assembler chokes on the typedefs in vxTypesOld.h. We can fix that by guarding the include of vxTypesOld by !_ASMLANGUAGE. This should not affect existing C code. Now, the OS' regs.h contains preprocessor conditionals such as #if CPU_FAMILY==I960 ... #endif /* CPU_FAMILY==I960 */ #if CPU_FAMILY==MC680X0 ... #endif /* CPU_FAMILY==MC680X0 */ Without definitions of CPU_FAMILY, I960 etc., these would all be true, which will not end well. Code using the fix-included regs.h automatically get vxCpu.h via a chain of includes from vxTypesOld.h, but we can make regs.h a little more self-contained for both C and asm users by doing an explicit include of vxCpu.h. From-SVN: r265187
2018-09-03fixincludes: vxworks: remove unnecessary parentheses in ioctl wrapper macroRasmus Villemoes1-1/+1
The rationale for the fixinclude ioctl macro wrapper is, as far as I can tell (https://gcc.gnu.org/ml/gcc-patches/2012-09/msg01619.html) Fix 2: Add hack for ioctl() on VxWorks. ioctl() is supposed to be variadic, but VxWorks only has a three argument version with the third argument of type int. This messes up when the third argument is not implicitly convertible to int. This adds a macro which wraps around ioctl() and explicitly casts the third argument to an int. This way, the most common use case of ioctl (with a const char * for the third argument) will compile in C++, where pointers must be explicitly casted to int. However, we have existing C++ code that calls the ioctl function via ::ioctl(foo, bar, baz) and obviously this breaks when it gets expanded to ::(ioctl)(foo, bar, (int)(baz)) Since the GNU C preprocessor already prevents recursive expansion of function-like macros, the parentheses around ioctl are unnecessary. Incidentally, there is also a macro sioIoctl() in the vxworks sioLib.h header that expands to ((pSioChan)->pDrvFuncs->ioctl (pSioChan, cmd, arg)) which also breaks when that gets further expanded to ((pSioChan)->pDrvFuncs->(ioctl) (pSioChan, cmd, (int)(arg))) This patch partly fixes that issue as well, but the third argument to the pDrvFuncs->ioctl method should be void*, so the cast to (int) is slightly annoying. Internally, we've simply patched the sioIoctl macro: (((pSioChan)->pDrvFuncs->ioctl) (pSioChan, cmd, arg)) From-SVN: r264056
2018-07-23inclhack.def (aix_unistd): New.David Edelsohn1-0/+14
* inclhack.def (aix_unistd): New. * fixincl.x: Regenerate. * tests/base/unistd.h [AIX_UNISTD_CHECK]: New test. From-SVN: r262936
2018-06-12inclhack.def: Fix fixup for assert.h on vxworks.Rasmus Villemoes1-4/+10
* inclhack.def: Fix fixup for assert.h on vxworks. * fixincl.x: Regenerate. From-SVN: r261499
2018-05-25* inclhack.def (vxworks_iolib_include_unistd): New fix.Rasmus Villemoes1-0/+16
From-SVN: r260763
2018-02-22inclhack.def (aix_stdlib_vec_malloc): New.David Edelsohn1-0/+20
* inclhack.def (aix_stdlib_vec_malloc): New. (aix_stdlib_vec_calloc): New. * fixincl.x: Regenerate. * tests/base/stdlib.h [AIX_STDLIB_VEC_MALLOC]: New test. [AIX_STDLIB_VEC_CALLOC]: New test. From-SVN: r257902
2017-06-12config.gcc (*-*-vxworks*): Set use_gcc_stdint to "provide".Doug Rupp1-116/+0
2017-06-12 Doug Rupp <rupp@adacore.com> gcc/ * config.gcc (*-*-vxworks*): Set use_gcc_stdint to "provide". Append vxworks-stdint.h to the tm_file list. * config/vxworks-stdint.h: New file. fixincludes/ * inclhack.def (AAB_vxworks_stdint): Remove hack. * fixincl.x: Regenerate. From-SVN: r249121
2017-02-25re PR target/68739 (FAIL: 30_threads/call_once/constexpr.cc (test for excess ↵John David Anglin1-3/+21
errors)) PR target/68739 * inclhack.def (hpux11_pthread_pointer): New fix. (hpux11_pthread_const): Adjust to remove void * cast from define. * fixincl.x: Regenerate. From-SVN: r245740
2017-02-11alloca.h: New file.John David Anglin1-0/+18
* tests/base/alloca.h: New file. * inclhack.def (hppa_hpux11_alloca): New fix. * fixincl.x: Regenerate. From-SVN: r245364
2017-01-13Only declare gets for C++ < 2014 on Solaris (PR libstdc++/78979)Rainer Orth1-0/+67
PR libstdc++/78979 * inclhack.def (solaris_gets_c11, solaris_gets_cxx14) (solaris_std_gets_cxx14, solaris_stdlib_noreturn): New fixes. * fixincl.x: Regenerate. * tests/base/iso/stdio_iso.h [SOLARIS_GETS_C11_CHECK, SOLARIS_GETS_CXX14_CHECK, SOLARIS_STD_GETS_CXX14_CHECK, SOLARIS_STDLIB_NORETURN_CHECK]: New tests. From-SVN: r244428
2016-11-21Don't define libstdc++-internal macros in Solaris 10+ <math.h>Rainer Orth1-1/+18
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
2016-11-20Fix libsanitizer build on OS X 10.1[01], macOS 10.12 (PR sanitizer/78267)Rainer Orth1-1/+82
fixincludes: PR sanitizer/78267 * inclhack.def (darwin_availabilityinternal, darwin_os_trace_1) (darwin_os_trace_2, darwin_os_trace_3): New fixes. (hpux_stdint_least_fast): Remove spurious _EOFix_. * fixincl.x: Regenerate. * tests/bases/AvailabilityInternal.h: New file. * tests/bases/os/trace.h: New file. 2016-11-20 Jack Howarth <howarth.at.gcc@gmail.com> libsanitizer: PR sanitizer/78267 * sanitizer_common/sanitizer_mac.cc: Include <os/trace.h> only if compiler supports blocks extension. From-SVN: r242633
2016-09-04inclhack.def (hpux_longjmp): Adjust select regular expression.John David Anglin1-1/+1
* inclhack.def (hpux_longjmp): Adjust select regular expression. * fixincl.x: Regenerate. From-SVN: r239976
2016-08-13inclhack.def (hpux_longjmp): New fix.John David Anglin1-0/+15
* inclhack.def (hpux_longjmp): New fix. * fixincl.x: Regenerate. * tests/base/setjmp.h: New test file. From-SVN: r239446