canselcik/libremarkable

demo not statically linked

fenollp opened this issue · 2 comments

Hi! Impressive work.

scp ./target/armv7-unknown-linux-gnueabihf/release/examples/demo remarkable:~/
demo                                                                                                                                                        100%   46MB   1.9MB/s   00:24    
ssh remarkable './demo'
./demo: /lib/libm.so.6: version `GLIBC_2.29' not found (required by ./demo)
./demo: /lib/libc.so.6: version `GLIBC_2.28' not found (required by ./demo)

Could this be the result of a misconfigured crosschain?

Note:

remarkable: ~/ ls -lh /lib/libc.* /lib/libm.*
lrwxrwxrwx    1 root     root          12 Mar 20 12:47 /lib/libc.so.6 -> libc-2.27.so
lrwxrwxrwx    1 root     root          12 Mar 20 12:47 /lib/libm.so.6 -> libm-2.27.so

I'm using the poky toolchain and xochitl v2.1.1.3

Linux remarkable 4.9.84-zero-gravitas #1 Thu Dec 5 18:14:12 UTC 2019 armv7l GNU/Linux

May be related:

cargo test
...
The following warnings were emitted during compilation:

warning: arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
warning: arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’

error: failed to run custom build command for `zstd-sys v1.4.15+zstd.1.4.4`

Caused by:
  process didn't exit successfully: `/home/pete/wefwefwef/libremarkable.git/target/debug/build/zstd-sys-ce019bd2cdc34e27/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = Some("arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = Some(" -O2 -pipe -g -feliminate-unused-debug-types ")
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,mmx,sse,sse2")
running: "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/zstd-sys-3232c15c86b145a4/out/zstd/lib/common/debug.o" "-c" "zstd/lib/common/debug.c"
cargo:warning=arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
exit code: 1
running: "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/zstd-sys-3232c15c86b145a4/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c"
cargo:warning=arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
exit code: 1

--- stderr


error occurred: Command "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/zstd-sys-3232c15c86b145a4/out/zstd/lib/common/debug.o" "-c" "zstd/lib/common/debug.c" with args "arm-poky-linux-gnueabi-gcc" did not execute successfully (status code exit code: 1).



warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
warning: arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’

error: failed to run custom build command for `lua52-sys v0.1.2`

Caused by:
  process didn't exit successfully: `/home/pete/wefwefwef/libremarkable.git/target/debug/build/lua52-sys-11a33f48b94948ea/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = Some("arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = Some(" -O2 -pipe -g -feliminate-unused-debug-types ")
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,mmx,sse,sse2")
running: "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "lua/src" "-DLUA_USE_LINUX" "-DLUA_COMPAT_ALL" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/lua52-sys-1b5c1376ec9eab0e/out/lua/src/lapi.o" "-c" "lua/src/lapi.c"
cargo:warning=arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
exit code: 1
running: "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "lua/src" "-DLUA_USE_LINUX" "-DLUA_COMPAT_ALL" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/lua52-sys-1b5c1376ec9eab0e/out/lua/src/lcode.o" "-c" "lua/src/lcode.c"
cargo:warning=arm-poky-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
exit code: 1

--- stderr


error occurred: Command "arm-poky-linux-gnueabi-gcc" "-march=armv7-a" "-marm" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9" "--sysroot=/opt/poky/2.1.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "lua/src" "-DLUA_USE_LINUX" "-DLUA_COMPAT_ALL" "-o" "/home/pete/wefwefwef/libremarkable.git/target/debug/build/lua52-sys-1b5c1376ec9eab0e/out/lua/src/lapi.o" "-c" "lua/src/lapi.c" with args "arm-poky-linux-gnueabi-gcc" did not execute successfully (status code exit code: 1).



warning: build failed, waiting for other jobs to finish...
error: build failed

Alright tests pass now (likely I misinstalled the nightly toolchain. Going through that issue comment linked on the readme an nth time seem to have fixed it).

WRT glibc: it seems I've hit rust-lang/rust#57497 (comment) which is fixed by building on an system with an older glibc. It seems weird that the host glibc version matters when crosscompiling no?

Solution: make run-docker !

This works beautifully. Thanks again.