From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id DED6E385840D; Wed, 24 Apr 2024 18:36:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DED6E385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713983768; bh=aaTPgBP1MLYeS+4h7EELvQ9CpUwe7KlNhYN3iOo8Jbs=; h=From:To:Subject:Date:From; b=RcUxeCr7yLu/Ey4wBnxxFhniyPxfkv5s/ttIeu0fiynpqoJIYzPkpZXo2M3/zQiQI bQnU+CCkaoF1YfnUASn2QMNXkpF2fQZoLaRUywlZyJjPUAoIQ4+BpXDjGFwfeOwhNd gJ4DoUqXFABP+0NqTeiQYYSKDlvL002CLS57IZcA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11353] Darwin: Fix empty g++ command lines [PR105599]. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 09910b6753427eeb3f6dded4fae3578851da7422 X-Git-Newrev: 3bb14f6ed5bc70e25381c67963c90eaab91eca22 Message-Id: <20240424183608.DED6E385840D@sourceware.org> Date: Wed, 24 Apr 2024 18:36:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3bb14f6ed5bc70e25381c67963c90eaab91eca22 commit r11-11353-g3bb14f6ed5bc70e25381c67963c90eaab91eca22 Author: Iain Sandoe Date: Sun May 29 16:14:32 2022 +0100 Darwin: Fix empty g++ command lines [PR105599]. An empty g++ command line should produce a diagnostic that there are no inputs. The PR is that currently Darwin produces a dignostic about missing link items instead - this is because (errnoeously), for this driver, we are creating a link job for empty command lines. The problem occurs in four stages: The g++ driver appends -shared-libgcc to the command line. The Darwin driver_init code in the backend does not see this (it sees an empty command line). When the back end driver code driver sees an empty command line, it does not add any supplementary flags (e.g. asm-macosx-version-min) - precisely to avoid anything being claimed as an input_file and therefore triggering a link line. Since we do not have a value for asm-macosx-version-min when processing the driver specs, we unconditionally inject 'multiply_defined suppress' which is used with shared libgcc (but only intended on very old Darwin). This then causes the generation of a link job. The solution, for the present, is to move version-specific link params to the LINK_SPEC so that they are only processed when a link job has already been decided. Signed-off-by: Iain Sandoe PR target/105599 gcc/ChangeLog: * config/darwin.h: Move versions-specific handling of multiply_defined from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC. (cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2) Diff: --- gcc/config/darwin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index b2bd33f8d4a..5be13293319 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -215,7 +215,8 @@ extern GTY(()) int darwin_ms_struct; "%{image_base*:-Xlinker -image_base -Xlinker %*} %