On 6/24/22 01:23, Alexandre Oliva via Gcc-patches wrote:
On Jun 23, 2022, Alexandre Oliva <ol...@adacore.com> wrote:

Here's the patch.  Regstrapped on x86_64-linux-gnu, also tested with a
cross to aarch64-rtems6.  Ok to install?

Introduce -nostdlib++ option

Uhh, I went ahead and installed this.  The earlier patch was approved if
nobody objected, and so, having overcome the objection to the option
spelling, it ended up in my "approved" patchset.

In case there are objections to it, please let me know, and I'll revert
it promptly, but I guess it makes little sense to revert it on the odd
change that someone does.  Thanks for your understanding.

I'm getting failures from pure-virtual1.C with

xg++: error: unrecognized command-line option '-nostdlib++'

I guess that's because it isn't handled by the specs in the way nostdlib and nodefautlibs are. Maybe the solution is to set SKIPOPT in the driver?

Are you not seeing this problem?
From e648ff579bb4b4a690553d4c6f4a3a1b7ff7a287 Mon Sep 17 00:00:00 2001
From: Jason Merrill <ja...@redhat.com>
Date: Fri, 16 Sep 2022 13:51:49 +0200
Subject: [PATCH] c++: fix -nostdlib++
To: gcc-patches@gcc.gnu.org

gcc/cp/ChangeLog:

	* g++spec.cc (lang_specific_driver): Set SKIPOPT on -nostdlib++.
---
 gcc/cp/g++spec.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/g++spec.cc b/gcc/cp/g++spec.cc
index b63d8350ba1..31345f7869e 100644
--- a/gcc/cp/g++spec.cc
+++ b/gcc/cp/g++spec.cc
@@ -158,8 +158,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 
       switch (decoded_options[i].opt_index)
 	{
-	case OPT_nostdlib:
 	case OPT_nostdlib__:
+	  args[i] |= SKIPOPT;
+	  /* FALLTHRU */
+	case OPT_nostdlib:
 	case OPT_nodefaultlibs:
 	  library = -1;
 	  break;
-- 
2.31.1

Reply via email to