From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128876 invoked by alias); 8 Apr 2015 09:40:13 -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 128794 invoked by uid 48); 8 Apr 2015 09:40:06 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65351] [5 Regression] libiberty's pic version contains non-pic code on m32 darwin; causes bootstrap fail building libcc1. Date: Wed, 08 Apr 2015 09:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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/msg00520.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65351 --- Comment #26 from Jakub Jelinek --- (In reply to Iain Sandoe from comment #25) > > +DARWIN_GCC_MDYNAMIC_NO_PIC := \ > > +`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \ > > + $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \ > > + || echo -mdynamic-no-pic ;; esac` > > I don't think we need the test here ^ ? I wanted to avoid adding -mdynamic-no-pic twice for the case when bootstrap compiler is gcc (once in BOOT_CFLAGS, once in STAGE{2,3,4}_CFLAGS. Sure, the test could be DARWIN_GCC_MDYNAMIC_NO_PIC := \ `case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \ test -z "$(DARWIN_MDYNAMIC_NO_PIC)" && echo -mdynamic-no-pic ;; esac` instead or similar. > > Thus, add -mdynamic-no-pic for gcc (or fixed clang) bootstrap compiler to > > BOOT_CFLAGS and STAGE1_CFLAGS, but only to STAGE{2,3,4}_CFLAGS otherwise? > > > > Then GCC_PICFLAG, being a configure snippet, can surely just use normal > > autoconfy way. > > well, GCC_PICFLAG is not really very autoconf-y at present, just a bunch of > tests of triple. Will try to find some cycles later on. What I meant is that it is processed by autoconf. Anyway, perhaps an alternative would be to just add -mdynamic-no-pic if -mdynamic-no-pic is in CFLAGS. Like $1=-fno-common case "${CFLAGS}" in *-mdynamic-no-pic*) \ $1='-fno-common -mno-dynamic no-pic';; esac in config/picflag.m4 ? Needs verification that -mdynamic-no-pic is really in CFLAGS when it should and not when it should not be.