-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using musl-based toolchain #5
Comments
Using richfelker/musl-cross-make#90 as a base, the following TARGET = armv5-linux-musleabi
OUTPUT = /home/kuba/musl-ev3
BINUTILS_VER = 2.33.1
GCC_VER = 8.4.0
MUSL_VER = 1.2.0
GMP_VER = 6.1.2
MPC_VER = 1.1.0
MPFR_VER = 4.0.2
ISL_VER = 0.21
LINUX_VER = headers-4.19.88
COMMON_CONFIG += CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"
COMMON_CONFIG += --disable-nls
COMMON_CONFIG += --with-debug-prefix-map=$(CURDIR)=
GCC_CONFIG += --disable-libquadmath --disable-decimal-float --disable-fixed-point
GCC_CONFIG += --disable-libgomp --disable-libitm
GCC_CONFIG += --with-cpu=arm926ej-s --enable-lto
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-shared
MUSL_CONFIG += --disable-shared
TOOLCHAIN_CONFIG += --with-pkgversion="C4EV3.Toolchain musl-gcc 8.4.0" --with-bugurl="https://github.com/c4ev3/C4EV3.Toolchain/issues/new" |
Wow, it seems that even external toolchains could be used:
At least the Linux one works for me (if the final program is staticaly linked using |
Can you build something against the Linux v2.6.33-rc4 headers? I don't mind shipping musl instead as long it has the correct headers. But with your current setup, you can write code that compiles fine because the headers are there, but it will crash at runtime, because the old EV3 kernel doesn't support these interfaces. |
It seems that this could be done ad-hoc: https://www.openwall.com/lists/musl/2016/12/06/4 However apart from patches, the change to v2.6.33-rc4 should be relatively easy to make - it is just necessary to add the hash to the |
Hmmmm, it seems that the older kernel headers aren't going to work with musl 1.2.0 :/ The time64_t changes are new to musl 1.2.0, so downgrading to 1.1.24 may fix this (if we really need the old headers, or if we need them at all). I've been successful in building a portable Linux toolchain (using a portable portable-building toolchain) with the Hash file for the linux kernel sources: diff --git a/hashes/linux-2.6.33.tar.xz.sha1 b/hashes/linux-2.6.33.tar.xz.sha1
new file mode 100644
index 0000000..12b6fb6
--- /dev/null
+++ b/hashes/linux-2.6.33.tar.xz.sha1
@@ -0,0 +1 @@
+3e1993b30afc6c6f2d801942c88259b5e1626fa7 linux-2.6.33.tar.xz config.mak: #HOST = i686-linux-musl
TARGET = armv5-linux-musleabi
OUTPUT = /home/kuba/musl-ev3
BINUTILS_VER = 2.33.1
GCC_VER = 8.4.0
MUSL_VER = 1.2.0
GMP_VER = 6.1.2
MPC_VER = 1.1.0
MPFR_VER = 4.0.2
ISL_VER = 0.21
LINUX_VER = 2.6.33
COMMON_CONFIG += CC="i686-linux-musl-gcc -static --static" CXX="i686-linux-musl-g++ -static --static"
COMMON_CONFIG += CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"
COMMON_CONFIG += --disable-nls
COMMON_CONFIG += --with-debug-prefix-map=$(CURDIR)=
COMMON_CONFIG += --with-pkgversion="C4EV3.Toolchain musl-gcc 8.4.0" --with-bugurl="https://github.com/c4ev3/C4EV3.Toolchain/issues/new"
GCC_CONFIG += --disable-host-shared
GCC_CONFIG += --disable-libquadmath --disable-decimal-float --disable-fixed-point
GCC_CONFIG += --disable-libgomp --disable-libitm
GCC_CONFIG += --with-cpu=arm926ej-s --enable-lto
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-shared
MUSL_CONFIG += --disable-shared |
Hi all,
I've recently discovered musl and a simple script to build a musl-based toolchain: https://github.com/richfelker/musl-cross-make
I've tried building that toolchain for
armv5-linux-musleabi
and it successfully statically compiled EV3-API and a test program. The resulting program then ran on the brick OK.I think it might be worth looking into it as the toolchain setup looks much simpler - in the basic mode, it is just a single command (
make TARGET=armv5-linux-musleabi
).Best regards,
Jakub
The text was updated successfully, but these errors were encountered: