Skip to content

Commit b7602a1

Browse files
committed
freebsd: correctly define __FreeBSD_version to the first stable release
See: https://docs.freebsd.org/en/books/porters-handbook/versions Closes #24819.
1 parent e089d21 commit b7602a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Compilation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6921,7 +6921,7 @@ pub fn addCCArgs(
69216921
// We don't currently respect the minor and patch components. This wouldn't be particularly
69226922
// helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
69236923
// symbols would be inconsistent with header declarations.
6924-
min_ver.major * 100_000,
6924+
min_ver.major * 100_000 + 500,
69256925
}));
69266926
} else if (target.isNetBSDLibC()) {
69276927
const min_ver = target.os.version_range.semver.min;

src/libs/freebsd.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
9292
try acflags.appendSlice(&.{
9393
"-DLOCORE",
9494
// 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}),
9696
});
9797

9898
inline for (.{ &cflags, &acflags }) |flags| {

0 commit comments

Comments
 (0)