From patchwork Wed Aug 7 12:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 170746 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7094036ile; Wed, 7 Aug 2019 05:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpzAWzfRiF2WGERoF9POknQhnHrZWEtA9yVIs5w6I0aEckXX85HArJiwPTzVt8Lx5bW73q X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr7955836plk.91.1565181771739; Wed, 07 Aug 2019 05:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565181771; cv=none; d=google.com; s=arc-20160816; b=ZlCLyDNfcgJPneIfah+Cu6vvU7MdMFhPKH1uWlijrfhp29liEV3J/g6QAVmEdLTJRF WlEuBQBVcxw3s/sRPtNdjmvRmfub7WULoIl/SMTBYfgNr0x6mhRaEJeDgaJcIUlo3Og5 jySYLcYA7Ni8tXWquhEwp1ZzVroTKGlc8GA5t9PjxCIQ3bD+jIwToFw2D1r2myWgE+dB YoSYv2TmC/iPZG8ar4YJ0SkoaQK5Y9mHUp6EnhrjOmicHoK0T7VmppQZaQxvvbPVO0rf TV6z7gstA3nLD3cLlyUcbjPpX8cU2i/pNtoxn1pg01RtQYqJGklrndcBjUaQAjxKoSdY WEdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:subject:from:to :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=kIkmkmN14nC5TrveTGnORjagUkfQW1yOQfpuW61ybO0=; b=BqY1WDId4nt3ML5RWp95aEjXzbDszkkakfOzQnQdxl4MqA2ffClZhUx1uPAbhPF3VS KujHjUXBr4bxgYnRerqbgk1RUEbiGFm9jofbKlTr+vIPM6fRpOViK5+sphEW/G4Ce8GB EOddmMwfUovwm8nO6x9oKnrJoPaaqO3Pt6nJbOPNiZ53SZhvTWmaM9gDbxxeWUTpIeKy iFYHVQfcEX0UHkQZOslb0WDMcc0LN+6utDrQP8InB2tdKHDxKSnoP5/UlzjYtUYj/qsW kZlAeXXtFBYmmqwv5fxgQ/JSgPjAa/aGW3m3AplEJnEoQL9pZsOX+gLlcuoNCJnWaXdv iQ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=phmxhGgl; spf=pass (google.com: domain of gcc-patches-return-506414-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-506414-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c10si49167115pgw.174.2019.08.07.05.42.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 05:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-506414-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=phmxhGgl; spf=pass (google.com: domain of gcc-patches-return-506414-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-506414-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=IbU1CXk5ei2Qt6GsTGeeTYuXcJocYL+J/QCiQybhyfvEKHXMOb SjEyxvJ8s8d8alrt5aflKucTqg86ujMdRmWwp9wl9x4cx8oY2BlS1YhIq+j0Byq6 57jMJThvf/sfJ2EUiZa5mfcsZa7v4sKAD6dj4+XJ7W2GgE50JGhpBwBxk= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=r1oRWOvgRxRgq/sny97iLnY7Fd4=; b=phmxhGglskLQYPXMgr8p TpEOR0IoJiJ7zazXTpKATXR/HgKp24vnJ7HQppHu0m/5P78cUKXUii/xjsT1zZnA esr0x3kDLxgyvXvP+UIrbV0Xqmivh4dGVzmvPvp6vzIGRtBc4urXTZDgVmuL1p/M T5VlpQUpzCTtN/DZ1YP9Vlo= Received: (qmail 12523 invoked by alias); 7 Aug 2019 12:42:39 -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 12472 invoked by uid 89); 7 Aug 2019 12:42:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Aug 2019 12:42:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B3F0128; Wed, 7 Aug 2019 05:42:35 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E0CA3F575; Wed, 7 Aug 2019 05:42:35 -0700 (PDT) To: gcc-patches@gcc.gnu.org From: "Richard Earnshaw (lists)" Subject: PR driver/91130 Use CL_DRIVER when handling of COLLECT_GCC_OPTIONS in lto-wrapper.c Message-ID: <3166871c-42bb-f88e-7d28-c8dc41fcbdc1@arm.com> Date: Wed, 7 Aug 2019 13:42:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Some options are handled differently by the main driver (gcc, g++, etc) from the back-end compiler programs (cc1, cc1plus, etc) in that in the driver they do not take an additional argument, while in the compiler programs they do. The processing option option CL_DRIVER controls this alternative interpretation of the options. The environment variable COLLECT_GCC_OPTIONS is the list of options to add to a compile if the compiler re-invokes itself at some point. As such, the options are driver options, so CL_DRIVER should be used when processing this list. Currently lto-wrapper is doing this incorrectly. PR driver/91130 * lto-wrapper.c (find_and_merge_options): Use CL_DRIVER when processing COLLECT_GCC_OPTIONS. (run_gcc): Likewise. Bootstrapped on aarch64-linux OK? NB, this is essentially the same as Richi's patch in the PR. I'll let you decide which to take... diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 3414ade..f93ff50 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1010,7 +1010,7 @@ find_and_merge_options (int fd, off_t file_offset, const char *prefix, struct cl_decoded_option *f2decoded_options; unsigned int f2decoded_options_count; get_options_from_collect_gcc_options (collect_gcc, - fopts, CL_LANG_ALL, + fopts, CL_DRIVER, &f2decoded_options, &f2decoded_options_count); if (!fdecoded_options) @@ -1283,7 +1283,7 @@ run_gcc (unsigned argc, char *argv[]) fatal_error (input_location, "environment variable % must be set"); get_options_from_collect_gcc_options (collect_gcc, collect_gcc_options, - CL_LANG_ALL, + CL_DRIVER, &decoded_options, &decoded_options_count);