Hello all.
Not sure who cares about libraw now, so sending this to ports@.
The problem is that libraw explicitly adds -lstdc++ to the Libs
section in pkg-config files. As a result, when some software that
links to -lestdc++ tries to link -lraw or -lraw_r, it could get
-lstdc++ earlier that -lestdc++ in linker command line,
effectively making ld.so pick up symbols from -lstdc++ whenever
possible. And that's really bad. I see two options:
1. Make affected ports (depending on libraw) filter out -lstdc++.
CMake-based one, libkdcraw, don't care about pkg-config --libs
and thus isn't affected already.
2. Patch out libraw pkg-config templates. This is what the current
patch does. Not sure if this patch could be considered for upstream,
as there could be platforms where explicit -lstdc++ is needed; I'm
not an expert here.
Personally I'd go with (2), this will make incoming nomacs port
easier. Thoughts? Okays?
--
WBR,
Vadim Zhukov
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/libraw/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile 31 May 2015 06:45:29 -0000 1.13
+++ Makefile 23 Jul 2015 19:04:27 -0000
@@ -8,7 +8,7 @@ V = 0.16.0
DISTNAME = LibRaw-${V}
PKGNAME = ${DISTNAME:L}
CATEGORIES = graphics
-REVISION = 1
+REVISION = 2
SHARED_LIBS += raw 0.0 # 10.0
SHARED_LIBS += raw_r 0.0 # 10.0
Index: patches/patch-libraw_pc_in
===================================================================
RCS file: patches/patch-libraw_pc_in
diff -N patches/patch-libraw_pc_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libraw_pc_in 23 Jul 2015 19:04:27 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+Don't force standard C++ library, avoids forcing the latter when
+libestdc++ should be used.
+--- libraw.pc.in.orig Mon Jul 20 09:01:50 2015
++++ libraw.pc.in Mon Jul 20 09:02:24 2015
+@@ -7,5 +7,5 @@ Name: libraw
+ Description: Raw image decoder library (non-thread-safe)
+ Requires: @PACKAGE_REQUIRES@
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lraw -lstdc++@PC_OPENMP@
++Libs: -L${libdir} -lraw@PC_OPENMP@
+ Cflags: -I${includedir}/libraw
Index: patches/patch-libraw_r_pc_in
===================================================================
RCS file: patches/patch-libraw_r_pc_in
diff -N patches/patch-libraw_r_pc_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libraw_r_pc_in 23 Jul 2015 19:04:27 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+Don't force standard C++ library, avoids forcing the latter when
+libestdc++ should be used.
+--- libraw_r.pc.in.orig Mon Jul 20 09:02:09 2015
++++ libraw_r.pc.in Mon Jul 20 09:02:16 2015
+@@ -7,5 +7,5 @@ Name: libraw
+ Description: Raw image decoder library (thread-safe)
+ Requires: @PACKAGE_REQUIRES@
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lraw_r -lstdc++@PC_OPENMP@
++Libs: -L${libdir} -lraw_r@PC_OPENMP@
+ Cflags: -I${includedir}/libraw