Skip to content

Cannot link code compiled with -fxray-instrument. #368

Open

Description

@shuralnik-sc

Description

Clang toolchain is not able to link code compiled with -fxray-instrument, for any ABI. Linker fails with next messages:

/home/serg/tools/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open /home/serg/tools/android-ndk-r14b/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib64/clang/3.8.275480/lib/linux/libclang_rt.xray-arm-android.a: No such file or directory
/home/serg/tools/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
/home/serg/tools/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lrt

Environment Details

  • NDK Version: 14.1.3816874
  • Build system: any
  • Host OS: Mac
  • Compiler: clang
  • ABI: any
  • STL: N/A
  • NDK API level: N/A
  • Device API level: N/A

Activity

  1. pirama-arumuga-nainar commented on Apr 21, 2017

    @pirama-arumuga-nainar
    Collaborator

    The xray runtimes are missing from the packaged Clang. It's not even built right now. We may be able to get it in r15 but not a certainity.

  2. DanAlbert commented on Apr 21, 2017

    @DanAlbert
    Contributor

    Looks like we need a driver fix too, though. It's trying to link libpthread and librt, which don't exist on Android (it's all just bundled in libc).

  3. DanAlbert commented on Mar 16, 2018

    @DanAlbert
    Contributor

    @stephenhines: here's another clang feature request

  4. added this to the r18 milestone on Mar 16, 2018
  5. DanAlbert commented on Mar 16, 2018

    @DanAlbert
    Contributor

    Not sure how much work this will be. Feel free to punt.

  6. pirama-arumuga-nainar commented on Mar 16, 2018

    @pirama-arumuga-nainar
    Collaborator

    The xray runtimes are now available (clang-4639204). We just need to update the driver to omit lpthread and lrt. I'll prepare an upstream change.

  7. DanAlbert commented on Mar 16, 2018

    @DanAlbert
    Contributor

    Great, thanks.

  8. pirama-arumuga-nainar commented on Mar 21, 2018

    @pirama-arumuga-nainar
    Collaborator

    Regarding my previous comment, I don't know what I was testing. Compiler-rt does not build xray runtimes for Android yet (https://github.com/llvm-mirror/compiler-rt/blob/351f235ea4d0bfa17b65dd3a0ac14bbd8a98b90b/cmake/config-ix.cmake#L603). We'll reach out to the xray developers to test for Android and also see what we can do from our side. There's no definitive milestone for this yet.

  9. modified the milestones: r18, r19 on Mar 27, 2018
  10. DanAlbert commented on Mar 27, 2018

    @DanAlbert
    Contributor

    Okay, let us know when you have even a vague idea of what sort of effort this will take and we can re-triage.

  11. added this to the external dependency milestone on Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions