2

When I compile linphone source code, error happened below. Can anybody tell me how to fix it. Thank you.

ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_i386 i386linux elf32_x86_64 elf_x86_64 elf_l1om elf_k1om i386pep i386pe
C compiler test failed.
CodeAlien
  • 766
  • 2
  • 7
  • 15
  • It looks like you're trying to use an x86 linker. How are you linking things in your makefile? Does the makefile refer to `ld` anywhere? – Michael Jan 25 '15 at 09:39
  • no, makefile doesn't contain any “ld”. I don't understand what does I am using an x86 linker mean. I was trying to compile linphone project which is open source, and the error happened. Could you please give me some advice. I am newer to compile ndk. Thank you. @Michael – CodeAlien Jan 25 '15 at 11:38
  • 1
    I'm also having this problem. Did you ever find a solution? – hacksoi Jan 03 '17 at 08:05

1 Answers1

2

In case anyone is as dumb as me, I was getting this error because, I assume, the linker it was trying to use didn't have execution permissions; in fact, a lot of things didn't have execution permissions. So I did a simple chmod -R +x * at the root of the NDK directory and that fixed it.

Also, if anyone has a more elegant solution, please tell me. For example, was I supposed to download the NDK from somewhere else other than their website? A package installation perhaps?

hacksoi
  • 1,301
  • 13
  • 23
  • For a GCC build I had only done the chmod on gcc, cpp, and g++. That said I'm getting this trying to compile with clang and chmod on clang and clang++ isn't working yet. – Brian S Jan 05 '18 at 17:35
  • I was trying to use the clang compiler and running `chmod +x clang` did not work. After doing it recursively in the NDK root folder, it worked. – Taimoor Ahmad Jan 19 '21 at 14:36
  • I am very new to linux env, could you please tell me what is the NDK directory ? I have the error in my case with `/usr/bin/ld` so i wonder what is the NDK if it's not this ? – Tom3652 Aug 10 '22 at 14:10