From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 9F512385041B for ; Tue, 13 Oct 2020 13:35:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9F512385041B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hainque@adacore.com Received: by mail-wm1-x331.google.com with SMTP id j136so21796714wmj.2 for ; Tue, 13 Oct 2020 06:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=XhNQbo3OuHbbqlMsNeUiHODB9qF/u4K9c6UKmpkLwg8=; b=0cDtwFRd3ehRCGf8IpNsxV/jOt50JzoRFTFtFqFKlcBaiFhrp8m4qREHBrjG33j0cW INEEviV7OzoCl7s2AKz1MIZNr8LrxPp1eijw+3QQE67aSvCcOX4DfeROVgx4nzTI12t9 xYxONllyTojGiFeZfvz96lrQeRz9TMJzkITt4SuLa64jr38Tz8J89YRfFZM0KQgZ4eAx Qq/ueV370btd+u9ncz4RSjzn+ePd/BLA41xmfBHuqbgWikCt0tnYElO2Jv7DyxIRCOs1 D5wrqoLvqbgHOPdMYJlQyeDmlMmbM/jFOqXxpVaGoki5STmGgbfMbGN3J08Lw9QkYF+2 Ziog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=XhNQbo3OuHbbqlMsNeUiHODB9qF/u4K9c6UKmpkLwg8=; b=epArLrfaJPpdJCAeZ6FTIDkftoEDg+97P6fcJayja/fggSbonI/VaT+4NXn8SruaIU GULutSF1QCDnX/hWMVDrG0LpR1oL0w+BiPqbiIrdxnjxE5NjAxJTaA6WDZMVqaa58i2e kkK9u3qrrxrOm5WyImX7CsbBRX4JJ9OyNe/HoL6bqMiTZhhfDh1zsUsx+qEm3k5W5fuo 8P6BlCAxMrGXAkc2jSa/OMEaFQqEu3zEE1RVoruc9yUsCIEWG9GA3hiRwVxcbPAepgsx d4ND64lprypJK5YnZpY6AVOfQeAKTqi9LQ3RpZovXccyG2LhzJ0rwXZg8zbtFVbiM4Cg bUmQ== X-Gm-Message-State: AOAM532ZJ3rOLI/+CM21gwjpYGpklRcaimT4O1mmL3fdOy/hzb6Ysd0B Ot8zDYlqaE+IrK3rT+uIEvBmwA== X-Google-Smtp-Source: ABdhPJwJIpgc0Dc5cYZ0lCgrZkkgtDcQpY2QwesXId2WtE28w+wOv8wH7ruMLFVA04E9HH3KxaEVrA== X-Received: by 2002:a7b:cf04:: with SMTP id l4mr15871737wmg.33.1602596112471; Tue, 13 Oct 2020 06:35:12 -0700 (PDT) Received: from ?IPv6:2a02:2ab8:224:1:4d29:96e6:feb5:9a4? ([2a02:2ab8:224:1:4d29:96e6:feb5:9a4]) by smtp.gmail.com with ESMTPSA id w11sm28478890wrs.26.2020.10.13.06.35.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 06:35:12 -0700 (PDT) From: Olivier Hainque Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_017BD851-1581-4A93-A5AA-A6B7425CA6BE" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [patch] Rework CPP_BUILTINS_SPEC for powerpc-vxworks Date: Tue, 13 Oct 2020 15:35:11 +0200 In-Reply-To: Cc: Olivier Hainque , GCC Patches , Rasmus Villemoes To: Segher Boessenkool References: <20201002224319.GY28786@gate.crashing.org> X-Mailer: Apple Mail (2.3445.9.1) X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , X-List-Received-Date: Tue, 13 Oct 2020 13:35:15 -0000 --Apple-Mail=_017BD851-1581-4A93-A5AA-A6B7425CA6BE Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hi Segher, > On 5 Oct 2020, at 19:27, Olivier Hainque wrote: > > I'll post an updated version, thanks for the comments. Here's an updated version which passed in-house build & tests with gcc-10 based toolchains for VxWorks 6.9 & 7.2, and with which I could build mainline for VxWorks 6.9 including libstdc++ (combined with a few other patches, orthogonal to what is proposed here and which I'll post shortly). Same ChangeLog. Patch hopefully quotable if needed now. Olivier 2020-10-13 Olivier Hainque * config/rs6000/vxworks.h (TARGET_OS_CPP_BUILTINS): Accommodate expectations from different versions of VxWorks, for 32 or 64bit configurations. --Apple-Mail=_017BD851-1581-4A93-A5AA-A6B7425CA6BE Content-Disposition: attachment; filename=ppc_vxworks_cpp_builtins.txt Content-Type: text/plain; x-unix-mode=0640; name="ppc_vxworks_cpp_builtins.txt" Content-Transfer-Encoding: 7bit diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h index 771dddf68bba..60e1ef42390f 100644 --- a/gcc/config/rs6000/vxworks.h +++ b/gcc/config/rs6000/vxworks.h @@ -29,17 +29,60 @@ along with GCC; see the file COPYING3. If not see #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__ppc"); \ - builtin_define ("__PPC__"); \ - builtin_define ("__EABI__"); \ builtin_define ("__ELF__"); \ + if (!TARGET_VXWORKS7) \ + builtin_define ("__EABI__"); \ + \ + /* CPU macros, based on what the system compilers do. */ \ + if (!TARGET_VXWORKS7) \ + { \ + builtin_define ("__ppc"); \ + /* Namespace violation below, but the system headers \ + really depend heavily on this. */ \ + builtin_define ("CPU_FAMILY=PPC"); \ + \ + /* __PPC__ isn't actually emitted by the system compiler \ + prior to vx7 but has been advertised by us for ages. */ \ + builtin_define ("__PPC__"); \ + } \ + else \ + { \ + builtin_define ("__PPC__"); \ + builtin_define ("__powerpc__"); \ + if (TARGET_64BIT) \ + { \ + builtin_define ("__PPC64__"); \ + builtin_define ("__powerpc64__"); \ + } \ + else \ + { \ + builtin_define ("__PPC"); \ + builtin_define ("__powerpc"); \ + } \ + } \ + \ + /* Asserts for #cpu and #machine. */ \ + if (TARGET_64BIT) \ + { \ + builtin_assert ("cpu=powerpc64"); \ + builtin_assert ("machine=powerpc64"); \ + } \ + else \ + { \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + \ + /* PowerPC VxWorks specificities. */ \ if (!TARGET_SOFT_FLOAT) \ - builtin_define ("__hardfp"); \ + { \ + builtin_define ("__hardfp"); \ + builtin_define ("_WRS_HARDWARE_FP"); \ + } \ \ - /* C89 namespace violation! */ \ - builtin_define ("CPU_FAMILY=PPC"); \ - \ + /* Common VxWorks and port items. */ \ VXWORKS_OS_CPP_BUILTINS (); \ + TARGET_OS_SYSV_CPP_BUILTINS (); \ } \ while (0) --Apple-Mail=_017BD851-1581-4A93-A5AA-A6B7425CA6BE--