-pie being ignored. It is only used when linking a main executable

getting this warning for pod files. What can be the reason behind this? Please le me know if anyone face the same issue.

The direct answer is that the -pie argument only makes sense when linking main executables. Other Mach-O types are always position independent.

As to why you’re hitting this, that’s hard to say. You’ll have to dig through the build transcript to find out what link step is triggering this error and then look at your build settings to see who is applying this flag.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I got this warning for every target I build in Xcode 15 that isn't the main executable target, e.g. for all framework targets. Note that I haven't set anything in the build settings. For all targets, frameworks or binary, the setting GCC_DYNAMIC_NO_PIC is default (not listed under customized, shows "No" when hovered, also for "Resolved"), still Xcode would add -Wl,-pie to every linker call it made and this produced the warning when being added to liker calls for frameworks.

The fix: Overriding the default once to YES, then deleting it again, clean build and no more warnings anymore, as this argument is no longer added to liker calls.

Give it a try, maybe works for you, too. And yes, we are also using podfiles but the don't produce this warning either anymore, yet I'm not sure if they actually did before.

-pie being ignored. It is only used when linking a main executable
 
 
Q