October 22, 2024
Chicago 12, Melborne City, USA
C++

Unable to cross compile simple C program using clang and lld


$ cat hello.c
int main ()
{
        return 0;
}
$ clang -fuse-ld=lld -target ppc64le hello.c -o hello.o
ld.lld: error: /tmp/hello-37cf01.o is incompatible with elf64-x86-64
collect2: error: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)

Simple compiling and "not" linking step works just fine.
It’s when I try to link it fails.

Output of host arch: x86_64

Target arch: ppc64le



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video