Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] neither ndk-build nor CMake toolchain file uses --gc-sections for shared libraries by default #1717

Closed
DanAlbert opened this issue May 19, 2022 · 0 comments
Assignees
Labels
Projects

Comments

@DanAlbert
Copy link
Member

DanAlbert commented May 19, 2022

Description

Neither ndk-build nor CMake toolchain file uses --gc-sections for shared libraries by default (they both do for executables). This is contrary to our own docs: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Controlling-Binary-Size

This seems to have always been the case (checking all the way back to r10 shows the same behavior). I'm not sure if the author back then did that intentionally or if it was an oversight, but afaik there's no downside to using this flag, so it should be on by default.

Test case

Affected versions

r23, r24, r25, Canary

Canary version

TOT

Host OS

Linux, Mac, Windows

Host OS version

all

Affected ABIs

armeabi-v7a, arm64-v8a, x86, x86_64

Build system

CMake

Other build system

No response

minSdkVersion

any

Device API level

N/A

@DanAlbert DanAlbert added the bug label May 19, 2022
@matthias-blume matthias-blume self-assigned this May 25, 2022
@DanAlbert DanAlbert added this to Triaged in r25 via automation Jun 27, 2022
@DanAlbert DanAlbert moved this from Triaged to Needs cherry-pick in r25 Jun 27, 2022
r25 automation moved this from Needs cherry-pick to Merged Jun 27, 2022
osspop pushed a commit to osspop/android-ndk that referenced this issue Jan 17, 2023
git auto resolved this conflict by ignoring the file entirely, it seems,
so the test is still marked as broken despite the fix that was cherry-
picking having deleted this file...

Bug: android/ndk#1717
Test: ./run_tests.py --filter gc_sections --rebuild
Change-Id: I52bf37c72bba7f8e439a26ed9c5985299d71ef8e
(cherry picked from commit 20341934576c924d1700ca20b396e564843f8abd)
Merged-In: I52bf37c72bba7f8e439a26ed9c5985299d71ef8e
osspop pushed a commit to osspop/android-ndk that referenced this issue Jan 17, 2023
Bug: android/ndk#1717
Test: this is the test
Change-Id: Ia71d3137a34e2812a7ed4d37d54175a24e714ea9
osspop pushed a commit to osspop/android-ndk that referenced this issue Jan 17, 2023
git auto resolved this conflict by ignoring the file entirely, it seems,
so the test is still marked as broken despite the fix that was cherry-
picking having deleted this file...

Bug: android/ndk#1717
Test: ./run_tests.py --filter gc_sections --rebuild
Change-Id: I52bf37c72bba7f8e439a26ed9c5985299d71ef8e
(cherry picked from commit 20341934576c924d1700ca20b396e564843f8abd)
Merged-In: I52bf37c72bba7f8e439a26ed9c5985299d71ef8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
r25
  
Merged
Development

No branches or pull requests

2 participants