From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: gcc-patches@gcc.gnu.org
Cc: Bruce Korb <bkorb@gnu.org>
Subject: [COMMITTED] fixincludes: Bypass solaris_math_12 on newer Solaris 11.4
Date: Fri, 17 Feb 2023 13:49:42 +0100 [thread overview]
Message-ID: <yddv8k0xxqx.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]
Solaris 11 <math.h> long had this snippet
#if __cplusplus >= 201103L
#undef _GLIBCXX_USE_C99_MATH
#undef _GLIBCXX_USE_C99_MATH_TR1
#endif
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 */
#if (__cplusplus >= 201103L) && \
((__SUNPRO_CC == 0x5130) || (__SUNPRO_CC == 0x5140) || \
defined(__MATH_PREEMPTS_GLIBCXX_C99_MATH))
#ifdef _GLIBCXX_USE_C99_MATH
#undef _GLIBCXX_USE_C99_MATH
#endif
#ifdef _GLIBCXX_USE_C99_MATH_TR1
#undef _GLIBCXX_USE_C99_MATH_TR1
#endif
#endif
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).
Committed to trunk. I may backport to the gcc-11 and gcc-12 branches,
too.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2022-11-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
fixincludes:
* inclhack.def (solaris_math_12): Add bypass.
* fixincl.x: Regenerate.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-fixincludes-math_12-bypass.patch --]
[-- Type: text/x-patch, Size: 564 bytes --]
# HG changeset patch
# Parent 76f1a1965f9296be97f6edc2b9610d6600036de1
fixincludes: Bypass solaris_math_12 on newer Solaris 11.4
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -4306,6 +4306,7 @@ fix = {
files = math.h;
mach = '*-*-solaris2*';
select = '#undef.*_GLIBCXX_USE_C99_MATH';
+ bypass = '__MATH_PREEMPTS_GLIBCXX_C99_MATH';
sed = "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d";
test_text = << _EOText_
#if __cplusplus >= 201103L
reply other threads:[~2023-02-17 12:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yddv8k0xxqx.fsf@CeBiTec.Uni-Bielefeld.DE \
--to=ro@cebitec.uni-bielefeld.de \
--cc=bkorb@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).