From 07dc64974776816016a171e863174e7ff266ff4a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 5 Aug 2024 17:51:34 +0200 Subject: [PATCH] CMake: Fix build of oci plugin on arm macOS with the classic linker When using Xcode 14, or 15 but with the classic linker on arm macOS, the linking of the oci plugin fails with: ld: file not found: @rpath/libnnz.dylib for architecture arm64 Even though the file is present in the expected location. This seems to be related to the use of the -flat_namespace flag, which was originally added in 2003 for Qt 3.1, to avoid an issue with the linker not finding the environ symbol. These flags doesn't seem to be necessary anymore to successfully link the plugin. Remove both the -flat_namespace and -U,_environ flags when building the plugin. Amends 3ada49976a06ae251911fd8cd734f697fe4ddab4 in the historical qt repo, which is not available publicly. Pick-to: 6.7 6.5 Fixes: QTBUG-127342 Change-Id: If522cacb92aceff35d36d3bcfd3c1f838c134ada Reviewed-by: Alexey Edelev (cherry picked from commit 3642ce6e4b1912a774cc55c9a6a85ecf716d7080) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/sqldrivers/oci/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/sqldrivers/oci/CMakeLists.txt b/src/plugins/sqldrivers/oci/CMakeLists.txt index 66c4219905b..11c60c7f493 100644 --- a/src/plugins/sqldrivers/oci/CMakeLists.txt +++ b/src/plugins/sqldrivers/oci/CMakeLists.txt @@ -24,9 +24,4 @@ qt_internal_add_plugin(QOCIDriverPlugin ## Scopes: ##################################################################### -qt_internal_extend_target(QOCIDriverPlugin CONDITION APPLE - LINK_OPTIONS - "-Wl,-flat_namespace,-U,_environ" -) - qt_internal_force_macos_intel_arch(QOCIDriverPlugin)