This is the mail archive of the gcc-patches@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]

Re: [patch, build] Restore bootstrap in building libcc1 on darwin


On 02/01/15 09:42, Iain Sandoe wrote:

This is a GCC5 bootstrap regression on 32bit Darwin hosts ( I can raise a PR if that is considered necessary).
Has this been addressed or is it still pending?



In fact it is not libcc1, but libiberty that is the cause -

On 26 Jan 2015, at 14:13, Rainer Orth wrote:

FX <fxcoudert@gmail.com> writes:

The default BOOT_CFLAGS are: -O2 -g -mdynamic-no-pic
the libiberty pic build appends: -fno-common (and not even -fPIC) [NB
-fPIC _won't_ override -mdynamic-no-pic, so that's not a simple way out]
This means that the PIC library is being built with non-pic relocs.

config/mh-darwin says that -mdynamic-no-pic is there because it “speeds
compiles by 3-5%”. I don’t think we care about speed when the bootstrap
fails, so can we remove it altogether?

Darwin/i686 still doesn't bootstrap without this patch, I believe.
Shouldn't it be applied to trunk before GCC 5 ships, rather than leaving
that target broken?

The PIC variant of libiberty, has never (since it was added, AFAICT) catered for the possibility that non-PIC and PIC options might conflict (and/or that it might not be possible to override non-PIC options simply by appending PIC ones).

This has gone un-noticed until the libcc1 plugin started linking with the pic version of libiberty.

Darwin uses -mdynamic-no-pic as a default flag during bootstrap for 32bit targets, since that gives a stated ~ 3-5% improvement in performance.

It is not possible to override this non-pic option by appending -fPIC (that simply results in a warning that mdynamic-no-pic takes precedence).

I'd rather not pretend that there's no problem and simply penalise performance on m32 darwin by removing the option from the bootflags.

So here's a patch that allows a target to declare incompatible non-pic options (in the same way that we have PIC options already declared as distinct).

The patch is largely mechanical (each of the targets adjusted to use the NONPIC flag for the relevant case).

As an aside, is there a portability reason that we don't make this repeated operation into a make function?

bootstapped on x86_64-linux, x86_64-darwin12, i686-darwin10, powerpc-darwin9,
cross-compiled x86-64-darwin12 X i686-darwin10 , native X i686-darwin10 (x86_64-darwin12 build).

all languages including Ada (note that there's a local patch needed to work-around an Ada bootstrap issue - pr64349)

OK for trunk?
Iain

libiberty:
	* Makefile.in (NONPICFLAG, NEWCFLAGS, NEWCPPFLAGS): New.
	(COMPILE.c): Adjust to use new flags. (all non-pic targets):
	Adjust to use NONPIC flag.
	* configure.ac (NOPICFLAG): New.
	* configure: Regenerate.



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