iOS Build Environment Help Center

unknown argument '-Wl'

append delete Fernando

Windows version: Windows 11 Pro 23H2
Builder version: 3.64
iOS SDK version: 17.2
Link to buid log: https://pastebin.com/QgvBLP0C

Hello again master Pierre, another problem arose after a builder update, I was using 3.61 and everything was working perfectly, however, as soon as I updated to 3.64 this error appeared, would I have to migrate again? I'm waiting for a solution, thank you very much!

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Flags such as "-Wl,-Wsomething" that appear in the Xcode project settings are normally *compiler* flags instructing it to forward the "something" flag to the linker (more specifically, these flags are interpreted by the compiler driver and kept aside until the linker is called). This is a bad practice that your Xcode project passes them to the linker because these flags should be written in the format expected by the linker directly (e.g. "-l something"). Xcode tolerates this bogus syntax but the LLVM linker does not. Does your project build if you use the Apple linker instead ?

append delete #2. Fernando

I'm sorry, but how do I do this? Or is there any way I can go back to 3.61? Thanks!

append delete #3. Fernando

Solved, I just unchecked the Use the LLVM linker, strange that in 3.61 it worked, but, that's okay!

append delete #4. Pierre-Marie Baty

Then it means there's one thing more I should do to the LLVM linker to better align it with the Apple one. Thanks for the feedback :-)

append delete #5. Fernando

I also discovered that the LLVM linker does not work when I use a plugin called FMETP 3.0, however, the build works with the LLVM linker unchecked.

append delete #6. Yannoid

Hey guys, same feedback as Fernando.
I also use FMETP 3.0, same error but unchecking LLVM linker works fine !
Thanks you guys you saved me a lot of time.

append delete #7. Pierre-Marie Baty

That's to become the right way of "fixing" it.

Since in the recent versions of the builder I now use the "official" Win64 builds of LLVM and Clang (which include the LLVM Mach-O linker), and no longer my own branch of them, the only thing I can do (apart from re-creating a new LLVM branch and managing the LLVM builds myself again) is to open a ticket on the official LLVM GitHub. But I'll tell you it would have 80-90% chances of being rejected, because actually that's *not* a bug in the LLVM linker. It's just that -Wl,xxx is not a linker flag, so it shouldn't appear in a project's *linker* flags ; and the Apple linker just "tolerates" it.

The Right Thing To Do(tm) would be to get rid of these flags in the project files themselves (either in the main Xcode project file, or in the files pulled from outer space by CocoaPods), by replacing every occurence of "-Wl,<something>" with just "<something>" in all possible variants of the linker flags. And if these occurrences come from a Pod, contact the Pod maintainer and tell him that he's got a little thing to fix.

... or, just use the Apple linker. The LLVM one has not yet completely replaced it.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty