On Tue, Jun 23, 2020 at 05:51:09PM +0200, Charlene Wendling wrote:
> On Mon, 22 Jun 2020 10:26:31 +0100
> Stuart Henderson wrote:
> 
> > 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.
> > >> >
> 
> The _Unwind_* symbols seem to come from osinfo_loader_process_user_path,
> i've tried to isolate the situation in C and vala without success. I may
> be wrong about this assumption.
> 
> The only other case where it's needed is for lang/luajit, so i've
> looked at the cvs log, and there was no clear reason invoked by espie
> back then as well.
> 
> So here is a diff that adds the WANTLIBs and LDFLAGS for all base-clang
> archs. I've updated the comment in case someone may think it's unneeded.
> 
> Charlène.

Did you try patching out -fexceptions or -fasynchronous-unwind-tables from 
meson.build?



> 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      23 Jun 2020 15:39:20 -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        23 Jun 2020 15:39:20 -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,13 @@ 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_* on clang+ld.bfd archs;
> +# it may cause runtime issues on lld archs as well.
> +.if ${PROPERTIES:Mclang}
> +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        23 Jun 2020 15:39:20 -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  23 Jun 2020 15:39:21 -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
> 

-- 
Antoine

Reply via email to