This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65351] [5 Regression] libiberty's pic version contains non-pic code on m32 darwin; causes bootstrap fail building libcc1.


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The patch looks wrong, but passing -mdynamic-no-pic in BOOT_CFLAGS for Darwin
is even more wrong.
BOOT_CFLAGS is feeding STAGE*_CFLAGS which is used to compile various stuff,
not just the compiler binary itself, and given that the flag is incompatible
with -fpic and some libraries are built with that, you just shouldn't pass that
down.
libcc1 isn't the only thing broken by that, I think --enable-host-shared will
fail miserably too on Darwin.
So, either config/mh-darwin should set some other variable (say
NONPIC_HOST_CFLAGS or whatever) to -mdynamic-no-pic and you should arrange for
it to be passed down as NONPIC_CFLAGS for modules being built for host, and
you'd use that in e.g.
 # Enable --enable-host-shared
 AC_ARG_ENABLE(host-shared,
 [AS_HELP_STRING([--enable-host-shared],
                 [build host code as shared libraries])],
-[PICFLAG=-fPIC], [PICFLAG=])
+[PICFLAG=-fPIC], [PICFLAG=$NONPIC_CFLAGS])
 AC_SUBST(enable_host_shared)
 AC_SUBST(PICFLAG)
(in gcc/ and libcpp/, perhaps elsewhere where performance criticial), or you
just not do it in config/mh-darwin, but in these two spots instead.
Really, passing some bogus flag down everywhere and then trying to remove it
again is just too weird.
Another option is to make sure you use -fPIC (or -fpic) together with
-mno-dynamic-no-pic on Darwin and that you pass it after the vars where
-mdynamic-no-pic is set, then tweak libiberty/pic, gcc & libcpp
--enable-host-shared etc. not to use that.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]