summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/pkg-config-libs-generation.diff36
-rw-r--r--debian/patches/series1
2 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/pkg-config-libs-generation.diff b/debian/patches/pkg-config-libs-generation.diff
new file mode 100644
index 00000000..5f217765
--- /dev/null
+++ b/debian/patches/pkg-config-libs-generation.diff
@@ -0,0 +1,36 @@
+From: Benjamin Barenblat <bbaren@google.com>
+Subject: Check printf format strings in str_format_convert_test
+Forwarded: yes
+Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1963f10ae5cb32a7ea6d96b928f69d3c7fba0139
+Bug-Debian: https://bugs.debian.org/1011294
+
+Don’t use generator expression to build .pc Libs lines
+
+When building pkg-config files, compute linker flags with a string
+substitution rather than the JOIN generator expression. This ensures
+that commas in linker flags don’t get treated as argument separators in
+JOIN.
+
+The author works at Google. Upstream applied this patch as Piper
+revision 450675966 and exported it to GitHub; the Applied-Upstream URL
+above points to the exported commit.
+
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -167,6 +167,7 @@
+ set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+ endif()
+ endforeach()
++ string(REPLACE ";" " " PC_LINKOPTS "${ABSL_CC_LIB_LINKOPTS}")
+ FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
+ prefix=${CMAKE_INSTALL_PREFIX}\n\
+ exec_prefix=\${prefix}\n\
+@@ -178,7 +179,7 @@
+ URL: https://abseil.io/\n\
+ Version: ${PC_VERSION}\n\
+ Requires:${PC_DEPS}\n\
+-Libs: -L\${libdir} $<JOIN:${ABSL_CC_LIB_LINKOPTS}, > $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
++Libs: -L\${libdir} ${PC_LINKOPTS} $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
+ Cflags: -I\${includedir}${PC_CFLAGS}\n")
+ INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
diff --git a/debian/patches/series b/debian/patches/series
index f4bed7f4..f335570e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ big-endian-random4.diff
disable-nominalcpufrequency-test.diff
hppa-symbolize.diff
str-format-convert-test-printf.diff
+pkg-config-libs-generation.diff