You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building binaries (seemingly when they are large) a value in ELF section OPENBSD_RANDOM exceeds a kernel limit. According to attached report it is a clang bug and it makes zig0 fail to execute:
cannot allocate memory: zig0
The same error is produced running any llvm-10/bin/ executables if you roll your own for zig.
so sysupgrade -s to snapshot, rebuilding llvm10 and zig fixes that issue...
Out of curiosity, how did you go about building LLVM 10? Did you apply any patches? If I'm looking in the right place, it seems the latest LLVM in ports is version 8.
Out of curiosity, how did you go about building LLVM 10? Did you apply any patches? If I'm looking in the right place, it seems the latest LLVM in ports is version 8.
Rolled my own build from llvm's github repository and install to some random location like /opt/llvm-10.0.0 and point zig's cmake setup to that location.
Thanks so much for the link to your script. For posterity: I'm also on -current and I was able to build after installing the libexecinfo port and prepending CPATH=/usr/local/include and LIBRARY_PATH=/usr/local/lib.
This is either directly related to openbsd default ulimit settings or something else was fixed in OpenBSD 6.8 .
To get zig building on OpenBSD 6.8, bring-your-own LLVM and set ulimit for 10 GB memory and maybe more stack for zig stage1 to be able to build zig1.o and run larger tests. The default on openbsd is very low, around 1.5 GB.
Activity
mikdusan commentedon Mar 25, 2020
incidentally, simple patch to get
zig0building:mikdusan commentedon Mar 25, 2020
so
sysupgrade -sto snapshot, rebuilding llvm10 and zig fixes that issue...but now another problem: OpenBSD is just about the only OS that does not support getting absolute path of current-process' executable. grrr....
jreut commentedon Mar 26, 2020
Out of curiosity, how did you go about building LLVM 10? Did you apply any patches? If I'm looking in the right place, it seems the latest LLVM in ports is version 8.
mikdusan commentedon Mar 26, 2020
Rolled my own build from llvm's github repository and install to some random location like
/opt/llvm-10.0.0and point zig'scmakesetup to that location.I posted the scripts I used in this tiny repo https://github.com/mikdusan/zig.llvm10 and in its readme there is currently a gdrive link for binary tarballs. Weird that openbsd binaries are so much larger, but I haven't had time to find out why.
jreut commentedon Mar 28, 2020
Thanks so much for the link to your script. For posterity: I'm also on -current and I was able to build after installing the libexecinfo port and prepending
CPATH=/usr/local/includeandLIBRARY_PATH=/usr/local/lib.mikdusan commentedon Mar 22, 2021
solved:
This is either directly related to openbsd default ulimit settings or something else was fixed in OpenBSD 6.8 .
To get zig building on OpenBSD 6.8, bring-your-own LLVM and set ulimit for 10 GB memory and maybe more stack for zig stage1 to be able to build
zig1.oand run larger tests. The default on openbsd is very low, around 1.5 GB.