From e8254d1b081137cae230533bdeac3103f47be866 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 3 Sep 2020 11:29:42 +0000 Subject: [PATCH] Avoid problems with undefined symbols on ld.bfd archs caused by order of .a files. problem reported by jca@ on sparc64 with ports which link libgbm ok jca@ --- lib/mesa/mk/libgbm/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/mesa/mk/libgbm/Makefile b/lib/mesa/mk/libgbm/Makefile index e14d41fcd..3072a1d4d 100644 --- a/lib/mesa/mk/libgbm/Makefile +++ b/lib/mesa/mk/libgbm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2020/08/28 16:07:19 jsg Exp $ +# $OpenBSD: Makefile,v 1.3 2020/09/03 11:29:42 jsg Exp $ .include @@ -18,15 +18,19 @@ CPPFLAGS+= -I${MESA_SRC}/src/gbm/main \ -I${MESA_SRC}/src/gbm/backends/dri \ -I${MESA_SRC}/src/loader -LDADD+= ${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a \ - ${.CURDIR}/../libxmlconfig/${__objdir}/libxmlconfig.a \ +LDADD+= -Wl,--as-needed -Wl,--start-group \ ${.CURDIR}/../libloader/${__objdir}/libloader.a \ + ${.CURDIR}/../libmesa_util/${__objdir}/libmesa_util.a \ + ${.CURDIR}/../libmesa_format/${__objdir}/libmesa_format.a \ + ${.CURDIR}/../libxmlconfig/${__objdir}/libxmlconfig.a \ -lz -lm -lexpat .if ${XENOCARA_BUILD_DRI:L} == "yes" LDADD+= -L${X11BASE}/lib -ldrm .endif +LDADD+= -Wl,--end-group + obj: _xenocara_obj beforeinstall: