Bug#738353: graphite2: extra linking to libstdc++ on kFreeBSD and Hurd
Source: graphite2
Version: 1.2.4-1
Severity: normal
Tags: patch
Hi,
the build system of graphite2 avoids the linking of libgraphite2 to
libstdc++, but only on Linux. This causes the failure of one of the
harfbuzz tests (check-libstdc++.sh), which checks that libharfbuzz
(which links to libgraphite2) does not (directly or indirectly) pull
libstdc++.
Attached there is a patch that extends the checks in the build system
also to GNU/k*BSD platforms (k*.BSD) and Hurd (GNU).
Thanks,
--
Pino
--- a/gr2fonttest/CMakeLists.txt
+++ b/gr2fonttest/CMakeLists.txt
@@ -17,14 +17,14 @@ if (GRAPHITE2_ASAN)
set(GRAPHITE_LINK_FLAGS "-fsanitize=address")
endif (GRAPHITE2_ASAN)
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
# -lgcc LINKER_LANGUAGE C
add_definitions(-fno-rtti -fno-exceptions)
set_target_properties(gr2fonttest PROPERTIES LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" LINKER_LANGUAGE C)
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
# This script just fails
nolib_test(stdc++ $<TARGET_FILE:gr2fonttest>)
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
# copy the DLL so that gr2fonttest can find it
add_custom_target(${PROJECT_NAME}_copy_dll ALL
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -110,7 +110,7 @@ else (${CMAKE_BUILD_TYPE} STREQUAL "Clan
set(GRAPHITE_LINK_FLAGS "")
endif (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN")
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
set_target_properties(graphite2 PROPERTIES
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}"
@@ -128,7 +128,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linu
endif (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set_target_properties(graphite2 PROPERTIES
--- a/tests/comparerenderer/CMakeLists.txt
+++ b/tests/comparerenderer/CMakeLists.txt
@@ -38,7 +38,7 @@ endif (${ICU_INCLUDE} STREQUAL "ICU_INCL
# set(HB1_LDFLAGS "-L${HB1_INCLUDE}/../../lib -lharfbuzz-1")
#endif (${HB1_INCLUDE})
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
find_package(Freetype)
find_package(PkgConfig)
@@ -63,7 +63,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux
set(GRAPHITE_LINK_FLAGS "-fsanitize=address")
endif (GRAPHITE2_ASAN)
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
find_path(GR_INCLUDE graphite/GrClient.h PATHS ENV SILGRAPHITE_HOME ${PROJECT_SOURCE_DIR}/../../../silgraphite-2.3.1 ${PROJECT_SOURCE_DIR}/../../../silgraphite-2.4.0 ${GRAPHITE_INSTALLED_PATH} ${PROJECT_SOURCE_DIR}/../../../graphite-trunk PATH_SUFFIXES engine/include include)
--- a/tests/examples/CMakeLists.txt
+++ b/tests/examples/CMakeLists.txt
@@ -26,12 +26,12 @@ macro(test_example TESTNAME SRCFILE)
set_tests_properties(${TESTNAME} PROPERTIES TIMEOUT 3)
endmacro(test_example)
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
find_package(Freetype)
if (${FREETYPE_FOUND})
include_directories(${FREETYPE_INCLUDE_DIRS})
endif (${FREETYPE_FOUND})
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
macro(test_freetype TESTNAME SRCFILE)
if (${FREETYPE_FOUND})
--- a/tests/vm/CMakeLists.txt
+++ b/tests/vm/CMakeLists.txt
@@ -38,12 +38,12 @@ if (GRAPHITE2_ASAN)
set_target_properties(vm-test-call PROPERTIES LINK_FLAGS "-fsanitize=address")
endif (GRAPHITE2_ASAN)
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
add_definitions(-fno-rtti -fno-exceptions)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
add_definitions(-DNDEBUG -fomit-frame-pointer)
endif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "k.*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
add_test(vm-test-call-threading vm-test-call ${testing_SOURCE_DIR}/fonts/tiny.ttf 1)
set_tests_properties(vm-test-call-threading PROPERTIES
Reply to: