- Edited
giuliomoro first step fails.
gary@audio-workstation:~/test$ clang++-3.9-arm -march=armv7-a -mfpu=vfp3 -fasynchronous-unwind-tables -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -std=c++11 -Wno-varargs -Wall -c -fmessage-length=0 -o ./test.o ./test.ii
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gary@audio-workstation:~/test$ cat test.ii
int func()
{
return 0;
}
gary@audio-workstation:~/test$
gary@audio-workstation:~/test$ which clang++-3.9-arm
/usr/local/bin/clang++-3.9-arm
gary@audio-workstation:~/test$ cat /usr/local/bin/clang++-3.9-arm
#!/bin/bash
/usr/bin/clang++-3.9 -target armv7l-unknown-linux-gnueabihf --sysroot ~/arm $0
gary@audio-workstation:~/test$ clang++-3.9-arm
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gary@audio-workstation:~/test$
Calling that compiler throws the error with no parameters given at all! [edit - it's calling the script which does add parameters] So maybe that is broken somehow. I used apt to install it.
gary@audio-workstation:~/test$ sudo apt list | grep ^clang-3.9
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
clang-3.9/bionic,now 1:3.9.1-19ubuntu1 amd64 [installed]
clang-3.9-doc/bionic,bionic 1:3.9.1-19ubuntu1 all
clang-3.9-examples/bionic 1:3.9.1-19ubuntu1 amd64
gary@audio-workstation:~/test$
gary@audio-workstation:~/test$ sudo dpkg -s clang-3.9
Package: clang-3.9
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 140661
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: llvm-toolchain-3.9
Version: 1:3.9.1-19ubuntu1
Replaces: clang-3.1, clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1), clang-include-fixer-3.9, compiler-rt
Provides: c++-compiler, c-compiler, objc-compiler
Depends: libc6 (>= 2.14), libclang1-3.9 (= 1:3.9.1-19ubuntu1), libgcc1 (>= 1:3.4), libjsoncpp1 (>= 1.7.4), libllvm3.9 (>= 1:3.9.1-6~), libstdc++6 (>= 5.2), libstdc++-7-dev, libgcc-7-dev, libobjc-7-dev, libclang-common-3.9-dev (= 1:3.9.1-19ubuntu1), libc6-dev, binutils
Recommends: llvm-3.9-dev, python
Suggests: gnustep, gnustep-devel, clang-3.9-doc
Breaks: clang-3.1, clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1), clang-include-fixer-3.9, compiler-rt
Description: C, C++ and Objective-C compiler (LLVM based)
Clang project is a C, C++, Objective C and Objective C++ front-end
for the LLVM compiler. Its goal is to offer a replacement to the GNU Compiler
Collection (GCC).
.
Clang fully implements all published ISO C++ standards including C++11, as
well as the upcoming C++14 standard, and some parts of the fledgling C++1z
standard, and is considered a production-quality C++ compiler.
Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Homepage: http://www.llvm.org/
gary@audio-workstation:~/test$
Some other random tests to see what exactly we are calling and the simplest command to generate the error.
gary@audio-workstation:~/test$ which clang++-3.9-arm
/usr/local/bin/clang++-3.9-arm
gary@audio-workstation:~/test$ cat /usr/local/bin/clang++-3.9-arm
#!/bin/bash
/usr/bin/clang++-3.9 -target armv7l-unknown-linux-gnueabihf --sysroot ~/arm $0
gary@audio-workstation:~/test$ /usr/bin/clang++-3.9
clang: error: no input files
gary@audio-workstation:~/test$ /usr/bin/clang++-3.9 -target armv7l-unknown-linux-gnueabihf
clang: error: no input files
gary@audio-workstation:~/test$ /usr/bin/clang++-3.9 -target armv7l-unknown-linux-gnueabihf ./test.ii
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gary@audio-workstation:~/test$ /usr/bin/clang++-6.0 -target armv7l-unknown-linux-gnueabihf ./test.ii
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gary@audio-workstation:~/test$ /usr/bin/clang++ -target armv7l-unknown-linux-gnueabihf ./test.ii
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gary@audio-workstation:~/test$