Cc Rafael Sadowksi, who replied to my earlier mail about grantlee.

On Mon, 28 Jan 2019 19:16:24 +0100
Charlene Wendling <juliana...@posteo.jp> wrote:

> Hi ports! 
> 
> > http://build-failures.rhaalovely.net/sparc64/2018-12-19/x11/grantlee.log
> > http://build-failures.rhaalovely.net/powerpc/2018-12-14/x11/grantlee.log
> 
> With ports-gcc, it needs additional CFLAGS and LDFLAGS.
> 
> It has been tested successfully on macppc [1]. 
> 
> Charlène. 
> 
> 
> [1] http://ix.io/1zr6
> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/x11/grantlee/Makefile,v
> retrieving revision 1.13
> diff -u -p -r1.13 Makefile
> --- Makefile  24 Oct 2018 14:28:12 -0000      1.13
> +++ Makefile  28 Jan 2019 17:50:57 -0000
> @@ -2,7 +2,7 @@
>  
>  COMMENT =            template and text document library for Qt4
>  PKG_VERSION =                0.5.1
> -REVISION =           4
> +REVISION =           5
>  PLIST_VERSION =              ${PKG_VERSION:R}
>  DISTNAME =           grantlee-${PKG_VERSION}
>  CATEGORIES =         devel x11
> @@ -36,3 +36,8 @@ CONFIGURE_ARGS =    -DCMAKE_DISABLE_FIND_PA
>  SUBST_VARS =         PLIST_VERSION
>  
>  .include <bsd.port.mk>
> +
> +.if ${CHOSEN_COMPILER} == "ports-gcc"
> +CXXFLAGS += -pthread
> +LDFLAGS += -lpthread
> +.endif
> 

Earlier this month, I offered a different diff for x11/grantlee:
https://marc.info/?l=openbsd-ports&m=154715527204197&w=2

The error is "undefined reference to `pthread_cancel'" when building
a shared object (.so).  My diff removed -Wl,--no-undefined from flags
(in patch-CMakeLists_txt), so the undefined symbol isn't an error.
The above diff instead links to libpthread, so the symbol is defined.

For comparison, x11/grantlee-qt5/patch*CMake* is now linking .so files
to both libc and libpthread.

Most .so files in OpenBSD have some undefined symbols because they
don't link to libc.  The flag -Wl,--no-undefined works in some
systems, but causes errors in OpenBSD with libc symbols like memcpy.
I know less about pthread_cancel; the call to pthread_cancel seems to
be in libgcc, but pthread_cancel might be a symbol in libpthread, a
weak symbol in libestdc++, or a weak symbol in libgcc itself.

My diff (removing -Wl,--no-undefined) might not be correct.  When I
sent my diff, some dependencies of x11/grantlee were broken (on
platforms like macppc), so there was no way to test my diff.  I only
know that my diff worked with my modified ports tree.

-- 
George Koehler <kern...@gmail.com>

Reply via email to