Skip to content
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

unable to build musl for target armv8-linux-musleabihf #3286

Closed
andrewrk opened this issue Sep 22, 2019 · 2 comments
Closed

unable to build musl for target armv8-linux-musleabihf #3286

andrewrk opened this issue Sep 22, 2019 · 2 comments
Labels
arch-arm 32-bit ARM bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

I was adding test coverage for this but it regressed:

In file included from /home/andy/dev/zig/build/lib/zig/libc/musl/crt/crt1.c:2:
In file included from /home/andy/dev/zig/build/lib/zig/libc/musl/src/internal/libc.h:4:
In file included from /home/andy/dev/zig/build/lib/zig/libc/musl/src/include/stdlib.h:4:
/home/andy/dev/zig/build/lib/zig/libc/musl/src/include/../../include/stdlib.h:19:10: fatal error: 'bits/alltypes.h' file not found
#include <bits/alltypes.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.

The following command failed:
/home/andy/dev/zig/build/zig cc -MD -MV -MF /home/andy/.local/share/zig/stage1/tmp/X4L3BWvG_57H-crt1.o.d -nostdinc -fno-spell-checking -isystem /home/andy/dev/zig/build/lib/zig/include -target armv8.5a-unknown-linux-musleabihf -g -fno-omit-frame-pointer -D_DEBUG -fno-stack-protector -o /home/andy/.local/share/zig/stage1/tmp/X4L3BWvG_57H-crt1.o -c /home/andy/dev/zig/build/lib/zig/libc/musl/crt/crt1.c -std=c99 -ffreestanding -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I /home/andy/dev/zig/build/lib/zig/libc/musl/arch/arm -I /home/andy/dev/zig/build/lib/zig/libc/musl/arch/generic -I /home/andy/dev/zig/build/lib/zig/libc/musl/src/include -I /home/andy/dev/zig/build/lib/zig/libc/musl/src/internal -I /home/andy/dev/zig/build/lib/zig/libc/musl/include -I /home/andy/dev/zig/build/lib/zig/libc/include/arm-linux-musleabihf -I /home/andy/dev/zig/build/lib/zig/libc/include/generic-musl -Os -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-stack-protector -DCRT
The following command exited with error code 1:
/home/andy/dev/zig/build/zig test /home/andy/dev/zig/test/stage1/behavior.zig --library c --test-name-prefix behavior-arm-linux-musleabihf-Debug-c-multi  --cache-dir /home/andy/dev/zig/zig-cache --name test -target armv8_5a-linux-musleabihf --test-cmd qemu-arm --test-cmd-bin --override-std-dir /home/andy/dev/zig/std 
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. arch-arm 32-bit ARM labels Sep 22, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Sep 22, 2019
andrewrk added a commit that referenced this issue Sep 22, 2019
 * add zig build option `-Dskip-libc` to skip tests that build libc
   (e.g. if you don't want to wait for musl to build)
 * add `-Denable-wine` option which uses wine to run cross compiled
   windows tests on non-windows hosts
 * add `-Denable-qemu` option which uses qemu to run cross compiled
   foreign architecture tests
 * add `-Denable-foreign-glibc=path` option which combined with
   `-Denable-qemu` enables running cross compiled tests that link
   against glibc. See
   https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to
   produce this directory.
 * the test matrix is done manually. release test builds are only
   enabled by default for the native target. this should save us some CI
   time, while still providing decent coverage of release builds.
   - add test coverage for `x86_64-linux-musl -lc` (building musl libc)
   - add test coverage for `x86_64-linux-gnu -lc` (building glibc)
   - add test coverage for `aarch64v8_5a-linux-none`
   - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc)
   - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc)
   - add test coverage for `arm-linux-none`
   - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is
     disabled due to #3286
   - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled
     due to #3287
   - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is
     disabled due to #3285
 * enable qemu testing on the Linux CI job. There's not really a good
   reason to enable wine, since we have a Windows CI job as well.
 * remove the no longer needed `--build-file ../build.zig` from CI
   scripts
 * fix bug in glibc compilation where it wasn't properly reading the abi
   list txt files, resulting in "key not found" error.
 * std.build.Target gains:
   - isNetBSD
   - isLinux
   - osRequiresLibC
   - getArchPtrBitWidth
   - getExternalExecutor
 * zig build system gains support for enabling wine and enabling qemu.
   `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This
   communicates that the system has these tools installed and the build
   system will use them to run tests.
 * zig build system gains support for overriding the dynamic linker of
   an executable artifact.
 * fix std.c.lseek prototype. makes behavior tests for
   arm-linux-musleabihf pass.
 * disable std lib tests that are failing on ARM. See #3288, #3289
 * provide `std.os.off_t`.
 * disable some of the compiler_rt symbols for arm 32 bit. Fixes
   compiler_rt tests for arm 32 bit
 * add __stack_chk_guard when linking against glibc. Fixes std lib tests
   for aarch64-linux-gnu
 * workaround for "unable to inline function" using `@inlineCall`. Fixes
   compiler_rt tests for arm 32 bit.
@andrewrk
Copy link
Member Author

I fixed the original issue above, but there is another one remaining:

/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:23:6: error: invalid operand for instruction
        ldc p2, cr4, [ip], #48
            ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:33:7: error: invalid operand for instruction
        ldcl p1, cr10, [ip], #8
             ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:34:7: error: invalid operand for instruction
        ldcl p1, cr11, [ip], #8
             ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:35:7: error: invalid operand for instruction
        ldcl p1, cr12, [ip], #8
             ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:36:7: error: invalid operand for instruction
        ldcl p1, cr13, [ip], #8
             ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:37:7: error: invalid operand for instruction
        ldcl p1, cr14, [ip], #8
             ^
/home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s:38:7: error: invalid operand for instruction
        ldcl p1, cr15, [ip], #8
             ^

The following command failed:
/home/andy/dev/zig/build/zig cc -MD -MV -MF /home/andy/.local/share/zig/stage1/tmp/ClyqLMa5u-g--longjmp.o.d -nostdinc -fno-spell-checking -isystem /home/andy/dev/zig/build/lib/zig/include -target armv8.5a-unknown-linux-musleabihf -g -fno-omit-frame-pointer -D_DEBUG -fno-stack-protector -o /home/andy/.local/share/zig/stage1/tmp/ClyqLMa5u-g--longjmp.o -c /home/andy/dev/zig/build/lib/zig/libc/musl/src/setjmp/arm/longjmp.s -std=c99 -ffreestanding -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I /home/andy/dev/zig/build/lib/zig/libc/musl/arch/arm -I /home/andy/dev/zig/build/lib/zig/libc/musl/arch/generic -I /home/andy/dev/zig/build/lib/zig/libc/musl/src/include -I /home/andy/dev/zig/build/lib/zig/libc/musl/src/internal -I /home/andy/dev/zig/build/lib/zig/libc/musl/include -I /home/andy/dev/zig/build/lib/zig/libc/include/arm-linux-musl -I /home/andy/dev/zig/build/lib/zig/libc/include/generic-musl -Os -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Qunused-arguments -w

This is an upstream issue, but it is unclear whether it's musl or llvm that needs to be patched.

@andrewrk andrewrk added the upstream An issue with a third party project that Zig uses. label Sep 25, 2019
andrewrk added a commit that referenced this issue Sep 25, 2019
See #3286. The issue is not fully solved however because this has
uncovered another issue.
@andrewrk andrewrk removed contributor friendly This issue is limited in scope and/or knowledge of Zig internals. upstream An issue with a third party project that Zig uses. labels Sep 25, 2019
@andrewrk andrewrk changed the title unable to build musl for target armv8-linux-musleabihf std lib tests failing for target armv8-linux-musleabihf Sep 25, 2019
@andrewrk andrewrk changed the title std lib tests failing for target armv8-linux-musleabihf unable to build musl for target armv8-linux-musleabihf Sep 25, 2019
@andrewrk
Copy link
Member Author

Solved in f112e8a

@andrewrk andrewrk modified the milestones: 0.6.0, 0.5.0 Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm 32-bit ARM bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant