https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65351

--- Comment #26 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(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.

Reply via email to