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

how to generate executable file #108

Open
zcy618 opened this issue Aug 27, 2018 · 0 comments
Open

how to generate executable file #108

zcy618 opened this issue Aug 27, 2018 · 0 comments

Comments

@zcy618
Copy link

zcy618 commented Aug 27, 2018

hi all:
I meet one strange issue, I write one demo code with cpp and aarch64 asm, my cmakelists.txt is as below:
cmake_minimum_required(VERSION 3.6)

set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 21) # API level
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(CMAKE_ANDROID_NDK /home/chenyuz/android-ndk)
set(CMAKE_ANDROID_STL_TYPE gnustl_static)

PROJECT(test_hello LANGUAGES C CXX ASM VERSION 0.1)

find_package(Threads)

INCLUDE_DIRECTORIES(
inc
)

AUX_SOURCE_DIRECTORY(src Source)

list(APPEND Source src/rsCpuIntrinsics_advsimd_Resize.S)

add_executable(${PROJECT_NAME} ${Source})

target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT})

TARGET_LINK_LIBRARIES(${PROJECT_NAME} m)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} log)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} c)

Then I run:
chenyuz@chenyuz-youdao:~/Youdao/Aarch64_unittest/build$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/chenyuz/android-ndk/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI=arm64-v8a .. -- The ASM compiler identification is Clang -- Found assembler: /home/chenyuz/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- Check for working C compiler: /home/chenyuz/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- Check for working C compiler: /home/chenyuz/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /home/chenyuz/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- Check for working CXX compiler: /home/chenyuz/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /home/chenyuz/Youdao/Aarch64_unittest/build chenyuz@chenyuz-youdao:~/Youdao/Aarch64_unittest/build$ make Scanning dependencies of target test_hello [ 50%] Building CXX object CMakeFiles/test_hello.dir/jni/test-asm.cpp.o [100%] Linking CXX executable test_hello [100%] Built target test_hello chenyuz@chenyuz-youdao:~/Youdao/Aarch64_unittest/build$ file test_hello test_hello: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=e12c6117eba88c1c844d719d6707a5ef48d233de, not stripped chenyuz@chenyuz-youdao:~/Youdao/Aarch64_unittest/build$

as you see, it is generated as shared object, not executable file. I already use add_executable() function, so I am really wonderring how to generate one executable file, it already tormented some days, I really need your help!

Thanks in advanced!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant