From a697c02bf1b4ac38aa8d555dae2c3460105a9881 Mon Sep 17 00:00:00 2001 From: Renkoto Date: Thu, 15 Oct 2026 23:33:37 -0500 Subject: [PATCH 1/5] appversion.sh: locate bash through env --- regamedll/version/appversion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/version/appversion.sh b/regamedll/version/appversion.sh index 68c35862f..0bae28099 100755 --- a/regamedll/version/appversion.sh +++ b/regamedll/version/appversion.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash init() { From 9b720f29dff533c433a87df5fabb01870a701a90 Mon Sep 17 00:00:00 2001 From: Renkoto Date: Thu, 15 Oct 2026 23:33:37 -0500 Subject: [PATCH 2/5] osconfig.h: include sys/sysinfo.h on Linux only --- regamedll/engine/osconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regamedll/engine/osconfig.h b/regamedll/engine/osconfig.h index 554b1d899..572f72474 100644 --- a/regamedll/engine/osconfig.h +++ b/regamedll/engine/osconfig.h @@ -89,7 +89,9 @@ #include #include #if !defined(__APPLE__) + #if defined(__linux__) #include + #endif #else #include #endif From e33f101b42cdf6c1c9c76170e6abfe9b213ad7db Mon Sep 17 00:00:00 2001 From: Renkoto Date: Thu, 15 Oct 2026 23:33:37 -0500 Subject: [PATCH 3/5] platform.h: accept BSD in the DLL export macros --- regamedll/public/tier0/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/public/tier0/platform.h b/regamedll/public/tier0/platform.h index eaf294f5a..d5fa5334e 100644 --- a/regamedll/public/tier0/platform.h +++ b/regamedll/public/tier0/platform.h @@ -75,7 +75,7 @@ // Can't use extern "C" when DLL exporting a global #define DLL_GLOBAL_EXPORT extern __declspec(dllexport) #define DLL_GLOBAL_IMPORT extern __declspec(dllimport) -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ // Used for dll exporting and importing #define DLL_EXPORT extern "C" From 15e027ac94cf3a678e0a75e4a3024630eb774cef Mon Sep 17 00:00:00 2001 From: Renkoto Date: Thu, 15 Oct 2026 23:33:37 -0500 Subject: [PATCH 4/5] counter.h: use limits.h on non-Linux systems --- regamedll/game_shared/counter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/game_shared/counter.h b/regamedll/game_shared/counter.h index 84f03ce8d..599097853 100644 --- a/regamedll/game_shared/counter.h +++ b/regamedll/game_shared/counter.h @@ -38,7 +38,7 @@ #include #include #include - #ifdef __APPLE__ + #ifndef __linux__ #include #else #include From 51ee19a9372314baa985405c2ef6c68654018661 Mon Sep 17 00:00:00 2001 From: Renkoto Date: Thu, 15 Oct 2026 23:33:37 -0500 Subject: [PATCH 5/5] CMake: pass --undefined-version to lld on BSD --- regamedll/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regamedll/CMakeLists.txt b/regamedll/CMakeLists.txt index b1166d023..95fba9952 100644 --- a/regamedll/CMakeLists.txt +++ b/regamedll/CMakeLists.txt @@ -143,6 +143,10 @@ endif() if (NOT DEBUG AND NOT ANDROID AND NOT APPLE) set(LINK_FLAGS "${LINK_FLAGS} \ -Wl,-gc-sections -Wl,--version-script=\"${PROJECT_SOURCE_DIR}/../version_script.lds\"") + if (CMAKE_SYSTEM_NAME MATCHES "BSD|DragonFly") + # lld rejects version script entries for symbols not defined in the output (libstdc++-only names) + set(LINK_FLAGS "${LINK_FLAGS} -Wl,--undefined-version") + endif() endif() find_program(CCACHE_FOUND ccache)