From 7d3434f9702b44dbfd39eecc44db889f802caf0e Mon Sep 17 00:00:00 2001 From: Niclas Rosenvik Date: Thu, 8 Apr 2021 12:14:31 +0000 Subject: [PATCH] Fix environ build break on FreeBSD QMAKE_LFLAGS_NOUNDEF = for FreeBSD did not get converted to CMakeLists.txt. This breaks the build on FreeBSD since environ is missing from libc, it is available at runtime. Turn -Wl,-no-undefined into warnings on FreeBSD to fix the build. Also add a comment based on the one from corelib.pro . Change-Id: I3835884a2682af0f68a4d65dede3e4e5d4104ac8 Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index af6bba2dbe0..467827b1c65 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -430,8 +430,13 @@ qt_internal_extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQU "/BASE:0x67000000" ) -#### Keys ignored in scope 6:.:.:corelib.pro:FREEBSD OR OPENBSD: -# QMAKE_LFLAGS_NOUNDEF = +# QtCore can't be compiled with -Wl,-no-undefined because it uses the +# "environ" variable and FreeBSD does not include a weak symbol for it +# in libc. +qt_internal_extend_target(Core CONDITION FREEBSD + LINK_OPTIONS + "LINKER:--warn-unresolved-symbols" +) qt_internal_extend_target(Core CONDITION QT_FEATURE_animation SOURCES