Closed mcandre closed 7 years ago
Ah, I see the workaround posted at https://github.com/Entware-ng/Entware-ng/issues/718#issuecomment-316780470 , that is, explicitly pass $CFLAGS
and $LDFLAGS
to gcc
. Stinks that explicit passing of $(CFLAGS)
and $(LDFLAGS)
to gcc
is required in Makefile's, but so be it, at least it works!
https://github.com/Entware-ng/Entware-ng/wiki/Using-gcc-(native-compilation) was published a couple of years ago.
Package: gcc
For existing package:
./hello not found
Platform:
Example hello.c:
Example entware setup, such as in Docker using the openwrt v12.09 rootfs tarball:
Then I run
gcc -o hello hello.c
, which produces a binary. I'm not 100% sure that thehello
binary produced correctly targets the x86-64 architecture.gcc -v
appears to be configured to produce x86-64 binaries by default. ldd from entware opkg can't read the binary, which usually indicates that a binary is targeting a different platform than what the host is capable of handling (just x86-64 in this case).readelf -d hello
shows the binary linking against libgcc, for what it's worth.And entware
file
thinks that the binary is x86-64, so I'm scratching my head why it won't run.