summaryrefslogtreecommitdiff
path: root/lib/mesa/mk
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-02-25 06:23:09 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-02-25 06:23:09 +0000
commitda94a257aae925d151aa80b7032181fa55c0b903 (patch)
tree36a3c0847c47b57ef4c91f70e711f8d3e7b473cc /lib/mesa/mk
parent394046bc3ef427f235e0e2ab48b039ff41f4370d (diff)
build u_printf.cpp with -ffunction-sections -fdata-sections and
link libmesa_util.a users with --gc-sections avoids unwanted external references in shared libraries: _ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm _ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv _ZdlPv _Znwm __gxx_personality_v0 follows what the meson build does problem reported by sthen@ when building sd2-ttf on i386
Diffstat (limited to 'lib/mesa/mk')
-rw-r--r--lib/mesa/mk/libEGL/Makefile3
-rw-r--r--lib/mesa/mk/libGL/Makefile5
-rw-r--r--lib/mesa/mk/libgbm/Makefile3
-rw-r--r--lib/mesa/mk/libmesa_util/Makefile4
4 files changed, 9 insertions, 6 deletions
diff --git a/lib/mesa/mk/libEGL/Makefile b/lib/mesa/mk/libEGL/Makefile
index 81bc93a92..aa5b35d29 100644
--- a/lib/mesa/mk/libEGL/Makefile
+++ b/lib/mesa/mk/libEGL/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2021/08/01 01:52:49 jsg Exp $
+# $OpenBSD: Makefile,v 1.5 2022/02/25 06:23:08 jsg Exp $
.include <bsd.xconf.mk>
@@ -41,6 +41,7 @@ CPPFLAGS+= -I${MESA_SRC}/src/egl/main \
LDADD+= -Wl,--as-needed -Wl,--allow-shlib-undefined -Wl,--start-group \
${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a \
${.CURDIR}/../libmesa_format/${__objdir}/libmesa_format.a \
+ -Wl,--gc-sections \
-lz -lm \
-L${X11BASE}/lib -lX11-xcb -lX11 -lxcb -lxcb-xfixes
diff --git a/lib/mesa/mk/libGL/Makefile b/lib/mesa/mk/libGL/Makefile
index 615d46e29..244811521 100644
--- a/lib/mesa/mk/libGL/Makefile
+++ b/lib/mesa/mk/libGL/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2021/07/22 11:10:09 jsg Exp $
+# $OpenBSD: Makefile,v 1.4 2022/02/25 06:23:08 jsg Exp $
.include <bsd.xconf.mk>
@@ -72,7 +72,8 @@ LDADD+= -L${.CURDIR}/../libglapi/${__objdir} -lglapi \
${.CURDIR}/../libglapi_static/${__objdir}/libglapi_static.a \
${.CURDIR}/../libloader/${__objdir}/libloader.a \
${.CURDIR}/../libxmlconfig/${__objdir}/libxmlconfig.a \
- ${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a
+ ${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a \
+ -Wl,--gc-sections
.if ${XENOCARA_BUILD_DRI3:L} == "yes"
LDADD+= ${.CURDIR}/../libloader_dri3_helper/${__objdir}/libloader_dri3_helper.a
diff --git a/lib/mesa/mk/libgbm/Makefile b/lib/mesa/mk/libgbm/Makefile
index 301f6c057..362705397 100644
--- a/lib/mesa/mk/libgbm/Makefile
+++ b/lib/mesa/mk/libgbm/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2022/02/24 02:29:48 jsg Exp $
+# $OpenBSD: Makefile,v 1.5 2022/02/25 06:23:08 jsg Exp $
.include <bsd.xconf.mk>
@@ -24,6 +24,7 @@ LDADD+= -Wl,--as-needed -Wl,--start-group \
${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a \
${.CURDIR}/../libmesa_format/${__objdir}/libmesa_format.a \
${.CURDIR}/../libxmlconfig/${__objdir}/libxmlconfig.a \
+ -Wl,--gc-sections \
-lz -lm -lexpat
.if ${XENOCARA_BUILD_DRI:L} == "yes"
diff --git a/lib/mesa/mk/libmesa_util/Makefile b/lib/mesa/mk/libmesa_util/Makefile
index b409bbbcc..c94d8a12c 100644
--- a/lib/mesa/mk/libmesa_util/Makefile
+++ b/lib/mesa/mk/libmesa_util/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2022/02/24 02:29:49 jsg Exp $
+# $OpenBSD: Makefile,v 1.4 2022/02/25 06:23:08 jsg Exp $
LIB= mesa_util
@@ -65,7 +65,7 @@ SRCS+= format_srgb.c
.include "../Makefile.inc"
CFLAGS+= ${C_VIS_ARGS}
-CXXFLAGS+= ${CXX_VIS_ARGS}
+CXXFLAGS+= ${CXX_VIS_ARGS} -ffunction-sections -fdata-sections
CPPFLAGS+= -I${MESA_SRC}/src/util \
-I${MESA_SRC}/src/mesa \
-I${MESA_SRC}/src/gallium/include \