This is the mail archive of the
mailing list for the eCos project.
Patch_or_Contribution granted: [Bug 1002013] [PATCH] gcc 4.7 breaks the synth
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-patches at sourceware dot org
- Date: Thu, 02 Oct 2014 07:47:40 +0000
- Subject: Patch_or_Contribution granted: [Bug 1002013] [PATCH] gcc 4.7 breaks the synth
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-1002013-0 at http dot bugs dot ecos dot sourceware dot org/>
Ross Younger <email@example.com> has granted Patch_or_Contribution:
Bug 1002013: [PATCH] gcc 4.7 breaks the synth
------- Additional Comments from Ross Younger <firstname.lastname@example.org>
(Have discussed with jifl.)
Perhaps foolhardily, I upgraded my desktop from Ubuntu 12.04 to 14.04.
Long story short:
* Ubuntu 14.04 ships with gcc 4.8 out of the box.
* On an image for the synthetic target compiled with 4.8, __CTOR_LIST__ ==
* In other words, none of our static constructors run, leaving a badly broken
universe. (Simple example: The kernel test thread1 (amongst others) crashes
with a segfault when it attempts to resume a thread.)
* Compiling the same test code with gcc 4.6 on the same system works just fine.
On further investigation, the relevant change was made in gcc 4.7, which was to
rename the .ctors section of the ELF image to .init_array (and to present its
members in the opposite order).
Patch attached; tested with both gcc 4.6 and 4.8. This looks for both .ctors
and .init_array sections and iterates through them both; it's very similar to
the code in the ARM HAL which incurred this issue on the change to EABI. But I
think that autodetecting on the synth is a better answer than a CDL option to
switch between the two (cf. EABI); it is not exactly a resource-constrained
target so the extra code size is harmless.
I suspect the i386 HAL will require a similar patch, but I do not have access
to a suitable test rig at the present time.