From patchwork Fri Dec 13 16:59:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Hainque X-Patchwork-Id: 1209300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515912-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VIwRtXRD"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ZH2n4RZjz9sPL for ; Sat, 14 Dec 2019 03:59:43 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; q=dns; s=default; b=qW6FAe+FP0b4hn/6BQ4WzUzdDs4Tff5KA6mQsGNBCa6Y72j6R4 y4eP+GWXKI2/lOVIGjkZcai60qoGgIz3U5k2oCl/AUFtowsml8AYBgxrtzyuu5BL 3efPHAt8alnTk1C9+BhMerhZepAbJegXofnpzlJ1dWJM7Y+OCjCQOGs9E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; s= default; bh=AtjBR3QzAEPufhQ51g2O2nxBQH8=; b=VIwRtXRDb4+70Eb9yYHE qupz45DwyAY/NkjVD9cuFJCTpWez7yCcSmPE/zNmmTr81YkWTfuO0PMGbQbvQY1h zctXFWUJK/Qu4M47ew0gv3grAV2Mfaz6Xwnzn2rQ7QUhKYnCqe3sWwi9v4QyhpiZ 5fWfFlon4WTXuGlUyUQz30k= Received: (qmail 121197 invoked by alias); 13 Dec 2019 16:59:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 121176 invoked by uid 89); 13 Dec 2019 16:59:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=unpleasant X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2019 16:59:31 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 309EC8139C; Fri, 13 Dec 2019 17:59:29 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JHng5DEQP17; Fri, 13 Dec 2019 17:59:29 +0100 (CET) Received: from [IPv6:2a02:2ab8:224:100::1002] (unknown [IPv6:2a02:2ab8:224:100::1002]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 3FC6581396; Fri, 13 Dec 2019 17:59:27 +0100 (CET) From: Olivier Hainque Subject: [patch] Arrange to preinclude yvals.h ahead of stdint on VxWorks 7 Date: Fri, 13 Dec 2019 17:59:26 +0100 Message-Id: Cc: Olivier Hainque , Joel Brobecker To: GCC Patches Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) On Vxworks 7, includers of stdint.h (which we currently "provide") need yvals.h to have been included ahead. Instead of altering the common stdint-gcc.h with unpleasant vxworks specific bits to do that, we arrange to provide stdint-gcc.h on its own along with a stdint.h wrapper which preincludes yvals.h on vx7 then includes stdint-gcc.h. Tested in accordance with the description in https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00911.html Committing soon to mainline. Olivier 2019-12-13 Olivier Hainque * config/vxworks/stdint.h: New file. Include _yvals.h then stdint-gcc.h. * config/t-vxworks: Arrange to install the stdint.h wrapper. * config.gcc (*-*-vxworks*): Add stdint-gcc.h to $extra_headers so it gets copied. Set use_gcc_stdint to request _not_ crafting stdint.h through the common Makefile rules. gcc/config.gcc | 14 +++++++++++--- gcc/config/t-vxworks | 12 ++++++++++++ gcc/config/vxworks/stdint.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 gcc/config/vxworks/stdint.h diff --git a/gcc/config.gcc b/gcc/config.gcc index 4790247a868..ca485af9619 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -962,9 +962,6 @@ case ${target} in extra_headers="${extra_headers} ../vxworks/vxworks-predef.h" target_has_targetcm="yes" - use_gcc_stdint=provide - tm_file="${tm_file} vxworks-stdint.h" - # This private header exposes a consistent interface for checks on # the VxWorks version our runtime header files need to perform, based on # what the system headers adverstise: @@ -982,6 +979,17 @@ case ${target} in extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h" extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h" + # We provide stdint.h ... + + tm_file="${tm_file} vxworks-stdint.h" + + # .. only through the yvals conditional wrapping mentioned above + # to abide by the VxWorks 7 expectations. The final copy is performed + # explicitly by a t-vxworks Makefile rule. + + use_gcc_stdint=none + extra_headers="${extra_headers} ../../ginclude/stdint-gcc.h" + case ${enable_threads} in no) ;; "" | yes | vxworks) thread_file='vxworks' ;; diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks index ce30338ed13..4f9646dd961 100644 --- a/gcc/config/t-vxworks +++ b/gcc/config/t-vxworks @@ -24,6 +24,18 @@ vxworks-c.o: $(srcdir)/config/vxworks-c.c $(COMPILE) $< $(POSTCOMPILE) +# Arrange to install our stdint.h wrapper, by copying it in the +# build-time include dir before this include dir is installed and after +# stmp-int-hdrs removes it (because it was told we don't provide it). + +INSTALL_HEADERS += install-stdint.h + +install-stdint.h: stmp-int-hdrs + cp -p $(srcdir)/config/vxworks/stdint.h include/stdint.h + chmod a+r include/stdint.h + +$(INSTALL_HEADERS_DIR): install-stdint.h + # Both the kernel and RTP headers provide limits.h. They embed VxWorks # specificities and are dated on some configurations so we both need to # provide our own version and make sure the system one gets exposed. diff --git a/gcc/config/vxworks/stdint.h b/gcc/config/vxworks/stdint.h new file mode 100644 index 00000000000..5e0dbdfaabd --- /dev/null +++ b/gcc/config/vxworks/stdint.h @@ -0,0 +1,28 @@ +/* This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +#ifndef __GCC_STDINT_H +#define __GCC_STDINT_H + +#include <_yvals.h> +#include + +#endif