Skip to content

Tier System: x86_64-openbsd #2016

Closed
Closed

Description

@andrewrk

https://github.com/ziglang/zig/issues?q=is%3Aissue%20state%3Aopen%20label%3Aarch-x86_64%20label%3Aos-openbsd

Tier 1

  • All non-experimental language features are known to work correctly.
  • The compiler can generate machine code for this target without relying on LLVM.
    • Given the linker issues on other BSDs, it seems likely that there will be some issues here too.
  • The CI machines automatically run the module tests for this target on every push.

Tier 2

  • The standard library's cross-platform abstractions have implementations for this target.
  • This target has debug info capabilities and therefore produces stack traces on failed assertions and crashes.
  • libc is available for this target even when cross-compiling.
  • The CI machines automatically build the module tests for this target on every push.

Tier 3

  • The compiler can generate machine code for this target by relying on an external backend such as LLVM.
  • The linker can produce object files, libraries, and executables for this target.

Tier 4

  • The compiler can generate assembly or C source code for this target.

Activity

  1. added
    enhancement
    contributor friendly
    standard library
    stage1
    arch-x86_64
    os-openbsd
    on Feb 27, 2019
  2. added this to the 0.5.0 milestone on Feb 27, 2019
  3. andrewrk commented on Apr 29, 2019

    @andrewrk
    MemberAuthor

    Here is some partially finished code that one can use for inspiration: #1921

  4. modified the milestones: 0.5.0, 0.6.0 on Apr 30, 2019
  5. voutilad commented on Jun 25, 2019

    @voutilad

    FWIW, OpenBSD recently imported LLVM 8.0.0 into base: https://marc.info/?l=openbsd-cvs&m=156132754603489&w=2

    It's available now in the latest -current snapshots for anyone interested in this issue.

    Edit: SourceHut seems to have the latest release, but doesn't support -current snapshots, so anyone working on OpenBSD compatibility can't readily solve the CI needs until the next OpenBSD release later this year.

  6. modified the milestones: 0.6.0, 0.7.0 on Oct 17, 2019
  7. justjosias commented on Jul 22, 2020

    @justjosias
    Contributor

    I am willing to help out with OpenBSD support. I have looked through the previous PRs (particularly #5324), and would like to tackle it, getting Zig to even compile on OpenBSD and getting those changes merged into master.

  8. 18 remaining items

  9. vazub commented on Jan 3, 2023

    @vazub

    Looks like the fixes for the blockers have been merged @semarie

  10. andrewrk commented on Jan 3, 2023

    @andrewrk
    MemberAuthor

    but it is disabled due to too big memory requirement to build it from scratch

    In case you missed it, #6485 is resolved now :-)

  11. kuon commented on Feb 8, 2023

    @kuon
    Contributor

    I sadly do not have a lot of time to contribute code to this issue, but I'd like to let you know that we use OpenBSD quite a bit for servers and routers, and I'll be happy to help testing.

  12. LowByteFox commented on Aug 21, 2023

    @LowByteFox

    I am currently running OpenBSD 7.3-Current and I've tried to compile zig 0.11.0. It's not possible to compile getFdPath. Before I tried to compile zig @oven-sh uses but the stage 3 compiler was segfault-ing.

    What got me confusing is that on release notes of zig 0.11.0 under Tier 2, OpenBSD has ✅ but should have 📖 because it doesn't compile. I don't know if it got there by accident or you just cross-compiled it without being on OpenBSD, I don't know how you got it.

    If someone wants to compile it themselves, I provide llvm16 pre-built binary for amd64 OpenBSD 7.3-current in releases. I compiled it as zig's wiki tells me. + Don't forget to install it into /usr/local/llvm16

    Before compiling zig, edit /etc/login.conf and for staff increase datasize-cur to 6000M just so clang doesn't fail with Out of Memory error. Don't forget to log out and log in, the confirm it with uname -a under data

    My configure command was

    cmake .. -DZIG_STATIC_LLVM=ON -DZIG_STATIC_ZSTD=ON -DZIG_STATIC_ZLIB=ON -DZIG_USE_LLVM_CONFIG=OFF  -DCMAKE_PREFIX_PATH="/usr/local/llvm16;/usr/local"

    Then run make edit_cache and enter advanced mode
    under CMAKE_EXE_LINKER_FLAGS add -lexecinfo so when zig 2 will build it doesn't fail with missing backtrace

    Now you are good to go, the compilation should fail with
    image

    If anything, I can learn zig and try to fix std myself

    Update:
    I made very nasty fix
    image
    Just so i would test how far it would get and it got to
    image

  13. LowByteFox commented on Sep 4, 2023

    @LowByteFox

    I am back with more info, okay so I tried to cross compile simple hello world application. But it crashes with SIGSEGV

    I ssh mounted a computer running OpenBSD (You don't need to have a computer with OpenBSD. Just make QEMU VM, forward ssh port and mount / using sshfs) and modified output of zig libc just so it matches ssh root mount. Then I simply executed
    zig build --libc openbsdlibc.txt -Dtarget=x86_64-openbsd -Doptimize=ReleaseSmall

    Reason why ReleaseSmall is because it doesn't require the missing getcontext symbol and compiles. Then I just copied the output executable to the computer and executed it. It just segfaulted.

    It could either be because of the "nasty fix" or who knows what.
    I'll share my ktrace output here

    I could theoretically fork their libc, add own implementation for storing FDs and call it from zig and try that out, if it would work without breaking anything on the system itself, I would make the patch available on custom repo so users could patch libc and recompile it themselves. I wouldn't make PR back to OpenBSD because this would be home made fix.

    But then again, issue can be with something else

  14. rwsalie commented on Dec 29, 2023

    @rwsalie
    Contributor

    Found a little issue when std:Build.LibExeObjStep.linkSystemLibrary is used on OpenBSD with zig (master branch)

    idk for which reason that doesn't work well because every function used on Zig come from of a C Static/Dynamic library ( example SDL2/GL/X11...) are `undefined symbols

    Actually works if i used std:Build.LibExeObjStep.addObjectFile where i put the paths of the object (dynamic or not)

    PR : #18475

  15. added
    tier system
    on Nov 19, 2024
  16. changed the title [-]Tier 3 OpenBSD Support for x86_64[/-] [+]Tier 1 support for `x86_64-openbsd`[/+] on Dec 10, 2024
  17. changed the title [-]Tier 1 support for `x86_64-openbsd`[/-] [+]Tier System: `x86_64-openbsd`[/+] on Apr 26, 2025
  18. removed
    standard library
    on Apr 26, 2025
  19. removed
    contributor friendly
    on Oct 31, 2025
  20. removed this from the upcoming milestone on Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_64enhancementos-openbsdtier system

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions