I haven't checked but the libraries are probably really needed at runtime
(at least if it crashes at runtime, that's where the unwind functions are
most likely to be used) on clang LLD arches too. The difference is that LLD
will still link if there are missing symbols and crash at runtime if the
functions are called, ld.bfd will check at link time.
I would make it conditional on just clang rather than the linker too.
--
Sent from a phone, apologies for poor formatting.
On 22 June 2020 09:43:51 Charlene Wendling <juliana...@posteo.jp> wrote:
On Mon, 15 Jun 2020 21:12:48 +0100
Stuart Henderson wrote:
On 2020/06/15 21:46, Charlene Wendling wrote:
> Hi,
>
> libosinfo's build fails on my macppc machine with:
>
> > /usr/ports/pobj/libosinfo-1.8.0/build-powerpc/osinfo/libosinfo-1.0.so.
> > 1.5: undefined reference to `_Unwind_GetIP'
> > /usr/ports/pobj/libosinfo-1.8.0/build-powerpc/osinfo/libosinfo-1.0.so.
> > 1.5: undefined reference to `_Unwind_GetRegionStart'
> (etc.)
>
> I don't know why macppc is the only one needing that, but linking
> against libc++abi and pthread works, tests have only 1 failure, as
> seen on amd64.
btw, same on amd64 if you set USE_LLD=No.
I missed the fact that mips64 had the same issue, so the diff is now
targeting clang+lb.bfd archs.
> While here i've moved HOMEPAGE to https.
>
> Comments/feedback are welcome,
>
> Charlène.
>
Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/misc/osinfo/Makefile.inc,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 Makefile.inc
--- Makefile.inc 31 May 2020 10:36:21 -0000 1.11
+++ Makefile.inc 20 Jun 2020 19:29:23 -0000
@@ -6,7 +6,7 @@ CATEGORIES= misc devel
MAINTAINER= Antoine Jacoutot <ajacou...@openbsd.org>
-HOMEPAGE= http://libosinfo.org/
+HOMEPAGE= https://libosinfo.org/
# GPLv2+ - LGPLv2+
PERMIT_PACKAGE= Yes
Index: libosinfo/Makefile
===================================================================
RCS file: /cvs/ports/misc/osinfo/libosinfo/Makefile,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 Makefile
--- libosinfo/Makefile 9 Jun 2020 07:14:44 -0000 1.12
+++ libosinfo/Makefile 20 Jun 2020 19:29:23 -0000
@@ -3,7 +3,7 @@
COMMENT= library for managing information about operating systems
DISTNAME= libosinfo-${V}
-REVISION= 0
+REVISION= 1
SHARED_LIBS += osinfo-1.0 1.5 # 0.1008.0
@@ -29,5 +29,12 @@ TEST_DEPENDS= misc/osinfo/osinfo-db
CONFIGURE_ARGS= -Dwith-pci-ids-path=${LOCALBASE}/share/hwdata/pnp.ids \
-Dwith-usb-ids-path=${LOCALBASE}/share/hwdata/usb.ids
+
+.include <bsd.port.arch.mk>
+# Fix undefined reference errors to _Unwind_*
+.if ${PROPERTIES:Mclang} && !${PROPERTIES:Mlld}
+CONFIGURE_ENV += LDFLAGS="${LDFLAGS} -lc++abi -lpthread"
+WANTLIB += c++abi pthread
+.endif
.include <bsd.port.mk>
Index: osinfo-db/Makefile
===================================================================
RCS file: /cvs/ports/misc/osinfo/osinfo-db/Makefile,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 Makefile
--- osinfo-db/Makefile 31 May 2020 10:36:36 -0000 1.33
+++ osinfo-db/Makefile 20 Jun 2020 19:29:23 -0000
@@ -3,6 +3,7 @@
COMMENT= osinfo database files
V= 20200529
+REVISION= 0
DISTNAME= osinfo-db-${V}
EXTRACT_SUFX= .tar.xz
Index: osinfo-db-tools/Makefile
===================================================================
RCS file: /cvs/ports/misc/osinfo/osinfo-db-tools/Makefile,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 Makefile
--- osinfo-db-tools/Makefile 31 May 2020 10:36:21 -0000 1.11
+++ osinfo-db-tools/Makefile 20 Jun 2020 19:29:23 -0000
@@ -3,6 +3,7 @@
COMMENT= tools to manage the libosinfo database
DISTNAME= osinfo-db-tools-${V}
+REVISION= 0
WANTLIB += archive c gio-2.0 glib-2.0 gobject-2.0 intl json-glib-1.0
WANTLIB += soup-2.4 xml2