From patchwork Fri Feb 17 12:49:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 1744223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=CeBiTec.Uni-Bielefeld.DE header.i=@CeBiTec.Uni-Bielefeld.DE header.a=rsa-sha256 header.s=20200306 header.b=Q2SdmVMo; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PJBVP6MCqz23j7 for ; Fri, 17 Feb 2023 23:50:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B231384F033 for ; Fri, 17 Feb 2023 12:49:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 915583858C31 for ; Fri, 17 Feb 2023 12:49:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 915583858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 335B2B924B; Fri, 17 Feb 2023 13:49:44 +0100 (CET) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7gF9kSelPQ4u; Fri, 17 Feb 2023 13:49:43 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5085574e.dip0.t-ipconnect.de [80.133.87.78]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 9B5B2B9803; Fri, 17 Feb 2023 13:49:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1676638183; bh=6+DP1M2yXFQomqX9MOeTXkpN4a3r1MHriqtZQXZv/Go=; h=From:To:Cc:Subject:Date:From; b=Q2SdmVMoPxX41+2ZiPnWrp5BNLVvaGyPVNzwDkU6pr8/000iX9+LVagYSzDbXwH7K RYqCluyZhDJScKH+pni5FpadTVrP6T1H/wSu82nY6F3ZpRraJVmNknKcgoi1G6x9Ji ldLWgUaR/QOMSdyreZyPA3K6h0ljXApTWlN8j/K/yJu2EHsrCaynp5/YZUJQADkvC+ Flbf2pOxRIjb+fmSEEskWtRLXo0UPATvqB523f5ELehUyySVR9dpnYgx8SQ06zKHPE TLzhIVMMdyLxU8ZcbNZ43IHr3Fbq739HjjliquSnuXFS8NY20QSYnwoEOun0jDpPCB Ye7OJ1Ui5lz2A== From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Bruce Korb Subject: [COMMITTED] fixincludes: Bypass solaris_math_12 on newer Solaris 11.4 Date: Fri, 17 Feb 2023 13:49:42 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3795.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Solaris 11 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+ 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 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 # 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