From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92899 invoked by alias); 9 Apr 2015 08:03:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 92882 invoked by uid 48); 9 Apr 2015 08:03:25 -0000 From: "ludo at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65711] New: arm*-linux* "link" spec passes '-dynamic-linker' even for '-shared' Date: Thu, 09 Apr 2015 08:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ludo at gnu dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg00632.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65711 Bug ID: 65711 Summary: arm*-linux* "link" spec passes '-dynamic-linker' even for '-shared' Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ludo at gnu dot org gcc/config/arm/linux-elf.h defines LINUX_TARGET_LINK_SPEC to (simplified): %{!static -dynamic-linker LINKER} However, '-dynamic-linker' should not be passed when '-shared' is used. The correct way appears to be what config/i386/gnu-user.h does, which is: %{!static %{!shared -dynamic-linker LINKER}} I believe the attached patch fixes that. At least both 4.8.4 and 4.9.2 are affected. (Initially discussed in the context of .)