freebsd: correctly define __FreeBSD_version to the first stable release
See: https://docs.freebsd.org/en/books/porters-handbook/versions Closes #24819.
This commit is contained in:
@@ -6921,7 +6921,7 @@ pub fn addCCArgs(
|
||||
// We don't currently respect the minor and patch components. This wouldn't be particularly
|
||||
// helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
|
||||
// symbols would be inconsistent with header declarations.
|
||||
min_ver.major * 100_000,
|
||||
min_ver.major * 100_000 + 500,
|
||||
}));
|
||||
} else if (target.isNetBSDLibC()) {
|
||||
const min_ver = target.os.version_range.semver.min;
|
||||
|
||||
@@ -92,7 +92,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
|
||||
try acflags.appendSlice(&.{
|
||||
"-DLOCORE",
|
||||
// See `Compilation.addCCArgs`.
|
||||
try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000}),
|
||||
try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000 + 500}),
|
||||
});
|
||||
|
||||
inline for (.{ &cflags, &acflags }) |flags| {
|
||||
|
||||
Reference in New Issue
Block a user