From 2ce911fedaab3006763c631d3018b78b72cbb51dd134230db3ba512dc9d06462 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 29 Dec 2023 08:49:37 +0000 Subject: [PATCH] Accepting request 1135308 from home:StefanBruens:branches:devel:tools:building - Re-add "-Wl,--no-undefined" linker flags for executables and regular shared libraries. Shared library targets which are used as plugins/modules should use `add_library(... MODULE ...), which uses the "CMAKE_MODULE_LINKER_FLAGS". OBS-URL: https://build.opensuse.org/request/show/1135308 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=561 --- cmake.changes | 8 ++++++++ cmake.macros | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake.changes b/cmake.changes index c3ed492..b17a52c 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Dec 27 12:56:45 UTC 2023 - Stefan BrĂ¼ns + +- Re-add "-Wl,--no-undefined" linker flags for executables and + regular shared libraries. Shared library targets which are used + as plugins/modules should use `add_library(... MODULE ...), which + uses the "CMAKE_MODULE_LINKER_FLAGS". + ------------------------------------------------------------------- Thu Dec 14 21:06:23 UTC 2023 - Christoph G diff --git a/cmake.macros b/cmake.macros index 10cd1f7..a1e312b 100644 --- a/cmake.macros +++ b/cmake.macros @@ -40,9 +40,9 @@ -DCMAKE_C_FLAGS="${CFLAGS:-%optflags}" \\\ -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags}" \\\ -DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" \\\ - -DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \\\ + -DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\ -DCMAKE_MODULE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed" \\\ - -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \\\ + -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\ %if "%{?_lib}" == "lib64" \ -DLIB_SUFFIX=64 \\\ %endif \