I have setup a new environment - it's a chroot containing Ubuntu 14.04 (trusty) in a Chromebook (Asus flip C100P - ARM based). I've got gcc and g++ installed. I created a simple "hello, world" program (test.c) and compiled it via:
gcc -o t.exe test.c
When I go to run ./t1.exe, I get the following:
bash: ./t.exe: Permission denied
Note that I was executing as root and the permissions on ./t.exe is set wide open (chmod 777, verified via ls -l).
So I tried determining what's wrong - here's what I've tried:
% file ./t.exe
./t.exe: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=82a6c6227e0f7171a68c71a74c6e6396e37e6675, not stripped
% ldd ./t.exe
not a dynamic executable
% readelf -d ./t.exe | grep NEEDED
0x00000001 (NEEDED) Shared library: [libc.so.6]
% dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii libc6:armhf 2.19-0ubuntu armhf Embedded GNU C Library: Shared li
% cat /etc/ld.so.conf.d/*
# Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/mesa-egl
/usr/lib/arm-linux-gnueabihf/mesa
/usr/lib/arm-linux-gnueabihf/libfakeroot
# libc default configuration
/usr/local/lib
% ls -l libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 19:37 libc.so.6 -> /lib/libc.so.6
% ls -l /usr/local/lib/libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 18:21 /usr/local/lib/libc.so.6 -> /lib/libc.so.6
% ls -l /usr/lib/libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 19:37 /usr/lib/libc.so.6 -> /lib/libc.so.6
% ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 34 Aug 12 18:11 /lib/libc.so.6 -> /lib/arm-linux-gnueabihf/libc.so.6
% ls -l /lib/arm-linux-gnueabihf/libc.so.6
lrwxrwxrwx 1 root root 12 May 26 07:55 /lib/arm-linux-gnueabihf/libc.so.6 -> libc-2.19.so
% ls -l /lib/arm-linux-gnueabihf/libc-2.19.so
-rwxr-xr-x 1 root root 902876 May 26 07:56 /lib/arm-linux-gnueabihf/libc-2.19.so
% objdump -a /lib/arm-linux-gnueabihf/libc-2.19.so
/lib/arm-linux-gnueabihf/libc-2.19.so: file format elf32-littlearm
/lib/arm-linux-gnueabihf/libc-2.19.so
% objdump -a ./t.exe
./t.exe: file format elf32-littlearm
./t.exe
% uname -a
Linux localhost 3.14.0 #1 SMP PREEMPT Tue Aug 2 21:07:06 PDT 2016 armv7l armv7l armv7l GNU/Linux
I suspect that I've got a borked toolchain, but I'm truly stumped at this point.
Does anyone have any ideas on what's going on here or how to proceed in finding the problem?
printf "#!/bin/bash\necho Hello Scripting!\n" > ./myTest.sh ; chmod 755 myTest.sh ; ./myTest.sh
. (I may have missed a;
or'
etc, but hopefully you get the idea). If this fails, then there is something wrong with permissions on you./
dir OR one of the directories "above" that. See stackoverflow.com/a/26718467/620097 for some ideas. Good luck. – shellter-march=i686
? It seems your binary is being generated for the Chromebook and not for the Ubuntu (you can try copying the executable to your Chromebook and it should run there, which confirms this). – Daniel