authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-13 08:46:52+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-13 08:46:52+02:00
logb7602a17f847ec9f24cfe0b6a1c458b13e04c6f6
tree4bdf97d779bbda764e901b0d617daef181843cec
parente089d21439c7fba18fc33dfd516af6421e92240c
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

freebsd: correctly define __FreeBSD_version to the first stable release

See: https://docs.freebsd.org/en/books/porters-handbook/versions Closes #24819.

2 files changed, 2 insertions(+), 2 deletions(-)

src/Compilation.zig+1-1
...@@ -6921,7 +6921,7 @@ pub fn addCCArgs(...@@ -6921,7 +6921,7 @@ pub fn addCCArgs(
6921 // We don't currently respect the minor and patch components. This wouldn't be particularly6921 // We don't currently respect the minor and patch components. This wouldn't be particularly
6922 // helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub6922 // helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
6923 // symbols would be inconsistent with header declarations.6923 // symbols would be inconsistent with header declarations.
6924 min_ver.major * 100_000,6924 min_ver.major * 100_000 + 500,
6925 }));6925 }));
6926 } else if (target.isNetBSDLibC()) {6926 } else if (target.isNetBSDLibC()) {
6927 const min_ver = target.os.version_range.semver.min;6927 const min_ver = target.os.version_range.semver.min;
src/libs/freebsd.zig+1-1
...@@ -92,7 +92,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -92,7 +92,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
92 try acflags.appendSlice(&.{92 try acflags.appendSlice(&.{
93 "-DLOCORE",93 "-DLOCORE",
94 // See `Compilation.addCCArgs`.94 // See `Compilation.addCCArgs`.
95 try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000}),95 try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000 + 500}),
96 });96 });
9797
98 inline for (.{ &cflags, &acflags }) |flags| {98 inline for (.{ &cflags, &acflags }) |flags| {