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

clang passes -faddrsig by default, incompatible with GNU binutils #884

Closed
DanAlbert opened this issue Jan 8, 2019 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@DanAlbert
Copy link
Member

DanAlbert commented Jan 8, 2019

Building the full shaderc package (ndk-build -C $NDK/sources/third_party/shaderc NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk APP_PLATFORM=android-24 APP_STL:=c++_static libshaderc_combined) is currently broken because Clang now uses -faddrsig by default, but GNU binutils does not (and has no intention to) support this.

For r19, we need to fix ndk-build and the CMake toolchain to pass -fno-addrsig by default, and document this in the build system maintainer's doc.

For short term future releases, we need to fix the Clang driver to do this by default.

Longer term, the NDK should be moving to LLVM ar, ranlib, lld, strip, etc, but not all of those are ready for NDK use yet.

@DanAlbert
Copy link
Member Author

Fix for r19: https://android-review.googlesource.com/c/platform/ndk/+/865150.

Upstream fix has been submitted: https://reviews.llvm.org/D56456. Hopefully will be available to the NDK by r20.

@DanAlbert DanAlbert reopened this Jan 14, 2019
@DanAlbert DanAlbert modified the milestones: r19, r20, external dependency Jan 14, 2019
@DanAlbert
Copy link
Member Author

Fixed in the build system/docs in r19, but leaving open to track pulling the driver fix.

disigma pushed a commit to wimal-build/ndk that referenced this issue Feb 22, 2019
-faddrsig causes Clang to create output that is not compatible with
GNU binutils. Override and document for r19; the driver will be fixed
in a future Clang update and we'll move to the LLVM tools when
they're ready.

Test: ./checkbuild.py && ./run_tests.py
Test: ndk-build -C $NDK/sources/third_party/shaderc \
    NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk \
    APP_PLATFORM=android-24 APP_STL:=c++_static libshaderc_combined
Bug: android/ndk#884

Change-Id: Ifc709b804b4a071e84c097ecbc57675d2503aac0
@DanAlbert DanAlbert modified the milestones: external dependency, r21 Jun 6, 2019
disigma pushed a commit to wimal-build/ndk that referenced this issue Aug 20, 2019
Test: ./checkbuild.py && ./run_tests.py
Bug: android/ndk#855
Bug: android/ndk#884
Change-Id: I231e74e78b83b695e5675d0b21473ecc3f30ffbd
@DanAlbert
Copy link
Member Author

Master (r21) has the fix. https://android-review.googlesource.com/c/platform/ndk/+/1114056 fixes up the docs.

disigma pushed a commit to wimal-build/ndk that referenced this issue Sep 4, 2019
Test: None
Bug: android/ndk#884
Change-Id: Ic28588cc1ce433d8ccb0ef39c502479885bcdb61
disigma pushed a commit to wimal-build/ndk that referenced this issue Sep 25, 2019
This is no longer necessary because we fixed the driver.

Test: ./checkbuild.py
Bug: android/ndk#884
Change-Id: I97682cbb6485cf5032079f21fa051a55888abd49
mehulagg pushed a commit to mehulagg/superproject that referenced this issue Dec 21, 2019
* Update ndk from branch 'ndk-release-r19'
  to a5ab05ca17e90b4c16984ef1c4bb5dcbd9e23e95
  - Merge "Default to -fno-addrsig." into ndk-release-r19
  - Default to -fno-addrsig.
    
    -faddrsig causes Clang to create output that is not compatible with
    GNU binutils. Override and document for r19; the driver will be fixed
    in a future Clang update and we'll move to the LLVM tools when
    they're ready.
    
    Test: ./checkbuild.py && ./run_tests.py
    Test: ndk-build -C $NDK/sources/third_party/shaderc \
        NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk \
        APP_PLATFORM=android-24 APP_STL:=c++_static libshaderc_combined
    Bug: android/ndk#884
    
    Change-Id: Ifc709b804b4a071e84c097ecbc57675d2503aac0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant