This is an archive of the discontinued LLVM Phabricator instance.

[builtins] __gnu_[u]ldivmod_helper for libgcc compatibility
AbandonedPublic

Authored by kongyi on Apr 16 2019, 9:10 PM.

Details

Summary

Android has a legacy issue, where bionic libc used to export some symbols from libgcc, and now huge number of apps relies on this behaviour. In order to maintain compatibility, we need to retain these symbols even after moving to compiler-rt builtins.

Implement __gnu_[u]ldivmod_helper just for Android, since these symbols are deprecated everywhere else.

Diff Detail

Event Timeline

kongyi created this revision.Apr 16 2019, 9:10 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 16 2019, 9:10 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript

Can you update the description to give some context on why these functions are needed in compiler-rt? To the best of my knowledge gnu_uldivmod_helper is no longer in libgcc and gnu_ldivmod is only called from the v6-m (cortex-m0) implementation of aeabi_ldivmod in libgcc/config/arm/bpabi-v6m.S which would imply that these functions would not not get called.

References:

kongyi updated this revision to Diff 195587.Apr 17 2019, 9:40 AM
kongyi retitled this revision from [builtins] __gnu_{ldivmod,uldivmod}_helper for libgcc compatibility to [builtins] __gnu_[u]ldivmod_helper for libgcc compatibility.
kongyi edited the summary of this revision. (Show Details)

Can you update the description to give some context on why these functions are needed in compiler-rt? To the best of my knowledge gnu_uldivmod_helper is no longer in libgcc and gnu_ldivmod is only called from the v6-m (cortex-m0) implementation of aeabi_ldivmod in libgcc/config/arm/bpabi-v6m.S which would imply that these functions would not not get called.

References:

Please refer to the updated change description.

kongyi abandoned this revision.Apr 17 2019, 10:40 AM

We're going to apply a workaround in Bionic instead.