!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

267 Members
82 Servers

Load older messages


SenderMessageTime
21 Jun 2026
@llakala:matrix.orgllakalagives a really great perf diff02:15:50
22 Jun 2026
@flumf:honk.liflumffy joined the room.02:55:26
@flumf:honk.liflumffyo/03:00:21
@flumf:honk.liflumffy I've talked to John Ericson about getting the OpenBSD fixes packaged for a while now, but haven't had time to clean it up enough for nixpkgs (there's some ugly IFD and patches to the llvmPackages components). 03:02:01
@flumf:honk.liflumffyI'm not sure whether importing all of the upstream LLVM patches wholesale is the best approach; it does give us a compiler that's as close to what you would get on a native OpenBSD machine at the cost of some miscellaneous patches that are probably unneeded.03:04:25
@flumf:honk.liflumffy It also introduces a need to pass a __FakeBSD__ define into the LLVM build since some of the patches which are required for binaries that will execute properly have their changes gated with an __OpenBSD__ define, while others don't. 03:05:00
@qyliss:fairydust.spaceAlyssa RossFor other BSDs we have not patched compilers.07:52:48
@qyliss:fairydust.spaceAlyssa RossWhy do these patches need to be in Nixpkgs at all, rather than in LLVM upstream?07:52:58
@flumf:honk.liflumffyThe OpenBSD developers maintain a set of patches to the compiler for security reasons. I'm not sure if they've made any attempts at upstreaming said patches, nor am I sure they ever plan to.07:55:19
@flumf:honk.liflumffy (There are switches such as -fret-clean introduced, which OpenBSD uses when building libc past 7.7 or 7.8. Removing these switches is always an option, but there is still a requirement on the patches to the linker so that the compiled binaries actually run on a modern OpenBSD system, and I feel that preserving as much of their compiler as possible is optimal.) 07:56:30
@qyliss:fairydust.spaceAlyssa RossDoesn't sound at all optimal for me as an LLVM package maintainer07:56:47
@qyliss:fairydust.spaceAlyssa RossIf upstream LLVM cannot produce binaries that run on modern OpenBSD, I'm sure they'd be interested in patches that fix taht.07:57:12
@qyliss:fairydust.spaceAlyssa Ross * 07:57:14
@flumf:honk.liflumffyI'm not sure if upstream LLVM actually cares to support cross-compilation to OpenBSD, to my knowledge it's not exactly a supported configuration anywhere.07:59:45
@qyliss:fairydust.spaceAlyssa RossWouldn't it also be needed for native compilation using upstream LLVM?08:00:06
@flumf:honk.liflumffyI don't think upstream LLVM even works out of the box on OpenBSD anymore, last I checked ports had patches maintained for all (supported) major versions08:00:53
@qyliss:fairydust.spaceAlyssa RossThen maybe they'd be interested in patches to fix that08:01:21
@qyliss:fairydust.spaceAlyssa RossNixpkgs is not a collection of patches that people didn't feel like upstreaming08:01:34
@flumf:honk.liflumffySure, the patches are from the OpenBSD project proper (I've picked them from ports), which is why I figured they'd be applicable to the OpenBSD-specific parts of LLVM in nixpkgs08:02:12
@qyliss:fairydust.spaceAlyssa RossIt seems much worse for those patches to be copied into every package repository that wants to support OpenBSD, than for them to end up maintained as part of LLVM08:02:49
@flumf:honk.liflumffyUnderstood, thank you08:03:51
@flumf:honk.liflumffy Alyssa Ross: Is using an older version of LLVM an acceptable solution for the OpenBSD stdenv? (I've done more work on getting cross-compilation to work; binaries built with LLVM 19 and newer will run without any patches since upstream fixed the linker issue, though LLVM 21 results in a miscompilation in libc for reasons I don't understand yet.) 21:16:30
23 Jun 2026
@emilazy:matrix.orgemilyFWIW Apple ships a pretty divergent LLVM and we just use a vanilla LLVM on Darwin and it's fine01:01:14
@emilazy:matrix.orgemily(though not all of Apple's changes are FOSS so we don't have that much choice)01:01:31
@emilazy:matrix.orgemilywe used to have a lot of platform-specific default LLVM versions but equalized them a while back01:01:56
@emilazy:matrix.orgemilyit would be unfortunate to reintroduce them01:02:13
@emilazy:matrix.orgemilyif OpenBSD doesn't care about LLVM upstream and LLVM upstream doesn't care about OpenBSD that's a systemic problem that is going to hurt for providing OpenBSD support in Nixpkgs tbh :/01:02:50
@emilazy:matrix.orgemilyis this related to the license change stuff?01:03:28
@flumf:honk.liflumffyWhen I initially started the work on getting OpenBSD to play nicely with cross compiling it was when nixpkgs was still using LLVM 18 (which didn't support the various changes to required sections that OpenBSD had introduced). It seems this isn't an issue nowadays, so we can elide effectively all of the patches I was concerned about manually reviewing/maintaining.01:21:44
@flumf:honk.liflumffy I don't imagine upstream LLVM particularly cares for some of OpenBSD's patches (retguard, cleaning return address off the stack, etc). It's easy enough to remove the few references to these from the OpenBSD sources that are required (-fret-clean is only used in ld.so and libc currently). 01:23:24

Show newer messages


Back to Room ListRoom Version: 9