From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 7503D3858D28 for ; Fri, 7 Oct 2022 16:55:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7503D3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32e.google.com with SMTP id n35-20020a05600c502300b003b4924c6868so4709483wmr.1 for ; Fri, 07 Oct 2022 09:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=IDVOLPv20H/9oAqDY00MaBmmiIEqlN3zPmpKhkX6o5k=; b=bJuuAglIHu9itBXw9H8MW95Erl7LAXHKv7qZrv0XjuRZpLxUBLJ7xaLiQbCFYVh8TI XfkVs+HTh5yfo98P5nflwwyIxlWVCXzEy/UZ4vuwXGaf0CLjkeIy7yKiG8WGz9kT0Mww K4fjy08gV7reGmQhzRxU6vwCnk2NZ5Bh9FJrV49d9r+nnyOZotwQu279ryCGAeGWvQ7v 4uIgJRIxsOqHz4ksWz99QU7qkZwS1uVGyrrRj5grs+wdXYWbUz+YCwrct+rviMBXdvzM vfZiV4CNa78bs2+gRGANppkRpUaCFgqQoNj958/5E9gEc9i65Tdzg9cI+ck2rQuvGGLS YHnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IDVOLPv20H/9oAqDY00MaBmmiIEqlN3zPmpKhkX6o5k=; b=hQYOL/eqC7T7OcIl3hrO7Bssn9xuG0xy+6+Sg/zln6/kt2wNzxtM18ionPhMd/eYom d+aFveVzM6FN0xv5SBRt5D8+ass6EHFhAdjX/gpkxeQ1AUQoTN9aucybE0kjwBvRcDwu RnBfBwNftROYjwgvV+JtrRVhAJ2W5k9cjFFnGuD22kndAQnGeA5ClO20ew3P848KuIww W4Za12lQd0Qyg3lSxUoIJwP60jP1W1QLEF6MQlWREUzuMaybi9bwxK+0hgMJihtWb8YD iChppgdvQP3REBE+Ca61D2FaUA5anPbAXkLliiBGqRqTyTLqgrwcQaECtx+21XfhMpSR q9PA== X-Gm-Message-State: ACrzQf0gc0HEF8IXfdPenAr3gb/pt8Bal/vtU7aB1a9vvlh1eH6stAJi RXS1BjQ1YJ3ZHj0R8qzIUnTARaZos5At5A== X-Google-Smtp-Source: AMsMyM4BcTgD5V39ZNOBsBR8xGC9BDOV5J5/ZM+QJxcN/4R9vpsaJBHBR5MDUKBJqCFeGKCt99j0vw== X-Received: by 2002:a7b:c84f:0:b0:3b4:84c1:1e7 with SMTP id c15-20020a7bc84f000000b003b484c101e7mr11233336wml.12.1665161748770; Fri, 07 Oct 2022 09:55:48 -0700 (PDT) Received: from smtpclient.apple ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id j38-20020a05600c1c2600b003b3365b38f9sm1942120wms.10.2022.10.07.09.55.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 09:55:47 -0700 (PDT) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_7EC50566-CCE0-4C99-9F46-7DFCCC6DABAF" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: [patch] specialize paths to version.h in _vxworks-versions.h Message-Id: <76F9E089-76BF-4895-9014-385E370D37AA@adacore.com> Date: Fri, 7 Oct 2022 18:55:47 +0200 Cc: Olivier Hainque To: gcc-patches X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: --Apple-Mail=_7EC50566-CCE0-4C99-9F46-7DFCCC6DABAF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii The _vxworks-versions.h runtime file helps us control the compilation of some library components depending on the OS version extracted out of a system header. The system header name is "version.h", and gcc has a "version.h" file of its own. gcc's version.h is now generated and the current #include from _vxworks-versions.h gets the gcc instance instead of the OS one, resulting in build failures from #if !defined(_WRS_VXWORKS_MAJOR) #error "_WRS_VXWORKS_MAJOR undefined" #endif This change introduces a twist in the way _vxworks-versions.h #includes version.h, using a relative path with components that will match in the OS include dirs only. The actual relative path is conditioned on _VSB_CONFIG_FILE to accommodate a change in the include dirs organisation between VxWorks 6 and 7. With this, our gcc-12 based builds now pass for both powerpc-vx6 and a few cpu families with vxworks7, and a a sanity check build with mainline also passes for ppc64-vxworks7. Will commit to mainline shortly, Cheers, Olivier --Apple-Mail=_7EC50566-CCE0-4C99-9F46-7DFCCC6DABAF Content-Disposition: attachment; filename=0001-Specialize-paths-to-version.h-in-_vxworks-versions.h.patch Content-Type: application/octet-stream; x-unix-mode=0640; name="0001-Specialize-paths-to-version.h-in-_vxworks-versions.h.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ce304abca4fbce6b636a19c1c9254f68d033bc58=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Olivier=20Hainque=20=0A= Date:=20Fri,=207=20Oct=202022=2010:12:26=20+0000=0ASubject:=20[PATCH]=20= Specialize=20paths=20to=20version.h=20in=20_vxworks-versions.h=0A=0AThe=20= _vxworks-versions.h=20runtime=20file=20helps=20us=20control=0Athe=20= compilation=20of=20some=20library=20components=20depending=20on=0Athe=20= OS=20version=20extracted=20out=20of=20a=20system=20header.=0A=0AThe=20= system=20header=20name=20is=20"version.h",=20and=20gcc=20has=20a=0A= "version.h"=20file=20of=20its=20own.=0A=0Agcc's=20version.h=20is=20now=20= generated=20and=20the=20current=0Ainstance=20instead=20of=20the=20OS=20= one,=20resulting=20in=20build=20failures=0Afrom=0A=0A=20=20#if=20= !defined(_WRS_VXWORKS_MAJOR)=0A=20=20#error=20"_WRS_VXWORKS_MAJOR=20= undefined"=0A=20=20#endif=0A=0AThis=20change=20introduces=20a=20twist=20= in=20the=20way=0A_vxworks-versions.h=20#includes=20version.h,=20using=20= a=20relative=0Apath=20with=20components=20that=20will=20match=20in=20the=20= OS=20include=0Adirs=20only.=0A=0AThe=20actual=20relative=20path=20is=20= conditioned=20on=20_VSB_CONFIG_FILE=0Ato=20accommodate=20a=20change=20in=20= the=20include=20dirs=20organisation=20between=0AVxWorks=206=20and=207.=0A= =0A2022-10-07=20=20Olivier=20Hainque=20=20=0A=0A= gcc/=0A=09*=20config/vxworks/_vxworks-version.h:=20Use=20OS=20specific=0A= =09paths=20in=20#include=20of=20version.h.=0A---=0A=20= gcc/config/vxworks/_vxworks-versions.h=20|=2019=20++++++++++++++-----=0A=20= 1=20file=20changed,=2014=20insertions(+),=205=20deletions(-)=0A=0Adiff=20= --git=20a/gcc/config/vxworks/_vxworks-versions.h=20= b/gcc/config/vxworks/_vxworks-versions.h=0Aindex=20= 15e8bfeb4a6..994dda90643=20100644=0A---=20= a/gcc/config/vxworks/_vxworks-versions.h=0A+++=20= b/gcc/config/vxworks/_vxworks-versions.h=0A@@=20-23,15=20+23,24=20@@=20= see=20the=20files=20COPYING3=20and=20COPYING.RUNTIME=20respectively.=20=20= If=20not,=20see=0A=20#define=20_VXWORKS_VERSIONS_H=20=201=0A=20=0A=20/*=20= All=20we=20need=20is=20access=20to=20the=20bare=20= _WRS_VXWORKS_MAJOR/MINOR=20macros,=0A-=20=20=20exposed=20by=20version.h=20= or=20already=20provided=20somehow=20(e.g.=20with=20a=20self=0A-=20=20=20= spec=20for=20some=20reason).=20=20When=20resorting=20to=20system=20= headers,=20cheat=20a=0A-=20=20=20bit=20to=20make=20sure=20we=20don't=20= drag=20additional=20header=20files,=20which=20can=0A-=20=20=20easily=20= cause=20#include=20ordering=20nightmares.=20=20*/=0A+=20=20=20exposed=20= by=20version.h=20or=20already=20provided=20somehow=20(e.g.=20with=20a=20= self=20spec=0A+=20=20=20for=20some=20reason).=20=20When=20resorting=20to=20= system=20headers,=20use=20typical=20os=0A+=20=20=20paths=20to=20prevent=20= possible=20confusion=20with=20a=20gcc=20version=20of=20version.h=0A+=20=20= =20visible=20during=20the=20build=20and=20temporarily=20#undef=20= _WRS_KERNEL=20to=20prevent=0A+=20=20=20indirect=20inclusion=20of=20= internal=20header=20files,=20which=20can=20easily=20cause=0A+=20=20=20= #include=20ordering=20nightmares.=20=20*/=0A=20=0A=20#if=20= !defined(_WRS_VXWORKS_MAJOR)=0A+=0A+#if=20defined(_VSB_CONFIG_FILE)=0A= +#define=20_VXWORKS_VERSION_H=20<../public/version.h>=0A+#else=0A= +#define=20_VXWORKS_VERSION_H=20<../h/version.h>=0A+#endif=0A+=0A=20= #pragma=20push_macro("_WRS_KERNEL")=0A=20#undef=20_WRS_KERNEL=0A= -#include=20=0A+#include=20_VXWORKS_VERSION_H=0A=20#pragma=20= pop_macro("_WRS_KERNEL")=0A=20#endif=0A=20=0A--=20=0A2.25.1=0A=0A= --Apple-Mail=_7EC50566-CCE0-4C99-9F46-7DFCCC6DABAF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_7EC50566-CCE0-4C99-9F46-7DFCCC6DABAF--