Forums - unrecognised emulation mode: armelf_linux_eabi

2 posts / 0 new
Last post
unrecognised emulation mode: armelf_linux_eabi
Join Date: 18 Oct 19
Posts: 2
Posted: Mon, 2020-02-10 18:35

Hi, all

I want to build a simple C code like "Hello World" and run it on the Snapdagon 855 Android.

I folowed the instructions of the LLVM

I have android-ndk-r17 with the Snapdragon LLVM ARM Compiler 6.0.2 for Android NDK  installed in it.

The detail is:

Windows (64-bit) ;

Cygwin-x86_64;      which path is: C:\cygwin64

android-ndk-r17;       which path is:C:\android-ndk-r17


My main issue is the how to compile and link. My command  is:

/cygdrive/c/android-ndk-r17/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -nostdlib -march=armv7-a -mcpu=cortex-a8 -marm --target=arm-linux-androideabi -gcc-toolchain C:\\android-ndk-r17\\toolchains\\arm-linux-androideabi-4.9\\prebuilt\\linux-x86_64 --sysroot=C:\\android-ndk-r17\\sysroot\\usr\\lib hello.c -o hello.exe -I C:\\android-ndk-r17\\sysroot\\usr\\include -I C:\\android-ndk-r17\\sources\\cxx-stl\\llvm-libc++\\include -I C:\\android-ndk-r17\\sysroot\\usr\\include\\arm-linux-androideabi -v -lc

Then I got errors:

/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi 

Supported emulations: i386pep i386pe


I tried command below which is only added by "-fuse-ld=qcld":

/cygdrive/c/android-ndk-r17/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe ... -v -fuse-ld=qcld -lc


Then I got errors:

Fatal: cannot recognize namespec -lc
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)

I think there is someting error about linker, can anyone give me some help, thanks a lot!!!!


  • Up0
  • Down0
Join Date: 18 Oct 19
Posts: 2
Posted: Mon, 2020-02-10 23:00
someone said the output is coming from /usr/bin/ld, which is the system ld, rather than the ld included with the NDK. I don't know why this ld  is being executed instead, can anyone give me some help, thanks a lot!
I tried command " ld -v" in Cygwin, Then I got:
GNU ld (GNU Binutils)
I tried command below:
C:\android-ndk-r17\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\ld.exe -v
Then I got:
GNU ld (binutils-2.27-bf0c2e88)


  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.