Skip to content

Commit 5b5c906

Browse files
authored
Merge pull request #6705 from flumf/master
Static linking for OpenBSD
2 parents 0bdfa2e + fd0646f commit 5b5c906

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

configure

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ AC_ARG_WITH([private_runtime],
7575

7676
AC_ARG_ENABLE([static],
7777
AS_HELP_STRING([--enable-static],
78-
[Compile the opam binary statically. Only Musl-based Linux distributions and Windows with MinGW is currently supported. This is the default on Windows with MinGW]),
78+
[Compile the opam binary statically. Only Musl-based Linux distributions, Windows with MinGW, and OpenBSD are currently supported. This is the default on Windows with MinGW]),
7979
[],
8080
[enable_static=auto])
8181

@@ -360,6 +360,10 @@ AS_CASE([$TARGET],
360360
# which still depends on the DLL at runtime instead of libstdc++.a (that looks like a bug in flexlink)
361361
platform_dependent_stuff="-cclib -l:libstdc++.a -cclib -l:libpthread.a -cclib -Wl,-static -cclib -ladvapi32 -cclib -lgdi32 -cclib -luser32 -cclib -lshell32 -cclib -lole32 -cclib -luuid -cclib -luserenv"
362362
AS_IF([test "x${SYSTEM}" = "xmingw"], [platform_dependent_stuff="${platform_dependent_stuff} -cclib -lwindowsapp"])
363+
],
364+
[*-*-openbsd*],[
365+
support_static=yes
366+
platform_dependent_stuff="-cclib -lc++ -cclib -lc++abi -cclib -static"
363367
])
364368
AS_CASE([${support_static},${enable_static}],
365369
[no,yes],[AC_MSG_ERROR([--enable-static is not available on this platform (${TARGET}).])],

master_changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ users)
8585
* Update the dependency constraint on `patch` to now require its stable version [#6663 @kit-ty-kate]
8686
* Update the download-if-missing dependencies to their latest version (re.1.14.0, dune.3.20.2, menhir.20250903) [#6700 @kit-ty-kate]
8787
* Remove `seq` from the list of packages to download-if-missing as it is no longer a dependency of `re` [#6700 @kit-ty-kate]
88+
* `./configure --enable-static` is now supported on OpenBSD [#6705 @flumf]
8889

8990
## Infrastructure
9091

9192
## Release scripts
93+
* The OpenBSD binary now a full static binary [#6705 @flumf @kit-ty-kate - fix #6241]
9294

9395
## Install script
9496
* Add 2.4.1 to the install scripts [#6617 @kit-ty-kate]

release/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ CLINKING_macos = \
6767
-lunix -lmccs_stubs -lmccs_glpk_stubs -lsha_stubs -lopam_core_stubs \
6868
-lstdc++
6969

70-
CLINKING_openbsd = $(CLINKING_macos)
7170
CLINKING_freebsd = $(CLINKING_macos)
7271
CLINKING_netbsd = $(CLINKING_macos)
7372

73+
CLINKING_openbsd = \
74+
-lunix -lmccs_stubs -lmccs_glpk_stubs -lsha_stubs -lopam_core_stubs \
75+
-lstdc++ -lc++ -lc++abi -static
76+
7477
CLINKING_windows = \
7578
-lunix -lmccs_stubs -lmccs_glpk_stubs -lsha_stubs -lopam_core_stubs \
7679
-l:libstdc++.a -l:libpthread.a \

0 commit comments

Comments
 (0)