On Mon, Feb 10, 2020 at 08:46:47PM +0000, Stuart Henderson wrote:
> > I have build the library with debug symbols as I want to do development
> > on top of it.  Do we have a policy for that?
>
> If you only need symbols on amd64 then I'd prefer just setting
> DEBUG_PACKAGES=${BUILD_PACKAGES}, which will automatically split into
> open62541 and debug-open62541 packages with detached symbols in the latter.
>
> If you would like them on other arches too then
> -DCMAKE_BUILD_TYPE=RelWithDebInfo makes sense.

The debug feature works.  It helped to track down a double free in
the library.  I think the -DCMAKE_BUILD_TYPE=RelWithDebInfo is still
necessary to build the library, the debug symbols are just stripped
later.

ok?

bluhm

Index: misc/open62541/Makefile
===================================================================
RCS file: /data/mirror/openbsd/cvs/ports/misc/open62541/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- misc/open62541/Makefile     11 Feb 2020 10:35:25 -0000      1.1.1.1
+++ misc/open62541/Makefile     11 Feb 2020 15:22:05 -0000
@@ -3,6 +3,7 @@
 COMMENT =      library implementation of OPC UA

 VERSION =      1.0.1
+REVISION =     0
 PKGNAME =      open62541-${VERSION}

 GH_ACCOUNT =   open62541
@@ -43,6 +44,8 @@ CONFIGURE_ARGS =      -DCMAKE_BUILD_TYPE=RelW
                        -DUA_PACK_DEBIAN=ON \
                        -DUA_BUILD_TOOLS=ON \
                        -DUA_BUILD_UNIT_TESTS=ON
+
+DEBUG_PACKAGES =       ${BUILD_PACKAGES}

 WRKDIST =              ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME}

Index: misc/open62541/patches/patch-plugins_ua_accesscontrol_default_c
===================================================================
RCS file: misc/open62541/patches/patch-plugins_ua_accesscontrol_default_c
diff -N misc/open62541/patches/patch-plugins_ua_accesscontrol_default_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ misc/open62541/patches/patch-plugins_ua_accesscontrol_default_c     12 Feb 
2020 22:27:18 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+https://github.com/open62541/open62541/commit/f05bafc25d332d4571b2e42fb42221c2ec3cc98c
+
+Index: plugins/ua_accesscontrol_default.c
+--- plugins/ua_accesscontrol_default.c.orig
++++ plugins/ua_accesscontrol_default.c
+@@ -210,6 +210,7 @@ static void deleteMembers_default(UA_AccessControl *ac
+         if(context->usernamePasswordLoginSize > 0)
+             UA_free(context->usernamePasswordLogin);
+         UA_free(ac->context);
++        ac->context = NULL;
+     }
+ }
+

Reply via email to