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 on x86 macOS using LLVM 17.0.6 #209

Closed
Colerar opened this issue Mar 26, 2024 · 4 comments
Closed

Unable to build on x86 macOS using LLVM 17.0.6 #209

Colerar opened this issue Mar 26, 2024 · 4 comments

Comments

@Colerar
Copy link

Colerar commented Mar 26, 2024

~/Developer/blst master
❯ bash build.sh
+ /usr/local/opt/llvm/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./src/server.c
+ /usr/local/opt/llvm/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./build/assembly.S
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:1526:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:5594:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:5725:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:5865:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6011:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6152:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6384:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6584:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6646:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:6982:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:7065:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:7197:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:7670:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:7742:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:7832:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:8284:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:8483:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:8550:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:8817:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-ef5665.s:8894:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
+ llvm-ar rc libblst.a server.o

~/Developer/blst master
❯ clang --version
Homebrew clang version 17.0.6
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

Also cannot builds with LLVM 18:

Console Logs
~/Developer/blst master
❯ bash build.sh
+ /usr/local/opt/llvm/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./src/server.c
+ /usr/local/opt/llvm/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./build/assembly.S
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:1526:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:5594:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:5725:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:5865:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6011:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6152:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6384:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6584:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6646:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:6982:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:7065:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:7197:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:7670:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:7742:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:7832:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:8284:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:8483:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:8550:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:8817:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
/var/folders/x9/jkf9hx9j0y31j5b27wzjx1pr0000gp/T/assembly-f60248.s:8894:1: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset 8
^
+ llvm-ar rc libblst.a server.o

~/Developer/blst master
❯ clang --version
Homebrew clang version 18.1.4
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
@Colerar
Copy link
Author

Colerar commented Mar 26, 2024

But I can build blst successfully with LLVM 16.

~/Developer/blst master*
❯ bash build.sh
+ /usr/local/opt/llvm@16/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./src/server.c
+ /usr/local/opt/llvm@16/bin/clang -O2 -fno-builtin -fPIC -Wall -Wextra -Werror -D__ADX__ -c ./build/assembly.S
+ llvm-ar rc libblst.a assembly.o server.o

~/Developer/blst master*
❯ clang --version
Homebrew clang version 16.0.6
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm@16/bin

I guess this post is related:

https://users.rust-lang.org/t/compiling-inline-asm-with-1-73-0-error-invalid-cfi-advance-loc-expression/101189

Because Rust 1.73.0 also upgrades LLVM to 17.

@tersec
Copy link

tersec commented Apr 24, 2024

Seeing this as well.

@dot-asm
Copy link
Collaborator

dot-asm commented Apr 29, 2024

The problem turns out to be that newer clang, non-Apple build[!?], gets disoriented by labels with dollars in their names. This sounds like a bug, a new one, because for example clang 10, 14, 15, 16 have no problem compiling assembly.S. In which case wouldn't it be more appropriate to say that it's an llvm problem, not blst? As for non-Apple clang build, the latest Apple build appears to be 15, so one can argue that it's not impossible that the problem surfaces down the path even with Apple-provided toolchain... For reference, it doesn't seem to be something homebrew missed when compiling it, because I can reproduce it even on Linux with --target=darwin-x86_64...

@Colerar
Copy link
Author

Colerar commented Apr 29, 2024

So maybe it's a good idea to report this issue to LLVM?

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

3 participants