Bug #118885 mysql8 @8.4.6: ld: unknown option: -no_warn_duplicate_libraries
Submitted: 24 Aug 12:05 Modified: 25 Aug 9:17
Reporter: Bjarne Mathiesen Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:8.4.6 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: xcode

[24 Aug 12:05] Bjarne Mathiesen
Description:
In 8.4.6 an ld option -no_warn_duplicate_libraries was introduced for platform APPLE. The bug is, that tish option is XCode >= 15 only; thus compiling on MacOS versions w/ an Xcode < 15 fails.

The root causes can be found here:

(1)  Xcode 15 Duplicate Library Linker Warnings
    ​https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/
(2)  Avoid duplicate linking to avoid Xcode 15 warnings
    ​https://discourse.cmake.org/t/avoid-duplicate-linking-to-avoid-xcode-15-warnings/9084
(3) Xcode 15 duplicate libraries warning
    ​https://gitlab.kitware.com/cmake/cmake/-/issues/25297
(4)  Optionally re-order direct link dependencies to honor transitive dependencies
    ​https://gitlab.kitware.com/cmake/cmake/-/issues/26271 

Accorcding to (2)&(3) for cmake >= 3.29.0 the XCode 15 fix shouldn't be necessary.

MacPorts ticket : https://trac.macports.org/ticket/72831
MacPorts Pull Request : https://github.com/macports/macports-ports/pull/29153

How to repeat:
compile from source w/ an XCode version < 15

Suggested fix:
Also check for XCode version
A working patch can be found here :
https://github.com/macports/macports-ports/pull/29153
https://github.com/macports/macports-ports/commit/32f261fc6662ce7d910fa29f8ecd697f12de7691
[25 Aug 9:17] MySQL Verification Team
Hi,

Thank you for submission and for the workaround.