This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: -fpic/-fPIC testresults under sol2.9 & ppclinux trunk
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc:
- Date: Mon, 12 May 2003 13:48:26 -0500 (CDT)
- Subject: Re: -fpic/-fPIC testresults under sol2.9 & ppclinux trunk
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
- References: <3EB6A4CB.5020300@pop.agri.ch>
>> I'll try taking out PCHFLAGS from testsuite_flags.in tonight and see
>> if that makes the problem go away. If it does, we've narrowed the
>> cause of the problem at least. I'll let you know.
> Just a question for my understanding, why do the tests pass when I add
> the flag -save-temps? Does this flag also influence the code generated?
> I thought this flag just saves the intermediate files instead of
> throwing them?
>
> I couldn't remove these flags here, didn't find the time.
I can't answer definitively but I think:
- When you add -save-temps, PCH is completely disabled.
- If adding -fpic/-fPIC adds a defined macro (which it does) that
wasn't seen during PCH generation (and somehow affects the contents
of headers?), PCH is disabled.
There is a definite problem in this area (add i386-unknown-freebsd4.8
to list above) but it is not with the C++ library code itself, to wit:
; echo >t.h
; echo >main.c 'int main() {}'
; g++ -o t.h.gch t.h
; g++ -include t.h -Winvalid-pch main.c
; g++ -include t.h -Winvalid-pch -fpic main.c
main.c: In function `int main()':
main.c:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
; g++ -fpic main.c
(Humm, at this point, I'd have thought that maybe something wasn't
marked for PCH/GC properly in a region keyed by -fpic, but then I
noticed:)
; g++ -fpic -o t.h.gch t.h
; g++ -include t.h -Winvalid-pch main.c
cc1plus: warning: ./t.h.gch: not used because `__pic__' not defined
; g++ -include t.h -Winvalid-pch -fpic main.c
I'm sorry, but I have no time to debug this today but I did file a PR
with the root (multi-file) test case.
Regards,
Loren