Message ID | 20211220212807.GA95195@adacore.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 690253858010 for <patchwork@sourceware.org>; Mon, 20 Dec 2021 21:28:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 690253858010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1640035720; bh=RRDFebr/d7fq9Fe+L8N9bkrLmlj/m6seBSe2vpt0/0k=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qeR9FoUIEO+b3tn2B7ASU0L4mEZNIGx7CAjVoj2Ls0N/QN/JhTWhM5rdU3dRKdCKV hMHYKmPaGzspnGH7Bj3f3eIfLirzo5L+7DCIEtv8S1XqOMafWWha2QZvj1oWv0RG19 gtXrq+IESVf4DGSk9a65v0kwQaWa97D5u+ScVzhE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id CED0B3858406 for <gcc-patches@gcc.gnu.org>; Mon, 20 Dec 2021 21:28:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CED0B3858406 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 78A5A11634E; Mon, 20 Dec 2021 16:28:07 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jQqw5nhBGA4w; Mon, 20 Dec 2021 16:28:07 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 504011162E0; Mon, 20 Dec 2021 16:28:07 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4216) id 497934AE; Mon, 20 Dec 2021 16:28:07 -0500 (EST) Date: Mon, 20 Dec 2021 16:28:07 -0500 To: gcc-patches@gcc.gnu.org Subject: [PATCH] Register --sysroot in the driver switches table Message-ID: <20211220212807.GA95195@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Olivier Hainque via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Olivier Hainque <hainque@adacore.com> Cc: rv@rasmusvillemoes.dk Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Register --sysroot in the driver switches table
|
|
Commit Message
Olivier Hainque
Dec. 20, 2021, 9:28 p.m. UTC
Hello, This change adjusts the processing of --sysroot to save the option in the internal "switches" array, which lets self-specs test for it and provide a default value possibly dependent on environment variables, as in --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)} This helps the use we have of self specs for VxWorks, and was bootstrapped and regression tested on native 64bit linux. Ok to commit ? Thanks in advance, With Kind Regards, Olivier
Comments
On 12/20/2021 2:28 PM, Olivier Hainque via Gcc-patches wrote: > Hello, > > This change adjusts the processing of --sysroot to save the option in the > internal "switches" array, which lets self-specs test for it and provide a > default value possibly dependent on environment variables, as in > > --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)} > > This helps the use we have of self specs for VxWorks, and > was bootstrapped and regression tested on native 64bit linux. > > Ok to commit ? > > Thanks in advance, > > With Kind Regards, > > Olivier > > > 0001-Register-sysroot-in-the-driver-switches-table.patch > > From 964829ee06ffe1bedcbab6a3b4c92c5d161aaaed Mon Sep 17 00:00:00 2001 > From: Olivier Hainque <hainque@adacore.com> > Date: Mon, 20 Dec 2021 17:47:24 +0000 > Subject: [PATCH] Register --sysroot in the driver switches table > > This change adjusts the processing of --sysroot to save the option in the > internal "switches" array, which lets self-specs test for it and provide a > default value possibly dependent on environment variables, as in > > --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)} > > 2021-12-20 Olivier Hainque <hainque@adacore.com> > > gcc/ > * gcc.c (driver_handle_option): do_save --sysroot. OK. jeff
> On 28 Dec 2021, at 17:38, Jeff Law <jeffreyalaw@gmail.com> wrote: >> gcc/ >> * gcc.c (driver_handle_option): do_save --sysroot. > OK. Thanks for the prompt review Jeff! I have another simple one coming :)
On 12/20/21 22:28, Olivier Hainque via Gcc-patches wrote: > Hello, > > This change adjusts the processing of --sysroot to save the option in the > internal "switches" array, which lets self-specs test for it and provide a > default value possibly dependent on environment variables, as in > > --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)} > > This helps the use we have of self specs for VxWorks, and > was bootstrapped and regression tested on native 64bit linux. > > Ok to commit ? > > Thanks in advance, > > With Kind Regards, > > Olivier > Hello. I think the patch broke my cross-rx-gcc12 package, failing now with: [ 162s] checking for rx-elf-gcc... /home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/./gcc/ -B/usr/rx-elf/bin/ -B/usr/rx-elf/lib/ -isystem /usr/rx-elf/include -isystem /usr/rx-elf/sys-include --sysroot=/usr/rx-elf/sys-root [ 162s] checking for suffix of object files... configure: error: in `/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/rx-elf/libgcc': [ 162s] configure: error: cannot compute suffix of object files: cannot compile [ 162s] See `config.log' for more details [ 162s] make[1]: *** [Makefile:12902: configure-target-libgcc] Error 1 [ 162s] make[1]: *** Waiting for unfinished jobs.... [ 162s] g++ -static-libstdc++ -static-libgcc -o g++-mapper-server server.o resolver.o ../libcody/libcody.a ../libiberty/libiberty.a [ 162s] /usr/bin/install -c g++-mapper-server ../gcc/g++-mapper-server [ 162s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/c++tools' [ 162s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux' [ 162s] make: *** [Makefile:1027: all] Error 2 [ 162s] error: Bad exit status from /var/tmp/rpm-tmp.wDOIGP (%build) configure:3566: /home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/./gcc/ -B/usr/rx-elf/bin/ -B/usr/rx-elf/lib/ -isystem /usr/rx-elf/include -isystem /usr/rx-elf/sys-include --sysroot=/usr/rx-elf/sys-root -o conftest -g -O2 conftest.c >&5 xgcc: error: unrecognized command-line option '--sysroot=/usr/rx-elf/sys-root' configure:3569: $? = 1 The compiler is configured with: [ 21s] + ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++ --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/12 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ '--with-pkgversion=SUSE Linux' --with-slibdir=/usr/rx-elf/sys-root/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-12 --program-prefix=rx-elf- --target=rx-elf --disable-nls --with-sysroot=/usr/rx-elf/sys-root --with-build-sysroot=/usr/rx-elf/sys-root --with-build-time-tools=/usr/rx-elf/bin --with-newlib --disable-libsanitizer --build=x86_64-suse-linux --host=x86_64-suse-linux Can you please take a look? Cheers, Martin
Hi Martin, > On 5 Jan 2022, at 08:45, Martin Liška <mliska@suse.cz> wrote: > > On 12/20/21 22:28, Olivier Hainque via Gcc-patches wrote: > I think the patch broke my cross-rx-gcc12 package, failing now with: > configure: error: in `/home/abuild/rpmbuild/BUILD/gcc-12.0.0+git190624/obj-x86_64-suse-linux/rx-elf/libgcc': > xgcc: error: unrecognized command-line option '--sysroot=/usr/rx-elf/sys-root' > > The compiler is configured with: > > [ 21s] + ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++ --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/12 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ '--with-pkgversion=SUSE Linux' --with-slibdir=/usr/rx-elf/sys-root/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-12 --program-prefix=rx-elf- --target=rx-elf --disable-nls --with-sysroot=/usr/rx-elf/sys-root --with-build-sysroot=/usr/rx-elf/sys-root --with-build-time-tools=/usr/rx-elf/bin --with-newlib --disable-libsanitizer --build=x86_64-suse-linux --host=x86_64-suse-linux > > Can you please take a look? Sure. Thanks for reporting the failure. Sorry for the breakage. The change should also set "validated" true when requesting to save --sysroot. I'm not sure why we don't see the problem with our vxworks setup - double checked again this morning, we do have successful builds passing --sysroot to the driver when configuring various libraries. Testing the patch further ...
> On 5 Jan 2022, at 10:26, Olivier Hainque <hainque@adacore.com> wrote: > > The change should also set "validated" true > when requesting to save --sysroot. The attached adjustment fixes the failure I could reproduce, bootstraps and regtests fine on x86_64-linux, and passes a build + a couple of in-house testsuites for one of our vxworks ports. Ok to commit? Thanks in advance, Olivier 2022-01-05 Olivier Hainque <hainque@adacore.com> * gcc.c (driver_handle_option): State --sysroot as validated.
On Wed, Jan 5, 2022 at 6:58 PM Olivier Hainque via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > > > On 5 Jan 2022, at 10:26, Olivier Hainque <hainque@adacore.com> wrote: > > > > The change should also set "validated" true > > when requesting to save --sysroot. > > The attached adjustment fixes the failure I could reproduce, > bootstraps and regtests fine on x86_64-linux, and passes a build > + a couple of in-house testsuites for one of our vxworks ports. > > Ok to commit? OK. Thanks, Richard. > Thanks in advance, > > Olivier > > 2022-01-05 Olivier Hainque <hainque@adacore.com> > > * gcc.c (driver_handle_option): State --sysroot as > validated. >
> On 10 Jan 2022, at 09:00, Richard Biener <richard.guenther@gmail.com> wrote: > > On Wed, Jan 5, 2022 at 6:58 PM Olivier Hainque via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: >> >> >> >>> On 5 Jan 2022, at 10:26, Olivier Hainque <hainque@adacore.com> wrote: >>> >>> The change should also set "validated" true >>> when requesting to save --sysroot. >> >> The attached adjustment fixes the failure I could reproduce, >> bootstraps and regtests fine on x86_64-linux, and passes a build >> + a couple of in-house testsuites for one of our vxworks ports. >> >> Ok to commit? > > OK. Great, thanks Richard :)
From 964829ee06ffe1bedcbab6a3b4c92c5d161aaaed Mon Sep 17 00:00:00 2001 From: Olivier Hainque <hainque@adacore.com> Date: Mon, 20 Dec 2021 17:47:24 +0000 Subject: [PATCH] Register --sysroot in the driver switches table This change adjusts the processing of --sysroot to save the option in the internal "switches" array, which lets self-specs test for it and provide a default value possibly dependent on environment variables, as in --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)} 2021-12-20 Olivier Hainque <hainque@adacore.com> gcc/ * gcc.c (driver_handle_option): do_save --sysroot. --- gcc/gcc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/gcc.c b/gcc/gcc.c index b75b50b87b2..beb37fe980e 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -4488,7 +4488,9 @@ driver_handle_option (struct gcc_options *opts, case OPT__sysroot_: target_system_root = arg; target_system_root_changed = 1; - do_save = false; + /* Saving this option is useful to let self-specs decide to + provide a default one. */ + do_save = true; break; case OPT_time_: -- 2.25.1