Fix OpenBSD build with Makefiles

OpenBSD dynamic libraries never link to libc directly.
Instead, they have undefined symbols for all libc functions they use
that ld.so resolves to the libc referred to in the main executable.

Thus, disallowing undefined symbols will always fail
This commit is contained in:
Artemis Tosini 2024-10-24 21:24:47 +00:00
parent 3db75b0060
commit c49bff2434
No known key found for this signature in database
GPG key ID: EE5227935FE3FF18
2 changed files with 7 additions and 1 deletions

View file

@ -86,10 +86,12 @@ define build-library
else else
ifndef HOST_DARWIN ifndef HOST_DARWIN
ifndef HOST_WINDOWS ifndef HOST_WINDOWS
ifndef HOST_OPENBSD
$(1)_LDFLAGS += -Wl,-z,defs $(1)_LDFLAGS += -Wl,-z,defs
endif endif
endif endif
endif endif
endif
ifndef HOST_DARWIN ifndef HOST_DARWIN
$(1)_LDFLAGS += -Wl,-soname=$$($(1)_NAME).$(SO_EXT) $(1)_LDFLAGS += -Wl,-soname=$$($(1)_NAME).$(SO_EXT)

View file

@ -21,6 +21,10 @@ ifdef HOST_OS
HOST_NETBSD = 1 HOST_NETBSD = 1
HOST_UNIX = 1 HOST_UNIX = 1
endif endif
ifeq ($(patsubst openbsd%,,$(HOST_KERNEL)),)
HOST_OPENBSD = 1
HOST_UNIX = 1
endif
ifeq ($(HOST_KERNEL), linux) ifeq ($(HOST_KERNEL), linux)
HOST_LINUX = 1 HOST_LINUX = 1
HOST_UNIX = 1 HOST_UNIX = 1