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

Separate symbol file generation doesn't work for newer Android NDK #4774

Closed
ifarbod opened this issue Feb 26, 2024 · 3 comments · Fixed by #4775
Closed

Separate symbol file generation doesn't work for newer Android NDK #4774

ifarbod opened this issue Feb 26, 2024 · 3 comments · Fixed by #4775
Labels
Milestone

Comments

@ifarbod
Copy link
Contributor

ifarbod commented Feb 26, 2024

Xmake Version

2.8.6

Operating System Version and Architecture

Windows 11 23H2

Describe Bug

Based on the following page:

https://xmake.io/#/manual/project_target?id=targetset_symbols

When building an Android project, it should generate a .sym file. However, XMake relies on architecture-based strip.exe, for example: x86_64-linux-android-strip.exe, in later NDK versions, this is removed and replaced with the generic llvm-strip.exe

checking for the symbols stripper (strip: arm-linux-androideabi-strip) ... no

Expected Behavior

I would like XMake to support the changes in the latest NDK version.

Project Configuration

target("myapplicationcpp2")
    set_kind("shared")
    set_symbols("debug")
    add_files("src/**.cpp")

Additional Information and Error Logs

checking for the shared library linker (sh) ... clang++
checking for the linker (ld) ... clang++
[ 25%]: cache compiling.release src\native_lib.cpp
C:\Users\iFarbod\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ -c --sysroot=C:\Users\iFarbod\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\sysroot -isystem C:\Users\iFarbod\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\arm-linux-androideabi -Qunused-arguments -target armv7-none-linux-androideabi21 -mthumb -fPIC -g -O3 -std=c++14 -Isrc -DNDEBUG -o build\.objs\myapplicationcpp2\android\armeabi-v7a\release\src\native_lib.cpp.o src\native_lib.cpp
checking for the symbols stripper (strip: arm-linux-androideabi-strip) ... no
[ 50%]: linking.release libmyapplicationcpp2.so
C:\Users\iFarbod\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ -o build\android\armeabi-v7a\release\libmyapplicationcpp2.so build\.objs\myapplicationcpp2\android\armeabi-v7a\release\src\native_lib.cpp.o -shared -llog -target armv7-none-linux-androideabi21 -mthumb -fPIC -s

build cache stats:
cache directory: build\.build_cache
cache hit rate: 100%
cache hit: 1
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0

[100%]: build ok, spent 0.296s
@ifarbod ifarbod added the bug label Feb 26, 2024
@ifarbod
Copy link
Contributor Author

ifarbod commented Feb 26, 2024

This line should be fixed I think:

toolchain:set("toolset", "strip", gcc_toolchain_bin and path.join(gcc_toolchain_bin, cross .. "strip") or (cross .. "strip"))

toolchain:set("toolset", "strip", gcc_toolchain_bin and path.join(gcc_toolchain_bin, cross .. "strip") or (cross .. "strip"), "llvm-strip")

@ifarbod
Copy link
Contributor Author

ifarbod commented Feb 26, 2024

Yeah, that's correct, I'll submit a PR.

checking for Android SDK directory ... C:\Users\iFarbod\AppData\Local\Android\Sdk
checking for Build Tools Version of Android SDK ... 34.0.0
checking for NDK directory ... C:\Users\iFarbod\AppData\Local\Android\Sdk\ndk\26.1.10909125
checking for SDK version of NDK ... 21
[ 25%]: cache compiling.release src\native_lib.cpp
[ 50%]: linking.release libmyapplicationcpp2.so
[ 50%]: generating.release myapplicationcpp2.sym
[100%]: build ok, spent 0.828s

@waruqi waruqi added this to the v2.8.8 milestone Feb 26, 2024
@waruqi
Copy link
Member

waruqi commented Feb 27, 2024

thanks

@waruqi waruqi closed this as completed Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants