You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-10Lines changed: 25 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,24 +89,39 @@ Here are the latest versions of Xcode that are known to /run/ on each OS X versi
89
89
90
90
More information about the compilers included in each version of Xcode can be found on the [MacPorts Wiki](https://trac.macports.org/wiki/XcodeVersionInfo).
91
91
92
-
### Linking for ppc on Xcode 7.3 and later
92
+
### Linking for x86_64 on Xcode 4.4 and later
93
93
94
-
The following error may appear when linking a program using the older compilers from Xcode (command-line and Makefile-based builds should not be affected):
94
+
If targetting 10.6, the following error may appear:
95
95
```
96
-
Running ld for ppc ...
97
-
ld: unknown option: -object_path_lto
96
+
For architecture x86_64: Undefinedsymbols
97
+
98
+
"_objc_retain", from: referenced
99
+
100
+
In libarclite_macosx.a ___ARCLite__load (arclite.o)
101
+
102
+
(youmeant: _objc_retainedObject maybe)
103
+
104
+
Symbol not (s) found for architecture x86_64 ld:
105
+
106
+
Error: linker command failed with exit code use 1 (-v to seeinvocation clang:)
98
107
```
99
-
or
108
+
109
+
Solution: in the Build Setting of the Project (not for the Target), set the setting "Implicitly Link Objective-C Runtime Support" to NO.
110
+
111
+
### Linking for ppc on Xcode 7.3 and later
112
+
113
+
Recent versions of Xcode and ld added several options. These are taken care of by the stub ld script (notably -object_path_lto xxx, -no_deduplicate, -dependency_info xxx), but after an Xcode upgrade new errors may appear, like:
114
+
100
115
```
101
116
Running ld for ppc ...
102
-
ld: unknown option: -no_deduplicate
117
+
ld: unknown option: -object_path_lto
103
118
```
104
-
The reason is that the newer versions of the linker introduced the options `-object_path_lto` and `-no_deduplicate`, which Xcode adds by default. To disable this, add the following two User-Defined build setting in Xcode (by clicking on the `+` at the to of the right column in the Build Settings panel):
105
119
106
-
-`LD_LTO_OBJECT_FILE` with an empty value
107
-
-`LD_DONT_RUN_DEDUPLICATION` with value set to `NO`.
120
+
There are two possible solutions:
121
+
122
+
- check in the file `/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/Ld.xcspec` if there is an Xcode setting to disable that option (`LD_LTO_OBJECT_FILE` in the above case)
123
+
- edit `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld` to prune the culprid option (and its argument)
108
124
109
-
For future reference, other settings that control the link options are located in: `/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/Ld.xcspec`
echo "Error: cannot find ld for \$ARCH in \$LD_DIR/../libexec/ld/\$ARCH\$LD_DIR/../../../libexec/ld/\$ARCH\$LD_DIR/../../../../libexec/ld/\$ARCH or \$LD_DIR/../../../../../libexec/ld/\$ARCH"
614
+
echo "Error: cannot find ld for \$ARCH in \$LD_DIR/../libexec/ld/\$LDARCHDIR\$LD_DIR/../../../libexec/ld/\$LDARCHDIR\$LD_DIR/../../../../libexec/ld/\$LDARCHDIR or \$LD_DIR/../../../../../libexec/ld/\$LDARCHDIR"
569
615
exit 1
570
616
fi
571
617
@@ -838,13 +884,20 @@ SPEC_EOF
838
884
if [ -f"$PLUGINDIR/LLVM GCC 4.2.xcplugin/legacy" ];then
0 commit comments