From patchwork Fri Sep 20 12:19:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 97755 Return-Path: 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 CB3EB3858C98 for ; Fri, 20 Sep 2024 12:20:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 E12F03858D39 for ; Fri, 20 Sep 2024 12:19:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E12F03858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=surgut.co.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=surgut.co.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E12F03858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726834764; cv=none; b=cfJwDf6ztxCd9iKPFJbuZK/xzKEiXd23BVBNVOETya5Eg5VBhTcBzEM5NnIVf5UdNSPTJFSevlDM5JfvMdkCkysXlsRRMCIeKnghIQjhjIf850s/qdj90AD7Y2k55E+BlUdvtEmHFAu7suv5jEIrwsQPqkwZpH6tJlGa1WyIJRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726834764; c=relaxed/simple; bh=WNMpA9AUKmmMGXnVw+RCElagPGrqBgijX4x0MsFtiGg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PWnvIAaJrJni9jv7NQU6wUoHox3U4tUZM+m6n/F+FB1ClAIae5snloPX2PhCScelSDDwLO6Z9VgVks+ryxskrHZ8uH85fwV1wVzTwLWfKy7t32j8ljMVARwjavwwzI5kZTR5A7RPO1l50+KfFnNRNRJ1i+c1yDRv5IGYW0KeH+w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cb60aff1eso18452905e9.0 for ; Fri, 20 Sep 2024 05:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=surgut.co.uk; s=google; t=1726834761; x=1727439561; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SLiIud1Z0TpES7iqnTxc7yHhApbwAs9PzyCp0gDIGNc=; b=Cdm9ZaEJ65EqkD8qCXs/sXwTcSRuQRb6CXaU4XoeJx4BcyNzxcjclqqWlWDFTpFRyJ dNsz79QfGSBZkNFSnwnVhZxnOxCOJQCMakEuazJDTcl5kxujOZ+op30hIQ6Ttyp1XQLn 0Siv5AqeljMYfTTiu42hV3axGhwdgmIaWkRg8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726834761; x=1727439561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SLiIud1Z0TpES7iqnTxc7yHhApbwAs9PzyCp0gDIGNc=; b=IQsB1hW4vRet76M5c7y9zgjrW54tGIcn1SNKAwK6vfgJ7MfNCxRH03yAkzjJDWLnrO CsR1j7gRgZQy8ugMxzUcGOD0+F7jIbgXG0qF+v4IgYEMCeRw4rN/flPjONOZhiJN4I5n EHLKY71NV2x4GIGpJBmTg3Iu9igk8KTyb9o5g9kjgAwVx5kx4djVETjMM9kKy7xpDn7W J45JhO5BAFEXBKYVOtuNmiAemdHclUw+oRPFYpQEc2ZkLErn9Vwe769lPcF9ON7v/N3n BYL4PScUbZ/XAl6J0rT1sDUuXfmCMEKz5gK7wvanbWs/b6tOmNOnpISO9lf5Ic3ZQ4n7 3nyw== X-Gm-Message-State: AOJu0Yx7P6wOohQ8CpvN7R8eqM1vlkgXPx8aWw/U6LzDGXHZQIEcsreg Mg9rbu2lPdCymCiSE/kF+jgMw85oBJ547QMSC15iF8OmythjXkmhcua80zAuVN3E/sTE5sFXZUB A8AgVgvql X-Google-Smtp-Source: AGHT+IHvhflNG0wW6Jye8RBFU9pi+F+SN8J9Us+VnARkNPKIBdM/cwD7cRJvF5DD7qj5mOyr7Pb7bQ== X-Received: by 2002:a05:6000:512:b0:374:c2f5:38a4 with SMTP id ffacd0b85a97d-37a431be6ebmr1248340f8f.51.1726834761013; Fri, 20 Sep 2024 05:19:21 -0700 (PDT) Received: from chainguard.. ([2a01:4b00:85fd:d700:d4a1:48d7:e6c4:e84b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f97cbsm17356250f8f.50.2024.09.20.05.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 05:19:20 -0700 (PDT) From: Dimitri John Ledkov To: gcc-patches@gcc.gnu.org Cc: Dimitri John Ledkov Subject: [PATCH 1/2] specs: load specs.overlay with all commands enabled Date: Fri, 20 Sep 2024 13:19:18 +0100 Message-ID: <20240920121919.65112-2-dimitri.ledkov@surgut.co.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920121919.65112-1-dimitri.ledkov@surgut.co.uk> References: <20240920121919.65112-1-dimitri.ledkov@surgut.co.uk> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_COUK, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org After automatically discovered "specs" file is loaded, or in its absence "built-in" specs are generated; attempt to discover "specs.overlay" and load it. Unlike "specs", "specs.overlay" allows using "%include", "%include_noerr" and "%rename" commands, similar to user provided `-specs` on the command line. Then continue to parse and load any user provided `-specs` on the command line. gcc/ChangeLog: * gcc.cc (driver::set_up_specs): Parse and load specs.overlay by default, with all commands allowed. Signed-off-by: Dimitri John Ledkov --- gcc/gcc.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 16fed46fb35..b00d93b45c4 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -8601,6 +8601,11 @@ driver::set_up_specs () const PREFIX_PRIORITY_LAST, 0, 1); } + /* Process any built-in specs overlay, allow include_noerr */ + specs_file = find_a_file (&startfile_prefixes, "specs.overlay", R_OK, true); + if (specs_file != 0 && access (specs_file, R_OK) == 0) + read_specs (specs_file, false, false); + /* Process any user specified specs in the order given on the command line. */ for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next) From patchwork Fri Sep 20 12:19:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 97756 Return-Path: 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 8882F3857022 for ; Fri, 20 Sep 2024 12:20:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 6830A3858CDB for ; Fri, 20 Sep 2024 12:19:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6830A3858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=surgut.co.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=surgut.co.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6830A3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726834765; cv=none; b=vV2ZA/a0bwfn5stC9NoCXkl+IDipthlSqAiy7S3z1YdQCHwN3lfmFATa+tHozuhUWtq36rS5tQa+UAZgdzXJvilyTsaEnFKI0o+15XqxWfTJkLyEBJp6Qgkx7HCtfaPUCJJ9tYtv3wrrrkMuQa7o5QEvn5eTYXBH4RIcaCHwq2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726834765; c=relaxed/simple; bh=eUaFNMsmFWt8hkcta08Ztx/ktUV8bIr46/JjWODYSos=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CZLw48SCEPSBQABpih6rRbzdcwS40sXHjsMD023LlM6DC3dAY9UR2pSVnwMu4mi25d0Ro9PpYrQXN5KIj4GoGI3jFra4Cp9WEEH9+l6mfyE84ysNPdE+wNDvKAzUwxFT5PeBeQ3hX8PNwn1yHSYkp57ay0pQiroL7IRn3YwiyJo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so16506455e9.3 for ; Fri, 20 Sep 2024 05:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=surgut.co.uk; s=google; t=1726834762; x=1727439562; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rOf4mI8/PBav+yqHthu+nN0DdMjoWAVDmNaM1FT2TwA=; b=Drqtj8SSBLXzFx4R7MgzJk8DYNl4L0E7t+b89hsaqtGCU40K1szkcqrBP5wElky/7v pTARjXsKnzzRanqwuUeEK4W1Ke8iohLGBeL/xnvmjAIcwlATGiuT+Fk+Q6KpCqMrKthT df/YuoiKx59jqVALvOZLUDWgwK+Aus//nAXKU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726834762; x=1727439562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rOf4mI8/PBav+yqHthu+nN0DdMjoWAVDmNaM1FT2TwA=; b=JmqC2ZR8/6TuDC+fKToP+fCVKoVP5fu+kMGnYry9C6ebdGUac1+3uYqo31doT3lKST tHQ3PiKRcKOHwi9DUsZHml0CvccsIiF6G7NUhJ3RKLzZgNVnS5VI19mxuVpsSgGpiKEn kyaRmE48gjqD+3Kkbd0utd6fxrExIdHdasOWL1yvvN1Ld2pIJDYFWxhRXwpaC1+djlzm lF2Sho1OjiSquzydF33ktMYwtvWBCGJxaLbc5iRtQSdQGm+kiWrVHm43YuhMKgGL7XO0 z9LhYxNVv1JenOpwjdyU8GOL1B2U4rMMPa7ZBDzhCzI9jEpxN13oi225hyvIJjZkwwc2 DgVQ== X-Gm-Message-State: AOJu0YxH+vtXz3bzHS2zoEQxucChUwyR4nieCw+6c2YCJze6/PN9JHWD Wcz99V/1IxbHa9SZX7Y1pcvk1Q7VhUKpGehxxZdk6ugo85LL22SHBDCB/yp6fFHqi5Ekuqe508P /Cabmhyvy X-Google-Smtp-Source: AGHT+IEIC6snX1lvTt3tdWCE2CQQloAtVLPQjWyrLYiHI/i1/be2nyxq46/Ie/doW6Wo53orQfPw2Q== X-Received: by 2002:a05:6000:18ad:b0:371:9121:5642 with SMTP id ffacd0b85a97d-37a422bf182mr1893149f8f.30.1726834761784; Fri, 20 Sep 2024 05:19:21 -0700 (PDT) Received: from chainguard.. ([2a01:4b00:85fd:d700:d4a1:48d7:e6c4:e84b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f97cbsm17356250f8f.50.2024.09.20.05.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 05:19:21 -0700 (PDT) From: Dimitri John Ledkov To: gcc-patches@gcc.gnu.org Cc: Dimitri John Ledkov Subject: [PATCH 2/2] specs: always generate built-in specs, before reading "specs" file Date: Fri, 20 Sep 2024 13:19:19 +0100 Message-ID: <20240920121919.65112-3-dimitri.ledkov@surgut.co.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920121919.65112-1-dimitri.ledkov@surgut.co.uk> References: <20240920121919.65112-1-dimitri.ledkov@surgut.co.uk> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_COUK, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Previously either "specs" file was read, or built-in specs were generated. With this change, always load generated "built-in" specs, prior to discovering and loading optional "specs" file. Also relax, and allow using "%include", "%include_noerr", and "%rename" commands in the "specs" file. Then continue to load user specified `-specs` files on the command line. This makes "specs" file from startfiles locations, behave closer to user provided "-specs" files. gcc/ChangeLog: * gcc.cc (driver::set_up_specs): Always load "built-in" generated specs files, prior to loading "specs" file. Allow "%include", "%include_noerr" and "%rename" commands in "specs" file. Signed-off-by: Dimitri John Ledkov --- gcc/gcc.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index b00d93b45c4..8d208e7de00 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -8464,12 +8464,18 @@ driver::set_up_specs () const accel_dir_suffix, dir_separator_str, NULL); just_machine_suffix = concat (spec_machine, dir_separator_str, NULL); + /* Always init built-in specs, as all followups can then + append/remove/rename. This also makes the existing Spec documentation true + for both command-line -specs provided files, and those added to the + /specs location */ + init_spec (); + specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true); - /* Read the specs file unless it is a default one. */ - if (specs_file != 0 && strcmp (specs_file, "specs")) - read_specs (specs_file, true, false); - else - init_spec (); + + /* Read the specs file, these days empty, thus allow #include_noerr + commands */ + if (specs_file != 0) + read_specs (specs_file, false, false); #ifdef ACCEL_COMPILER spec_machine_suffix = machine_suffix; @@ -8485,7 +8491,7 @@ driver::set_up_specs () const strcat (specs_file, spec_machine_suffix); strcat (specs_file, "specs"); if (access (specs_file, R_OK) == 0) - read_specs (specs_file, true, false); + read_specs (specs_file, false, false); /* Process any configure-time defaults specified for the command line options, via OPTION_DEFAULT_SPECS. */