Skip to content

Compiling for arm-linux-gnueabihf with libc linked failed #9552

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

Closed
ikskuh opened this issue Aug 12, 2021 · 2 comments
Closed

Compiling for arm-linux-gnueabihf with libc linked failed #9552

ikskuh opened this issue Aug 12, 2021 · 2 comments

Comments

@ikskuh
Copy link
Contributor

ikskuh commented Aug 12, 2021

I wanted to cross-compile a project using libc to a arm platform, but it looks like glibc is broken, it fails with the following error message:

error(compilation): clang failed with stderr: In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/crti.S:44:
In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h:25:
In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/unix/arm/sysdep.h:19:
./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/sysdep.h:25:11: fatal error: 'arm-features.h' file not found

error(compilation): ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/crti.S:1:1: unable to build C object: clang exited with code 1
error(compilation): clang failed with stderr: In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/crtn.S:38:
In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h:25:
In file included from ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/unix/arm/sysdep.h:19:
./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/sysdep.h:25:11: fatal error: 'arm-features.h' file not found

error(compilation): ./zig-linux-x86_64-0.9.0-dev.771+493822ac3/lib/zig/libc/glibc/sysdeps/arm/crtn.S:1:1: unable to build C object: clang exited with code 1
thread 1658133 panic: reached unreachable code
???:?:?: 0x555acba76468 in ??? (???)
???:?:?: 0x555acbe790c2 in ??? (???)
???:?:?: 0x555acbe5f3f2 in ??? (???)
???:?:?: 0x555acbc019b5 in ??? (???)
???:?:?: 0x555acbbf062d in ??? (???)
???:?:?: 0x555acbbe9fef in ??? (???)
???:?:?: 0x555acbb7e2bf in ??? (???)
???:?:?: 0x555acbaacce7 in ??? (???)
???:?:?: 0x555acba812b7 in ??? (???)
???:?:?: 0x555acba80cf9 in ??? (???)
???:?:?: 0x7f7e0cab5b24 in ??? (???)

The file compiled to produce this error is this:

pub fn main() void { }

The error happens when compiling with the following commands:

zig build-exe -lc test.zig -target arm-linux-gnueabi
zig build-exe -lc test.zig -target arm-linux-gnueabihf
zig build-exe -lc test.zig -target thumb-linux-gnueabi
zig build-exe -lc test.zig -target thumb-linux-gnueabihf

but not when compiling for musl:

zig build-exe -lc test.zig -target thumb-linux-musleabi
# … didn't try on that specific commit, but worked previously

Is this an already known problem?

@alexrp
Copy link
Member

alexrp commented Aug 12, 2021

Duplicate of #3287.

@ikskuh
Copy link
Contributor Author

ikskuh commented Aug 12, 2021

Thanks!

@ikskuh ikskuh closed this as completed Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants