This is the mail archive of the
mailing list for the GCC project.
Re: [patch, build] Restore bootstrap in building libcc1 on darwin
- From: Jeff Law <law at redhat dot com>
- To: Iain Sandoe <iain at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: DJ Delorie <dj at redhat dot com>, FX <fxcoudert at gmail dot com>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>, Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Date: Mon, 09 Feb 2015 15:47:43 -0700
- Subject: Re: [patch, build] Restore bootstrap in building libcc1 on darwin
- Authentication-results: sourceware.org; auth=none
- References: <94381BB6-563C-44EE-910E-9569410F2AB5 at gmail dot com> <C3BC6494-0362-4AFC-9F1D-E456B6D9A471 at gmail dot com> <F510F911-EA66-4CA8-A43D-92CF538E50F4 at gmail dot com> <ydd388vczh8 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <659E2BE7-2692-4023-9BD2-CE131F8B5451 at codesourcery dot com> <0EB3ED59-3AB7-4EF5-94F3-AFFEB0DAD812 at gmail dot com> <ydd61btmxzc dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <28338256-8A54-462A-B30B-887B364142D7 at codesourcery dot com>
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 <firstname.lastname@example.org> 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?
* 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.