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

arm-linux-musleabi mpcorenovfp target won't compile/bootstrap with zig 0.9.0 #11717

Closed
lancethepants opened this issue Dec 29, 2021 · 9 comments
Labels
arch-arm 32-bit ARM bug Observed behavior contradicts documented or intended behavior 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. zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@lancethepants
Copy link

Since zig 0.7.x I've been able to compile/bootstrap for "-target arm-linux-musleabi -mcpu=mpcorenovfp" (armv7 Cortex-A9 no fpu).
I seem to be getting an error while compilling musl. I've attached the files from the zig diagnostic message.

sqrtf-6046a3.zip

@nektro
Copy link
Contributor

nektro commented Jan 8, 2022

please paste the stack trace text here on github. use 3 ` chars to make a block like so

```
```

@lancethepants
Copy link
Author

$ zig cc -target arm-linux-musleabi -mcpu=mpcorenovfp hello.c -o hello
zig: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 81f0e6c5b902ead84753490db4f0007d08df964a)
Target: arm-unknown-linux-musleabi
Thread model: posix
InstalledDir: /home/lance
zig: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
zig: note: diagnostic msg: /tmp/sqrtf-acce59.c
zig: note: diagnostic msg: /tmp/sqrtf-acce59.sh
zig: note: diagnostic msg:

********************

Here's the output I get, probably not what you're asking for, but easily reproducible with
zig cc -target arm-linux-musleabi -mcpu=mpcorenovfp hello.c -o hello

@lancethepants
Copy link
Author

The same issues can also be observed with -mcpu=generic+v6kz which is an example in the README.

@andrewrk andrewrk transferred this issue from ziglang/zig-bootstrap May 25, 2022
@andrewrk
Copy link
Member

This is a crash in clang 13. Next step to solving this issue is to repro the issue with clang master branch, then file an upstream LLVM bug.

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior upstream An issue with a third party project that Zig uses. arch-arm 32-bit ARM zig cc Zig as a drop-in C compiler feature contributor friendly This issue is limited in scope and/or knowledge of Zig internals. labels May 25, 2022
@andrewrk andrewrk added this to the 0.12.0 milestone May 25, 2022
@vesim987
Copy link
Contributor

vesim987 commented Aug 2, 2022

I think this issue is related to: #10961

@lancethepants
Copy link
Author

lancethepants commented Aug 3, 2022

Yes, I believe it is the same problem. Pulling from that issue, if I compile with
"-target arm-linux-musleabi -mcpu=mpcorenovfp+soft_float"
then I get a working binary under zig 0.9.1.

I can also bootstrap 0.9.1 using "./build -j4 arm-linux-musleabi mpcorenovfp+soft_float"

When I try to bootstrap HEAD from https://github.com/ziglang/zig-bootstrap I get the following which says libc++ does not work on multi-threaded ARM yet and mentions #6573 . HEAD seems to carry a patch mentioned in that issue, so not sure why I'm seeing this error

-- Check for working CXX compiler: /home/lance/zig-bootstrap/out/host/bin/zig
-- Check for working CXX compiler: /home/lance/zig-bootstrap/out/host/bin/zig -- broken
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:45 (message):
  The C++ compiler

    "/home/lance/zig-bootstrap/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_ceb97/fast"
    /usr/bin/make -f CMakeFiles/cmTC_ceb97.dir/build.make CMakeFiles/cmTC_ceb97.dir/build
    make[1]: Entering directory '/home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_ceb97.dir/testCXXCompiler.cxx.o
    /home/lance/zig-bootstrap/out/host/bin/zig  c++ -fno-sanitize=all -s -target arm-linux-musleabi -mcpu=mpcorenovfp+soft_float     -o CMakeFiles/cmTC_ceb97.dir/testCXXCompiler.cxx.o -c /home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    warning(compilation): libc++ does not work on multi-threaded ARM yet.
    For more details: https://github.com/ziglang/zig/issues/6573
    error: unable to create compilation: TargetRequiresSingleThreaded
    make[1]: *** [CMakeFiles/cmTC_ceb97.dir/build.make:66: CMakeFiles/cmTC_ceb97.dir/testCXXCompiler.cxx.o] Error 1
    make[1]: Leaving directory '/home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_ceb97/fast] Error 2




  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:49 (project)


-- Configuring incomplete, errors occurred!
See also "/home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeOutput.log".
See also "/home/lance/zig-bootstrap/out/build-llvm-arm-linux-musleabi-mpcorenovfp+soft_float/CMakeFiles/CMakeError.log".

@ghost
Copy link

ghost commented Oct 9, 2023

zig.exe c++ -target arm-linux-gnueabi -O1 hello.cpp

crashes during the build of the needed libraries (running on Windows)

I.e. last output on the console is e.g.:

Compile C Objects [12/19]   

and the crash is observed (the first number varies).

Tried with
0.12.0-dev.817+54e7f58fc and
0.11.0

(Note: Without -O option there's no crash, i.e.:

zig c++ -target arm-linux-gnueabi  hello.cpp

compiles. There's also no crash when C and not C++, i.e:

zig cc -target arm-linux-gnueabi -O1 hello.c 

compiles.)

(I don't know if this observation belongs here, I hope it does)

@alexrp
Copy link
Member

alexrp commented Aug 28, 2024

This no longer reproduces for me.

@alexrp
Copy link
Member

alexrp commented Oct 2, 2024

❯ ./build arm-linux-musleabi mpcorenovfp
❯ qemu-arm -cpu arm11mpcore,vfp=off ./out/zig-arm-linux-musleabi-mpcorenovfp/zig version
0.14.0-dev.1622+2ac543388

@alexrp alexrp closed this as completed Oct 2, 2024
@alexrp alexrp modified the milestones: 0.16.0, 0.14.0 Dec 8, 2024
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 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. zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

No branches or pull requests

5 participants