Skip to content

v0.10.0 panic with message TODO implement bigint to llvm int for 32-bit compiler builds #13722

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
prajwalch opened this issue Dec 1, 2022 · 12 comments
Labels
bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@prajwalch
Copy link

Zig Version

0.10.0

Steps to Reproduce and Observed Behavior

Got this error when i tried new version:

$ zig run main.zig

warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.

thread 14753 panic: TODO implement bigint to llvm int for 32-bit compiler builds

And this when using fstage1

$ zig run main.zig -fstage1
warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.

...

Code Generation [1417/1224] compiler_rt.float_to_iCode Generation [1435/1224] compiler_rt.count0bits
Code Generation [1451/1224] compiler_rt.shift.lshrCode Generation [1497/1224] compiler_rt.mulf3.wide
Code Generation [1536/1224] compiler_rt.rem_pio2_lLLVM Emit Object... PromoteFloatResult #0: t5: f16 = freeze t4
Do not know how to promote this operator's result!
UNREACHABLE executed at /Users/andy/dev/zig-bootstrap/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:2247!                                      fish: Job 1, 'zig run main.zig -fstage1' terminated by signal SIGABRT (Abort)

Expected Behavior

Compiles successfully

@prajwalch prajwalch added the bug Observed behavior contradicts documented or intended behavior label Dec 1, 2022
@nektro
Copy link
Contributor

nektro commented Dec 1, 2022

what are the contents of main.zig ?

@prajwalch
Copy link
Author

what are the contents of main.zig ?

Simple hello world

@prajwalch
Copy link
Author

Here is the screenshot:
main.zig
Screenshot_2022-12-01-12-00-26-1

And command:
Screenshot_2022-12-01-12-01-57-1

@Vexu Vexu added the frontend Tokenization, parsing, AstGen, Sema, and Liveness. label Dec 1, 2022
@Vexu Vexu added this to the 0.11.0 milestone Dec 1, 2022
@frett27
Copy link

frett27 commented Dec 12, 2022

faced similar issue , on x64_linux using nix for building, also using the -fstage1

warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.

and the result binary is not usable, seems the linker is not found and exe is not properly linked, with half the size

compiled with nix build (using zig build -stage1) --- BAD ---:
use@alexa:~/iotmonitor$ ll /nix/store/c7m0v73mxa4rp3ls5h0wjf0yhvdvcnw5-iotmonitor/bin/iotmonitor
-r-xr-xr-x 1 use use 1193848 janv. 1 1970 /nix/store/c7m0v73mxa4rp3ls5h0wjf0yhvdvcnw5-iotmonitor/bin/iotmonitor*

compiled with zig build -fstage1 -- GOOD--
use@alexa:~/iotmonitor$ ll bin/iotmonitor
-rwxr-xr-x 1 use use 2080496 déc. 12 00:50 bin/iotmonitor*

use@alexa:~/iotmonitor$ ldd /nix/store/c7m0v73mxa4rp3ls5h0wjf0yhvdvcnw5-iotmonitor/bin/iotmonitor
linux-vdso.so.1 (0x00007ffd958cd000)
libleveldb.so.1 => /nix/store/9k36srn15kp78r1h8hsp564g5lbd320q-leveldb-1.23/lib/libleveldb.so.1 (0x00007fd46215a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd461efa000)
/lib/ld-musl-x86_64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x00007fd4621b8000)
libsnappy.so.1 => /nix/store/gngsj028vhhh4j1nym46wz28fj3lyzk6-snappy-1.1.9/lib/libsnappy.so.1 (0x00007fd461eec000)
libstdc++.so.6 => /nix/store/g9x3cm8wdmpm86pyiff6arx8skmdwkn7-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007fd461cd9000)
libm.so.6 => /nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libm.so.6 (0x00007fd461bfe000)
libgcc_s.so.1 => /nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libgcc_s.so.1 (0x00007fd461be4000)

use@alexa:~/iotmonitor$ ldd bin/iotmonitor
linux-vdso.so.1 (0x00007ffe1d5d9000)
libleveldb.so.1 => /nix/store/9k36srn15kp78r1h8hsp564g5lbd320q-leveldb-1.23/lib/libleveldb.so.1 (0x00007f666b0b2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f666ae52000)
/lib64/ld-linux-x86-64.so.2 (0x00007f666b110000)
libsnappy.so.1 => /nix/store/gngsj028vhhh4j1nym46wz28fj3lyzk6-snappy-1.1.9/lib/libsnappy.so.1 (0x00007f666ae44000)
libstdc++.so.6 => /nix/store/g9x3cm8wdmpm86pyiff6arx8skmdwkn7-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007f666ac2f000)
libm.so.6 => /nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libm.so.6 (0x00007f666ab56000)
libgcc_s.so.1 => /nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libgcc_s.so.1 (0x00007f666ab3c000)

@frett27
Copy link

frett27 commented Dec 13, 2022

seems related to #12156

@andrewrk andrewrk added the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label Apr 18, 2023
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Apr 18, 2023
@ilmanzo
Copy link

ilmanzo commented Jul 7, 2023

same behavior on a 32bit Debian netbook

$ uname -a                                                                                                                                                                                                                    
Linux q4os-desktop 5.10.0-23-686-pae #1 SMP Debian 5.10.179-1 (2023-05-12) i686 GNU/Linux

$ zig version                                                                                                                                                                                                                     
0.11.0-dev.3942+49ac816e3

$ mkdir test; cd test

$ zig init-exe
info: Created build.zig
info: Created src/main.zig
info: Next, try `zig build --help` or `zig build run`

$ zig build run
thread 3315 panic: TODO implement bigint to llvm int for 32-bit compiler builds
Unable to dump stack trace: debug info stripped
[1]    3315 abort      zig build run

@matu3ba
Copy link
Contributor

matu3ba commented Jul 23, 2023

I can not find the related TODO anymore and armv7 is provided as download option https://ziglang.org/download/, so I think this should be closed.

@ilmanzo
Copy link

ilmanzo commented Jul 23, 2023

Hello, thanks! I can confirm that on 32-bit i386 linux it's fixed

$ uname -a                                                                                                                                                                                                                    
Linux q4os-desktop 5.10.0-23-686-pae #1 SMP Debian 5.10.179-1 (2023-05-12) i686 GNU/Linux

$ zig version                                                                                                                                                                                                                     
0.11.0-dev.4187+1ae839cd2

$ mkdir test; cd test

$ zig init-exe
info: Created build.zig
info: Created src/main.zig
info: Next, try `zig build --help` or `zig build run`

$ zig build run
All your codebase are belong to us.


@ifreund ifreund closed this as completed Jul 23, 2023
@ifreund ifreund modified the milestones: 0.13.0, 0.11.0 Jul 23, 2023
@koljakube
Copy link

I am still running into this, while compiling zls using the latest (armv7a-0.12.0-dev.589+731fd217d) Zig build.

This is on a Raspberry Pi 4: Linux phanpy 6.1.47-1-rpi-ARCH #1 SMP Fri Aug 25 13:19:49 MDT 2023 armv7l GNU/Linux

@matu3ba
Copy link
Contributor

matu3ba commented Sep 26, 2023

@koljakube The current version is in the range of "version": "0.12.0-dev.4922+c481510c9", which is ca. 4500 commits later than your mentioned commit.

rg -F 'TODO implement bigint to llvm int' has no results. Neither rg 'bigint to llvm'.

@leecannon
Copy link
Contributor

@matu3ba the latest version on ziglang.org is zig-0.12.0-dev.589+731fd217d

@koljakube
Copy link

I just noticed I was wrong and did not properly compare error messages.

I am running into "TODO implement bigint debug enumerators to llvm int for 32-bit compiler builds", which is defined here (and is still in master).

Please disregard my previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

No branches or pull requests

10 participants