clang++ cannot execute binary file: Exec format error

1,880 views
Skip to first unread message

Cary Cherng

unread,
Jun 1, 2015, 8:04:46 PM6/1/15
to native-cli...@googlegroups.com
As far as I can tell using
nacl_sdk/pepper_43/toolchain/linux_pnacl/bin/pnacl-clang++
eventually invokes 
nacl_sdk/pepper_43/toolchain/linux_pnacl/bin/clang
When I try to build the hello project I get the following error from make. Is there something obvious that I haven't done?

~/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin $ uname -a
Linux ccherng-NC696AA-ABA-SR5710Y 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:30:01 UTC 2014 i686 athlon i686 GNU/Linux

~/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin $ ./clang
-bash: ./clang: cannot execute binary file: Exec format error

~/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin $ file ./clang
./clang: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=bba62e8f19a10f7c4b694dfa68b939c3116efcdd, stripped

~/nacl_sdk/pepper_43/getting_started/part1 $ make
/home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin/pnacl-clang++ -o hello_tutorial.bc hello_tutorial.cc -O2 -I/home/ccherng/nacl_sdk/pepper_43/include -L/home/ccherng/nacl_sdk/pepper_43/lib/pnacl/Release -lppapi_cpp -lppapi
hello world/home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin/pnacl-clang++
[Errno 8] Exec format error
Command was: /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/bin/clang \
    --driver-mode=g++ \
    -emit-llvm \
    -c -O2 \
    -fno-vectorize \
    -fno-slp-vectorize \
    -fno-common \
    -pthread \
    -nostdinc \
    -target \
    le32-unknown-nacl \
    -I/home/ccherng/nacl_sdk/pepper_43/include \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/le32-nacl/usr/include \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/lib/clang/3.6.0/include \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/le32-nacl/include/c++/v1 \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/le32-nacl/include/c++/v1/arm-none-linux-gnueabi \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/le32-nacl/include/c++/v1/backward \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/le32-nacl/include \
    -isystem \
    /home/ccherng/nacl_sdk/pepper_43/toolchain/linux_pnacl/sdk/include \
    -xc++ \
    hello_tutorial.cc \
    -o /home/ccherng/nacl_sdk/pepper_43/getting_started/part1/hello_tutorial.bc---hello_tutorial.cc---.po
make: *** [hello_tutorial.bc] Error 1

Sam Clegg

unread,
Jun 1, 2015, 8:23:24 PM6/1/15
to native-cli...@googlegroups.com
Hi Cary,

It looks like you might be lacking 64-bit support in your kernel.
The clang compiler we ship in the linux SDK requires a 64-bit kernel
I'm afraid.

cheers,
sam
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at http://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages