Bug 57221 - [11/12/13/14 regression] libgcc symbol visibility changes break Android blobs
Summary: [11/12/13/14 regression] libgcc symbol visibility changes break Android blobs
Status: ASSIGNED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcc (show other bugs)
Version: 4.8.0
: P4 normal
Target Milestone: 11.5
Assignee: Maxim Kuvyrkov
URL:
Keywords: visibility
Depends on:
Blocks: visibility
  Show dependency treegraph
 
Reported: 2013-05-08 23:40 UTC by Bernhard Rosenkränzer
Modified: 2023-07-07 10:29 UTC (History)
2 users (show)

See Also:
Host:
Target: arm-bionic-eabi
Build:
Known to work:
Known to fail: 4.8.0, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 5.0
Last reconfirmed: 2015-03-13 00:00:00


Attachments
Proposed fix (468 bytes, patch)
2013-05-08 23:40 UTC, Bernhard Rosenkränzer
Details | Diff
Another patch (303 bytes, patch)
2013-05-09 00:51 UTC, Bernhard Rosenkränzer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkränzer 2013-05-08 23:40:51 UTC
Created attachment 30064 [details]
Proposed fix

The changes in libgcc symbol visibilities that got into 4.8 (http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01462.html) break important Android blobs.

Bionic (Android's libc) has some rather weird hacks that expose libgcc.a's __aeabi_uidiv and friends to applications linking to Bionic. The changed symbol visibility breaks this, resulting in e.g. a Galaxy Nexus Android build done with gcc 4.8 failing to boot to UI because it can't load its graphics drivers.

It may make sense to change symbol visibility back to default if the target is Android. I've attached a patch that does that.
Comment 1 Andrew Pinski 2013-05-08 23:52:19 UTC
This sounds more like a bug in Bionic rather than anything else.  Why not fix it there?
Comment 2 Bernhard Rosenkränzer 2013-05-09 00:09:40 UTC
I agree that the best fix would be to just rebuild the blobs to get rid of the problem -- but we don't have that option.

Fixing it in Bionic is harder than it sounds because the way things are built, Bionic needs to export __aeabi_uidiv and friends - but since Bionic links to libgcc.a, it can't just define and export __aeabi_uidiv itself because that would cause a symbol clash even if libgcc.a's __aeabi_uidiv is hidden.

Even adding definitions there with __attribute__((weak)) didn't work.
Comment 3 Bernhard Rosenkränzer 2013-05-09 00:51:15 UTC
Created attachment 30068 [details]
Another patch

This patch is needed as well to make sure Bionic can re-export __aeabi_lmul and friends.

Unlike the other patch, this one should be fixed before being applied: There should be a #ifdef around the added attribute (not sure if there's already a define for whether or not the target system is Android?)
Comment 4 Jakub Jelinek 2013-05-31 10:58:54 UTC
GCC 4.8.1 has been released.
Comment 5 Jakub Jelinek 2013-10-16 09:49:37 UTC
GCC 4.8.2 has been released.
Comment 6 Richard Biener 2014-05-22 09:05:40 UTC
GCC 4.8.3 is being released, adjusting target milestone.
Comment 7 Jakub Jelinek 2014-12-19 13:34:11 UTC
GCC 4.8.4 has been released.
Comment 8 Ramana Radhakrishnan 2015-03-13 12:11:26 UTC
(In reply to Bernhard Rosenkränzer from comment #3)
> Created attachment 30068 [details]
> Another patch
> 
> This patch is needed as well to make sure Bionic can re-export __aeabi_lmul
> and friends.
> 
> Unlike the other patch, this one should be fixed before being applied: There
> should be a #ifdef around the added attribute (not sure if there's already a
> define for whether or not the target system is Android?)

Uggh, As you say this should be just for Android foo - please work out how to deal with this to handle Android and not affect all standard Linux targets. Maxim - can you handle this please ?

regards
Ramana
Comment 9 Maxim Kuvyrkov 2015-03-23 13:04:48 UTC
Hi Bero,

I'm working on reproducing this.  How do you build the android toolchain?  Is it manual or do you have this scripted?

In particular, do you use a pre-generated sysroot with Bionic or do you build the C library as part of the toolchain?

Thanks.
Comment 10 Richard Biener 2015-06-23 08:16:39 UTC
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
Comment 11 Jakub Jelinek 2015-06-26 19:58:04 UTC
GCC 4.9.3 has been released.
Comment 12 Richard Biener 2016-08-03 11:02:27 UTC
GCC 4.9 branch is being closed
Comment 13 Jakub Jelinek 2018-10-26 10:20:57 UTC
GCC 6 branch is being closed
Comment 14 Richard Biener 2019-11-14 07:56:31 UTC
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
Comment 15 Jakub Jelinek 2020-03-04 09:50:30 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 16 Jakub Jelinek 2021-05-14 09:46:50 UTC
GCC 8 branch is being closed.
Comment 17 Richard Biener 2021-06-01 08:05:57 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 18 Richard Biener 2022-05-27 09:34:52 UTC
GCC 9 branch is being closed
Comment 19 Jakub Jelinek 2022-06-28 10:30:31 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 20 Richard Biener 2023-07-07 10:29:56 UTC
GCC 10 branch is being closed.