This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, build] Restore bootstrap in building libcc1 on darwin
- From: Iain Sandoe <iain at codesourcery dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: FX <fxcoudert at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>, <pmuldoon at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Tom Tromey <tromey at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 4 Dec 2014 13:43:25 +0000
- 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>
Hi Rainer,
On 4 Dec 2014, at 13:32, Rainer Orth wrote:
> FX <fxcoudert@gmail.com> writes:
>
>> 10-days ping
>> This restores bootstrap on a secondary target, target maintainer is OK with
>> it. I think I need build maintainers approval, so please review.
>
> While in my testing, 64-bit Mac OS X 10.10.1 (x86_64-apple-darwin14.0.0)
> now bootstraps, but 32-bit (i386-apple-darwin14.0.0) does not:
>
> ld: illegal text-relocation to 'anon' in ../libiberty/pic/libiberty.a(regex.o) from '_byte_common_op_match_null_string_p' in ../libiberty/pic/libiberty.a(regex.o) for architecture i386
> collect2: error: ld returned 1 exit status
> make[3]: *** [libcc1.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-libcc1] Error 2
For {i?86,ppc}-darwin* (i.e. m32 hosts) the PIC libiberty library is being incorrectly built.
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.
I have a local hack to allow build to proceed on m32-host-darwin (which I can send to you if you would like it) - however, it's not really a suitable patch for trunk... and I've not had time recently to try and fix this.
If you would like to raise a PR for this, I can append the analysis there.
cheers
Iain