Code Monkey home page Code Monkey logo

xcodelegacy's Introduction

XcodeLegacy

Legacy components for Xcode 4-12 (deprecated compilers and Mac OS X SDKs).

Home page: https://github.com/devernay/xcodelegacy

Description

Many components were removed in recent versions of Xcode, the most notable being the Mac OS X 10.6 SDK, which is required to build software using the Carbon API (such as wxWidgets 2.8).

I made the script XcodeLegacy.sh to extract these components (the links work if you sign in to Apple Developer first) from Xcode 3.2.6 (10.4, 10.5 and 10.6 SDKs, PPC assembler, GCC 4.0 and 4.2, LLVM-GCC 4.2), Xcode 4.6.3 (10.7 SDK), Xcode 5.1.1 (10.8 SDK), Xcode 6.4 (10.9 and 10.10 SDKs), Xcode 7.3.1 (10.11 SDK), Xcode 8.3.3 (10.12 SDK), Xcode 9.4.1 (10.13 SDK), Xcode 10.3 (10.14 SDK) Xcode 11.7 (10.15 SDK) and install them in Xcode 4-12:

  • GCC 4.0, GCC 4.2 and LLVM GCC 4.2 compilers
  • GCC 4.0, GCC 4.2 and LLVM GCC 4.2 Xcode plugins
  • PPC assembler
  • Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.15

The script also fixes a few known bugs in the 10.4, 10.5 and 10.6 SDK.

Note: There may be similar tips to compile for older iOS (not Mac OS X) versions, but I don't develop for iOS. However, if you want to enhance the XcodeLegacy script to also include those components, I'll gladly integrate your modifications.

Download

XcodeLegacy.sh (previous versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2)

GitHub repository

Usage

Open a Terminal application, change to the directory where XcodeLegacy.sh, and make it executable, as in:

cd path/to/xcodelegacy
chmod +x XcodeLegacy.sh

Execute the script by typing ./XcodeLegacy.sh <arg>. The script takes one argument, which can be "buildpackages" (to extract components from the legacy Xcode downloads to the current directory), "install" (to install the components in Xcode 4-10), "cleanpackages" (to delete the extracted components from the current directory), "uninstall" (to uninstall the components from Xcode 4-10).

With the "install" or "uninstall" arguments, the script uses sudo to become root, and will thus ask for your password. Please check the script contents before executing it.

Optionally, one of the following options can be passed as the first argument to XcodeLegacy.sh, to limit its operation:

  • -compilers : only install the gcc and llvm-gcc compilers, as well as the corresponding Xcode plugins
  • -osx104 : only install Mac OSX 10.4 SDK
  • -osx105 : only install Mac OSX 10.5 SDK
  • -osx106 : only install Mac OSX 10.6 SDK
  • -osx107 : only install Mac OSX 10.7 SDK
  • -osx108 : only install OSX 10.8 SDK
  • -osx109 : only install OSX 10.9 SDK
  • -osx1010 : only install OSX 10.10 SDK
  • -osx1011 : only install OSX 10.11 SDK
  • -osx1012 : only install OSX 10.12 SDK
  • -osx1013 : only install OSX 10.13 SDK
  • -osx1014 : only install OSX 10.14 SDK
  • -osx1015 : only install OSX 10.15 SDK
  • -path=path : install to custom Xcode at 'path'

Using the older SDKs

To use any of the older SDKs, you should:

  • compile and link with the options -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
  • set the environment variable MACOSX_DEPLOYMENT_TARGET to the proper value (e.g. 10.5) and also set SDKROOT to the location of the SDK - these should be redundant with the -mmacosx-version-min and -isysroot compiler options, but older compilers do not seem to pass this option to the linker.

For example:

env MACOSX_DEPLOYMENT_TARGET=10.6 SDKROOT=/Developer/SDKs/MacOSX10.6.sdk clang -arch i386 -arch x86_64 \
  -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk main.c -o main

When using a Makefile-based build, similarly set the environment variables and use the compilation flags both at compile-time and at link-time (these should typically be added to the CFLAGS and LDFLAGS in the Makefile).

When using a GNU configure-based project, pass these flags to the configure script, as in:

./configure CFLAGS="-g -O2 -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" \
            CXXFLAGS="-g -O2 -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" \
            LDFLAGS="-mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk"

When using Xcode, set the "Base SDK" and "macOS Deployment Target" build settings of the project to the right version. Perhaps a better option is to use the command-line utility xcodebuild to build using these values, rather than modifying the Xcode project file itself, as in:

xcodebuild MACOSX_DEPLOYMENT_TARGET=10.6 SDKROOT=macosx10.6 GCC_VERSION=4.2 CLANG_CXX_LIBRARY=libstdc++ \
 ARCHS="ppc7400 ppc64 i386 x86_64"

Useful values for GCC_VERSION are 4.0, 4.2, com.apple.compilers.llvmgcc42, com.apple.compilers.llvm.clang.1_0. You can use GCC 4.2 or LLVM GCC 4.2 with the 10.4 SDK by passing the CC and CXX options too, as in GCC_VERSION=4.0 CC=gcc-4.2 CXX=g++-4.2.

Valid archs are ppc, ppc7400 (PowerPC G4, minimum CPU requirement to run 10.5), ppc7450, ppc970 (PowerPC G5 32-bit), ppc64, i386, x86_64 (minimum CPU requirement to run 10.7). The dsymutil utility provided with Xcode 7 and later does not work on PPC binaries, so if the GenerateDSYMFile phase fails, just pass the additional option DEBUG_INFORMATION_FORMAT=dwarf to xcodebuild.

Using the older compilers

Links to the compilers are installed in /usr/bin (or /usr/local/bin on OS X 10.11 El Capitan and later): gcc-4.0 g++-4.0 gcc-4.2 g++-4.2 llvm-cpp-4.2 llvm-g++-4.2 llvm-gcc-4.2.

GCC 4.0, GCC 4.2 and LLVM GCC 4.2 cannot compile for OS X 10.10 or newer.

The script also fixes the Mac OS X 10.4 SDK so that it works with GCC 4.2 and LLVM GCC 4.2, and later compilers (officially, it only supports GCC 4.0).

PowerPC architectures (ppc, ppc7400, ppc970, ppc64) cannot be linked for OS X 10.7 or newer (they would be useless anyway, since PowerPC CPUs were only supported up to 10.5).

Note on Xcode versions

Here are the latest versions of Xcode that are known to /run/ on each OS X version (the links work if you sign in to Apple Developer first):

(*) These Xcode versions were released before 26.03.2012 and may cause an "An unknown installation error" during installation, which is due to an expired certificate. Installing these may require disabling network time sync and setting the date to 01.01.2012 before installing. Network time sync may be re-enabled after install. See this stackexchange question for more details.

(**) If you downloaded these Xcode versions (8.2.1, 8.3.3, 9.4.1) before 24th October 2019 the certificate used to sign them has expired and Archive Utility will refuse to unpack them. See this TidBITS article which describes the same problem in OS installers for more details. XcodeLagacy now checks for this problem and prompts you to re-download the archives which now have updated signatures.

More information about the compilers included in each version of Xcode can be found on the MacPorts Wiki and on Wikipedia.

Linking for x86_64 on Xcode 4.4 and later

If targetting 10.6, the following error may appear:

 For architecture x86_64: Undefinedsymbols

 "_objc_retain", from: referenced

     In libarclite_macosx.a ___ARCLite__load (arclite.o)

    (youmeant: _objc_retainedObject maybe)

Symbol not (s) found for architecture x86_64 ld:

Error: linker command failed with exit code use 1 (-v to seeinvocation clang:)

Solution: in the Build Setting of the Project (not for the Target), set the setting "Implicitly Link Objective-C Runtime Support" to NO.

Linking for ppc on Xcode 7.3 and later

Recent versions of Xcode and ld added several options. These should already be 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 that are not yet handled by XcodeLegacy, like:

Running ld for ppc ...
ld: unknown option: -object_path_lto

There are two possible solutions:

  • 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)
  • edit /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld to prune the culprid option (and its argument if there is one).

Known bugs (and fixes) in OS X SDKs

Recent GCC versions cannot build universal binaries

The GCC in Apple SDK is actually a small binary that lauches several compilers and merges the results (see driverdriver.c). The same executable can be compiled for recent GCC versions too, see devernay/macportsGCCfixup on github, resulting in a GCC executable that can be given several architectures on the same command-line.

bad_typeid dyld Error when running executable on Leopard (10.5)

This bug happens when building with the 10.6 or 10.7 SDK, but targetting 10.5. The 10.5 SDK uses libstdc++.6.0.4.dylib whereas later SDKs use libstdc++.6.0.9.dylib.

It can be fixed by adding this snippet somewhere in your code:

#include <AvailibilityMacros.h>
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
const char* ::std::bad_typeid::what() const throw() { return NULL; }
#endif

References:

code compiled with g++ > 4.2.1 crashes with "pointer being freed not allocated"

The problem comes from the fact that some system frameworks load the system libstdc++, which results in incompatible data structures.

After exploring various options (install_name_tool, rpath, etc.), the only solution is to set the environment variable DYLD_LIBRARY_PATH to the path of a directory where you only put a symbolic link to the newest libstdc++ from GCC (libstdc++ is guaranteed to be backward-compatible, not other libraries).

If you are building an application bundle, you should replace your executable by a small executable that sets the environment variable DYLD_LIBRARY_PATH. It can be a script (see below), or a binary (better, because it handles spaces in arguments correctly).

The setdyld_lib_path.c source code can be compiled to act as a "launcher" for your binary that correctly sets the DYLD_LIBRARY_PATH variable. See the full instructions at the top of the source file.

An alternate solution, using a shell-script (doesn't handle spaces in arguments): http://devblog.rarebyte.com/?p=157

Other references:

License

This script is distributed under the Creative Commons BY-NC-SA 3.0 license.

History

  • 1.0 (08/10/2012): First public version, supports Xcode up to version 4.6.3
  • 1.1 (20/09/2013): Xcode 5 removed llvm-gcc and 10.7 SDK support, grab them from Xcode 3 and 4
  • 1.2 (03/02/2014): Xcode 5 broke PPC assembly and linking; fix assembly and grab linker from Xcode 3
  • 1.3 (07/10/2014): Xcode 6 removed 10.8 SDK, grab it from Xcode 5.1.1
  • 1.4 (21/08/2015): Xcode 7 removed 10.9 and 10.10 SDKs, grab them from Xcode 6.4
  • 1.5 (15/10/2015): Fixes for OS X 10.11 El Capitan (nothing can be installed in /usr/bin because of the sandbox)
  • 1.6 (11/11/2015): Fix buildpackages, fix /usr/bin/gcc on recent OS X, fix download messages
  • 1.7 (05/04/2016): Xcode 7.3 disables support for older SDKs, fix that
  • 1.9 (16/09/2016): Xcode 8 dropped 10.11 SDK, get it from Xcode 7.3.1
  • 2.0 (02/05/2017): Xcode 8 cannot always link i386 for OS X 10.5, use the Xcode 3 linker for this arch too. Force use of legacy assembler with GCC 4.x.
  • 2.1 (17/01/2017): Xcode 9 dropped 10.12 SDK, get it from Xcode 8.3.3; fix compiling with GNU Ada, and many other fixes
  • 2.2 (10/01/2019): Xcode 10 dropped 10.13 SDK, get it from Xcode 9.4.1
  • 2.3 (27/03/2019): Added an option to install in a custom Xcode path
  • 2.4 (10/02/2020): Fix for buildpackages if Xcode 8 or Xcode 9 xip have expired signatures. Also now check for stray Xcode.app if extracting Xcode 9.4.1, Fixes for changed download paths and archive names.
  • 2.5 (31/04/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
  • 2.6 (01/05/2021): Xcode 12 dropped 10.15 SDK, get it from Xcode 11.7

xcodelegacy's People

Contributors

apolloniauk avatar devernay avatar ericfromcanada avatar inspector-g avatar jaesgk avatar jwhitlock avatar kranack avatar nathanblais avatar nickwww avatar pedrovieira avatar raxoft avatar zwettemaan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodelegacy's Issues

buildpackages yields error message

Newest XcodeLegacy.sh generates a few errors when doing 'buildpackages' on the same source media as worked with earlier versions of the script. Errors are as follows:

*** Created Xcode3gcc42.tar.gz in directory /Users/scott/XcodeUpdates
*** Created Xcode3llvmgcc42.tar.gz in directory /Users/scott/XcodeUpdates
patching file hashtable
Hunk #2 FAILED at 1042.
Hunk #3 succeeded at 1217 with fuzz 1.
1 out of 3 hunks FAILED -- saving rejects to file hashtable.rej
*** Created Xcode104SDK.tar.gz in directory /Users/scott/XcodeUpdates
patching file hashtable
Hunk #2 FAILED at 1042.
Hunk #3 succeeded at 1217 with fuzz 1.
1 out of 3 hunks FAILED -- saving rejects to file hashtable.rej
*** Created Xcode105SDK.tar.gz in directory /Users/scott/XcodeUpdates
*** Created Xcode106SDK.tar.gz in directory /Users/scott/XcodeUpdates
"disk2" unmounted.
"disk2" ejected.

Running 'install' afterwards does not generate any errors, but I'm not sure what problems may be hiding under the surface.

Compiler + Xcode 10.1 Error

When I install the older compilers for Xcode 10.1 on High Sierra I get the following error at (any) compile:

: could not create session: requestError(description: "unknown error
: while handling message: unableToInitializeCore(errors:
: ["/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/
: Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC
: 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec
: \':com.apple.compilers.gcc\' already registered from
: /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents
: /SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM
: 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec",
: "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/
: Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC
: 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec
: \'Class\': \'PBXCompilerSpecificationGcc3_3\'",
: "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/
: Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC
: 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec
: \'Class\': \'PBXCompilerSpecificationGcc3_3\'"])")

Xcode 7 (beta) support

Has anyone looked at supporting Xcode 7 yet? With Xcode 6.4 not being supported on OS X 10.11 El Cap the lack of XcodeLegacy will be a serious impediment to my using El Cap.

Also, I want to say thanks for this. Great work.

After installing packages with latest XcodeLegacy, GNU Ada fails to build projects using gprbuild

After installing using latest XcodeLegacy onto Xcode 8.3.2, trying to compile an Ada program using either command-line 'gprbuild' or GUI gps (GNAT Programming Studio), get the following:

Error: cannot find as for x86_64 in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../../../as/x86_64
gprbuild: *** compilation phase failed

If I use XcodeLegacy to uninstall packages and revert back to stock Xcode, the Ada project compiles.

Not sure this is an issue with XcodeLegacy, but I can't find any related messages regarding GNAT either.

ppc/ppc64 assembler and linker problems for Xcode 5.0.2

Your shell script works great! However, I found a few issues regarding Xcode 5.0.2 and ppc/ppc64 support (I have no idea if these issues are present in Xcode 5.0.0 and 5.0.1).

When attempting to build a project for ppc/ppc64, Xcode 5.0.2 cannot find the correct as command. Also, the ld binary within Xcode.app refuses to link ppc/ppc64 architectures.

I have forked your repo and committed some changes to resolve these issues. Please take a look and merge them in, if you find them acceptable! I did not go so far as to check the version of Xcode before performing the necessary operations to fix the problem for 5.0.2 (all the machines I am personally concerned about are running 5.0.2), so you might want to add a couple checks for <5 and >=5 if you choose to apply my patch.

Thanks!

Feedback

For some reason some script functions do not appear to take effect? trying to compile tiger with gcc 4.2 complains it is not supported.
Whoops, looks like I missed the extra files on the repository but, still...

Additionally for some reason i am getting sdk not found in xcode when $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk is specified.
Latest Snow Leopard SDK appears to be shipped in Xcode 4.3.3 for Lion (and perhaps this applies to snow leopard version too, i assume)

PS: for some reason it's unable to link because some files do not appear to exist on the linking directory!?

PS: May I email or chat you?

Bad Info.plist created for Xcode 10.0

The install program produces a sed error but modifies the plist.

  • creating link /usr/local/bin/powerpc-apple-darwin10-gcc-4.2.1
  • creating link /Applications/Xcode.app/Contents/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1
    sed: RE error: illegal byte sequence
    *** modified MacOSX Info.plist

Sure enough when I try make a project:

could not create session: requestError(description: "unknown error while handling message: unableToInitializeCore(errors: ["/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform: error: unable to load platform: \'Info.plist\' was malformed: Couldn\'t parse property list because the input data was in an invalid format", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec \':com.apple.compilers.gcc\' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'", ": error: missing required Mac OS X platform"])")

"No value to remove at key path MinimumSDKVersion"

Using OSX 10.9.5 and starting with Xcode 6.2:

  • I downloaded the linked Xcode3 and 4 installers
  • I ran "./XcodeLegacy.sh -compilers -osx104 buildpackages" which appears to successfully extract all the components
  • I ran "sudo ./XcodeLegacy.sh -compilers -osx104 install" which mostly succeeds, but produces this error near the end:
*** Info: found Xcode >= 4.3 in /Applications/Xcode.app
*** installed XcodePluginGCC40.tar.gz
(...)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/powerpc-apple-darwin10-gcc-4.2.1 exists
* creating link /usr/bin/powerpc-apple-darwin10-gcc-4.2.1
* creating link /Applications/Xcode.app/Contents/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist-original: Could not modify plist, error: No value to remove at key path MinimumSDKVersion
*** modified MacOSX Info.plist

and the resulting install is broken (it contains Info.plist-original, but no Info.plist)
...the XcodeLegacy.sh comment says "# Xcode >= 7.3 disables support..." but the logic modifying Info.plist isn't protected for installing into Xcode >= 7.3 ... :(

GCC 4.0, GCC 4.2 and LLVM GCC 4.2 compilers not found

/Applications/Xcode.app/Contents/Developer/usr/bin/c++-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/cpp-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/g++-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/gcov-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-cpp-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.0
/Applications/Xcode.app/Contents/Developer/usr/bin/c++-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/cpp-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/g++-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/gcov-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-cpp-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2

These soft link are linked to /usr/bin but the compilers are put to folder /usr/local/bin, so caused the issue "No such file or directory"

Please check line 320 in the script

Transfer of clang compiler from Xcode 5 into Xcode 7

Would it be possible to add support for e.g. embedding the clang compiler toolchain from e.g. Xcode 5.1.1 and have it as an option within e.g. Xcode 7.x? Alternatively, is there a good resource out there to dig into in order to be able to do this and potentially submit a PR to this repo with an eventual implemented solution?

Unable to extract 10.12SDK from Xcode8.3.3.xip

It seems that it's too late:

$ pkgutil --verbose --check-signature ./Xcode8.3.3.xip 

Package "Xcode8.3.3.xip":
Status: signed by a certificate that has since expired
Certificate Chain:
1. Software Update
SHA1 fingerprint: 1E 34 E3 91 C6 44 37 DD 24 BE 57 B1 66 7B 2F DA 09 76 E1 FD
-----------------------------------------------------------------------------
2. Apple Software Update Certification Authority
SHA1 fingerprint: FA 02 79 0F CE 9D 93 00 89 C8 C2 51 0B BC 50 B4 85 8E 6F BF
-----------------------------------------------------------------------------
3. Apple Root CA
SHA1 fingerprint: 61 1E 5B 66 2C 59 3A 08 FF 58 D1 4A E2 24 52 D1 98 DF 6C 60

I'm stuck... Any idea to workaround?

installing errors

hi devernay,
when I run 'sudo sh XcodeLegacy.sh install', several errors happened.
I want to use 10.7 SDK, what should I do? plz help me
here is the information:

Last login: Sun Jan 18 21:33:23 on ttys000
gnimucs-mini:~ Zero$ cd downloads/xcodelegacy-master/
gnimucs-mini:xcodelegacy-master Zero$ ls
README.md xcode_3.2.6_and_ios_sdk_4.3.dmg
XcodeLegacy.sh
gnimucs-mini:xcodelegacy-master Zero$ sudo sh XcodeLegacy.sh install
Password:
Info: found Xcode >= 4.3
gzip: can't stat: XcodePluginGCC40.tar.gz (XcodePluginGCC40.tar.gz.gz): No such file or directory
installed XcodePluginGCC40.tar.gz
gzip: can't stat: XcodePluginGCC42.tar.gz (XcodePluginGCC42.tar.gz.gz): No such file or directory
installed XcodePluginGCC42.tar.gz
gzip: can't stat: XcodePluginLLVMGCC42.tar.gz (XcodePluginLLVMGCC42.tar.gz.gz): No such file or directory
installed XcodePluginLLVMGCC42.tar.gz
gzip: can't stat: XcodePPCas.tar.gz (XcodePPCas.tar.gz.gz): No such file or directory
installed XcodePPCas.tar.gz
gzip: can't stat: Xcode3ld.tar.gz (Xcode3ld.tar.gz.gz): No such file or directory
cp: directory /Applications/Xcode.app/Contents/Developer/usr/libexec/gcc/darwin/ppc does not exist
cp: directory /Applications/Xcode.app/Contents/Developer/usr/libexec/gcc/darwin/ppc64 does not exist
installed Xcode3ld.tar.gz
gzip: can't stat: Xcode104SDK.tar.gz (Xcode104SDK.tar.gz.gz): No such file or directory
installed Xcode104SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.4u.sdk/legacy: No such file or directory
gzip: can't stat: Xcode105SDK.tar.gz (Xcode105SDK.tar.gz.gz): No such file or directory
installed Xcode105SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.5.sdk/legacy: No such file or directory
gzip: can't stat: Xcode106SDK.tar.gz (Xcode106SDK.tar.gz.gz): No such file or directory
installed Xcode106SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/legacy: No such file or directory
gzip: can't stat: Xcode107SDK.tar.gz (Xcode107SDK.tar.gz.gz): No such file or directory
installed Xcode107SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/legacy: No such file or directory
gzip: can't stat: Xcode108SDK.tar.gz (Xcode108SDK.tar.gz.gz): No such file or directory
installed Xcode108SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/legacy: No such file or directory
Installing GCC 4.0
installer: Error the package path specified was invalid: 'xcode_3.2.6_gcc4.0.pkg'.
Installing GCC 4.2
installer: Error the package path specified was invalid: 'xcode_3.2.6_gcc4.2.pkg'.
Installing LLVM GCC 4.2
installer: Error the package path specified was invalid: 'xcode_3.2.6_llvm-gcc4.2.pkg'.

gcc error

Hello,

I'm using a fresh Maverics Vagrant box provided here.

I use the script from the Git repository (last commit Sep 7, 2015).

Install works:

./XcodeLegacy.sh buildpackages
sudo ./XcodeLegacy.sh install

But when I try to invoke gcc, I get the error:

gcc: error: can't exec '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec/gcc' (errno=Permission denied)

star is interpreted literally

On line 332, the star at rm -rf "$GCCDIR/usr/bin/*4.0" is interpreted literally, since it's inside quotes. To have it expand properly, it should be unquoted: rm -rf "$GCCDIR/usr/bin/"*4.0

"ld: warning: bad symbol action"

Using OSX 10.9.5 and starting with Xcode 6.2:

  • I downloaded the linked Xcode3 and 4 installers
  • I ran "./XcodeLegacy.sh -compilers -osx104 buildpackages" which appears to successfully extract all the components
  • I ran "sudo ./XcodeLegacy.sh -compilers -osx104 install" which mostly succeeds, but produces a "No value to remove at key path MinimumSDKVersion" error (as noted in Issue #53)
  • I restored the missing /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
  • I opened an existing Xcode project, which is configured to build i386 and x86_64 against the 10.9 SDK, deploying to 10.4. With no project changes (i.e. NOT changing the SDK or compiler), I now receive these new "bad symbol action" ld warnings:
Ld build/App.build/Debug/App.build/Objects-normal/i386/App normal i386
    cd /Users/arekkusu/App
    export MACOSX_DEPLOYMENT_TARGET=10.4
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/arekkusu/App/build/Debug -F/Users/arekkusu/App/build/Debug -filelist /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App.LinkFileList -mmacosx-version-min=10.4 -fobjc-link-runtime -framework Cocoa -framework OpenGL -Xlinker -dependency_info -Xlinker /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App_dependency_info.dat -o /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App

ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//CoreGraphics.framework/CoreGraphics
ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//ImageIO.framework/ImageIO
ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//CFNetwork.framework/CFNetwork

Cant install 10.10 sdk from gz

I have manually added to my computer the Xcode1010SDK folder in the same directory where the legacy script lives. I also added in same directory the .gz folder
I get the following issue notice the gz.gz

sudo ./XcodeLegacy.sh -osx1010 install
*** Info: found Xcode >= 4.3
gzip: can't stat: Xcode1010SDK.tar.gz (Xcode1010SDK.tar.gz.gz): No such file or directory
*** installed Xcode1010SDK.tar.gz
touch: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/legacy: No such file or directory
*** Not modifying MacOSX Info.plist (found original at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist-original, uninstall first to force install)

OS X 10.11 and "ld: library not found for -lgcc_s.10.4"

Hi,
Seems to me that certain things are having problems. Not sure exactly what is up but I struggled to compile freetype-2.6 for ppc. First configure bailed with this message. After editing the right configure so it wouldn't bail, I was able to run make for a bit until it stumbled again over this error.
Not much out there yet about this error but it seems some weird error related to El Capitan...

Useful tips for ppc and i386 in XCode12 and others

Hi Everyone,
this is not an "issue" but just useful info which may hopefully end up in improvements to the script, but in the mean time, here it is in text form:

Xcode 12 blocks compilation of i386, even if you have a working compiler imported that supports i386.
Through painful trial and error, I traced which file you need to change in order to make it work:

  • Open: /Applications/Xcode12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources/MacOSX Architectures.xcspec
  • Find: DeprecatedError = YES;
  • Change to: DeprecatedError = NO;

GCC 4.2 i386 creates linker problems
Once you get i386 working with xcode12, you'll have problems linking, with weird output.
The solution is to use the i386 assembler from xcode 3.2.6 and replace the one in xcode12 that XcodeLegacy.sh has put in

  • go to /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec/as/i386
  • rename as to as_old
  • copy i386 assembler from xcode3.2.6: /Developer/usr/libexec/gcc/darwin/i386/as

GCC 4.2 compiles ppc but resulting binary lists as ppc7400
"ppc" is G3 compatible while "ppc7400" is G4.
After a while I figured out that the compiler provides proper binaries but the final linker messes it up!
The reason is that gcc4.2 links with crt3.o which only has ppc7400 in it. So to solve it, just take crc3.o from gcc4.0 (which is ppc) and merge it into a fat binary with gcc4.2'sn crt3.o. After that you get proper ppc binaries that I confirm work properly on actual G3 devices.

commands:

  • mv /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/crt3.o /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/crt3_old_ppc7400_only.o
  • lipo /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/crt3.o /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/crt3_old_ppc7400_only.o -create -output /Users/kreso/Downloads/GPP/lib/gcc/powerpc-apple-darwin10/4.2.1/crt3.o

Linker crashes with 'Bus Error 10'
g++-4.2 is called by xcode 12 to link the final binary, and it gives wrong parameters (-target instead of -arch) and some params and environment variables are missing compared to what xcode 3.2.6 does when installed on osx 10.6.8.
So I made a python script that you replace g++-4.2 with to intercept and transform linker calls and forward them to the old binary. File attached

Instructions:

  • rename g++-4.2 into g++-4.2_old, xcode 12 calls it with wrong arguments when linking so we have to put our middleman script in it's place to handle that
  • extract hacked_linker_g++-4.2.zip, it'll create a file 'g++-4.2', put in where the old one was. it's a python script
  • make it executable using chmod +x <path_to_g++-4.2>

Libtool merges ppc and ppc7400 when creating a fat binary
If you need to compile a binary that has G3 and G4 code separate, then you'll find that libtool messes this up, with many warnings. Basically it removes ppc7400 and just leaves in ppc. To solve this, you'll need to replace libtool file in xcode12's gcc toolchain with a script that uses "lipo" instead of libtool when this situation is detected. I'm attaching a python script I wrote.

  • Go to /Applications/Xcode12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • rename libtool to libtool_old
  • put my script there as 'libtool' and make it executable

That's it from me, let me know if you run into any further trouble and I'll try to help out, I spent 2 days on this, but in the end I have a working xcode12 that I use to compile for powerpc, i386 and x86_64, targeting osx 10.4 and it works like a charm! Thanks xcodelegacy! Hope my contribution will have value to someone else :)

Attachments:
hacked_libtool.zip
hacked_linker_g++-4.2.zip

10.11.2 El Captain Install Failed

Installing LLVM GCC 4.2
installer: Package name is xcode_3.2.6_llvm-gcc4.2
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)

Hi

I'm using the 10.11.2 with Xcode 7, now I need the old compiler toolchain. In the 10.9 I could use the script to install the package correctly, but now even I manually input installer -pkg xcode_3.2.6_gcc4.0.pkg -target /, it still reported the error. Thanks a lot !

Instructions no longer work on macOS 11.1: "mkdir: /Developer: Read-only file system"

jukkaj-0A4M:xcodelegacy jukkaj$ sudo ./XcodeLegacy.sh -osx1013 install
Password:
*** Info: found Xcode >= 4.3 in /Applications/Xcode.app
*** installed Xcode1013SDK.tar.gz
*** modified MacOSX Info.plist
*** Warning: /Developer/SDKs should be a symlink to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
Check that /Developer exists, and fix /Developer/SDKs with:
$ sudo ln -sf '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs' /Developer/SDKs
jukkaj-0A4M:xcodelegacy jukkaj$ ls /Developer
ls: /Developer: No such file or directory
jukkaj-0A4M:xcodelegacy jukkaj$ mkdir /Developer
mkdir: /Developer: Read-only file system
jukkaj-0A4M:xcodelegacy jukkaj$ sudo mkdir /Developer
mkdir: /Developer: Read-only file system
jukkaj-0A4M:xcodelegacy jukkaj$

Safe for use with XCode 6.1.1?

Have just tried against 6.1.1, and am seeing lots of:

Running ld for i386 ...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-original: fork: Resource temporarily unavailable
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-original: line 37: Running: command not found
....
clang: error: unable to execute command: No such file or directory
clang: error: linker command failed due to signal (use -v to see invocation)

Granted, may have nothing to do with the xcodelegacy installs, but thought we should run it by you!

Extract 10.12 SDK from Xcode 8.3.3 (to do before release of macOS 10.13/Xcode 9)

Xcode 8.3.3 is distributed as a xip archive.
I managed to extract something from it by:

xar -xvf Xcode8.3.3.xip
pbzx Content 2>/dev/null | tar xf - ./Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
  • the SDK is in ./Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk (/not/ MacOSX10.12.sdk)

There seems to be errors during the extraction. Are these fatal?

That also means XcodeLegacy.sh has to rely on the pbzx tool (if not available, the script could give the recipe to compile and install it in /usr/local/bin - it does not seem to be available from MacPorts or homebrew)

As noted in #24 (comment) we cannot distribute the SDKs. They are available here but this infringes the Xcode licence. Maybe we could just let the user download the SDK from that source?

see also:
https://stackoverflow.com/questions/40414645/how-to-extract-xip-archive-using-command-line

Link Time Optimization in XCode 8 creates problems

Similar to the deduplicate there seems to be flags introduced by default that the ppc linker doesn't understand.

Running ld for ppc ...ld: unknown option: -object_path_lto
collect2: ld returned 1 exit status

If you manually edit the link command and eliminate this option and the lto one that follows it, it does successfully link.

Symlink to C compiler (cc)

Is there a reason why no symlinks are created for cc ?

When building c code package, the message - clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.4u.sdk' is presented.

Of course if I extract MacOSX104.tar.gz and place the contents in /Developer/SDKs/... no message is presented. However, as this sort of 'manual move' is not in your instruction, I'm not sure if doing it advisable ?

Cheers,

Option to provide the app path

Hi there,

I am in a case where I need to have both Xcode 7 and 8 installed on the same machine, but the XcodeLegacy script installs in Xcode.app by default. Mine are called Xcode7.app and Xcode8.app, and I need to automate that installation so it's not easy to rename them.
Would it be possible to have an extra argument with the app to target instead of using the default one? e.g.
sudo ./XcodeLegacy.sh -osx1012 install --path /Applications/Xcode7.app

Regards,
Maxime

Can't compile after running xcode legacy (XCode 10 or 11)

I get the issue below. Even when running a simple command line test after using xcodelegacy install (which seems to install fine).

Showing Recent Messages
: unknown error while handling message: unableToInitializeCore(errors: ["/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec ':com.apple.compilers.gcc' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'"])

Any ideas?

ld issue for ppc compiler

Could not compiler the ppc target with these components.

Steps:

  1. Make a fresh project with Xcode 7.3.1.
    2.Set the Base SDK to Mac OS X 10.5
    3.Set the Compiler to GCC 4.2
    4.Set the Deploy target to OS X 10.5
    5.Compiler

Result:

Ld DerivedData/test/Build/Products/Debug/test.app/Contents/MacOS/test normal ppc
cd /Users/xxx/Desktop/test
export MACOSX_DEPLOYMENT_TARGET=10.5
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.0 -arch ppc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.5.sdk -L/Users/xxx/Desktop/test/DerivedData/test/Build/Products/Debug -F/Users/xxx/Desktop/test/DerivedData/test/Build/Products/Debug -filelist /Users/xxx/Desktop/test/DerivedData/test/Build/Intermediates/test.build/Debug/test.build/Objects-normal/ppc/test.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -mmacosx-version-min=10.5 -Xlinker -no_deduplicate -fobjc-link-runtime -framework Cocoa -Xlinker -dependency_info -Xlinker /Users/xxx/Desktop/test/DerivedData/test/Build/Intermediates/test.build/Debug/test.build/Objects-normal/ppc/test_dependency_info.dat -o /Users/xxx/Desktop/test/DerivedData/test/Build/Products/Debug/test.app/Contents/MacOS/test

Running ld for ppc ...
ld: unknown option: -no_deduplicate
collect2: ld returned 1 exit status
Command /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.0 failed with exit code 1

OSX 10.11: installing compilers (GCC 4.0, GCC 4.2, LLVM-GCC 4.2) fail

Can anyone help?

*** Installing GCC 4.0
installer: Package name is xcode_3.2.6_gcc4.0
installer: Installing at base path /
installer: The install failed (Le programme d’installation a rencontré une erreur qui a provoqué l’échec de l’installation. Contactez l’éditeur du logiciel pour obtenir de l’aide.)
*** Installing GCC 4.2
installer: Package name is xcode_3.2.6_gcc4.2
installer: Installing at base path /
installer: The install failed (Le programme d’installation a rencontré une erreur qui a provoqué l’échec de l’installation. Contactez l’éditeur du logiciel pour obtenir de l’aide.)
*** Installing LLVM GCC 4.2
installer: Package name is xcode_3.2.6_llvm-gcc4.2
installer: Installing at base path /
installer: The install failed (Le programme d’installation a rencontré une erreur qui a provoqué l’échec de l’installation. Contactez l’éditeur du logiciel pour obtenir de l’aide.)

buildpackages privileges

Really love your script, and thank you for the work! I think you may want a privs check on the buildpackages step as well. Extraction of man pages, etc. is expecting to create dirs...

GCC 4.0 ~ ld problem?

Hi,
first of all, thanks a lot for this script!

I'm trying to use GCC 4.0 to target Mac OS 10.4 and have the following error:

ld: error: can't exec '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec/ld' (errno=Permission denied)
collect2: ld returned 71 exit status

When running your script, there was a related error:

./XcodeLegacy.sh: line 180: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld: Permission denied
chmod: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld: No such file or directory
installed Xcode3ld.tar.gz

In the end, the directory /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld does exist, but only contains a ppc and a ppc64 directory. I guess there should also be a i386 directory there?

Latest 2.1 missing uninstall for 10.12 SDK

At line 1186 replace

    if [ "$osx1011" = 1 ]; then
        i=10.11
        [ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
    fi

with

    if [ "$osx1011" = 1 ]; then
        i=10.11
        [ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
    fi
    if [ "$osx1012" = 1 ]; then
        i=10.12
        [ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
    fi

...appears to work correctly.

Is it possible to add a Xcode 3.2 from 10.6 PPC?

There exists a developer version of 10.6 for PowerPC, and it has working Xcode 3.2. I am interested to compile some software for it like Rstudio and Stan, however I have only managed to get R 4.1.1 built on it (with multiple tweaks to bypass dependency on gcc11), and there it stuck, some components still need gcc11.
I have come across the post that advises XcodeLegacy to build a cross-compiler on Intel Mac to be used for building software for PowerPC: http://maniacsvault.net/articles/powerpccross

Now, the issue is that no commonly available releases of Xcode support 10.6 PPC. The needed version is bundled with 10A96 and 10A109 builds, which can be downloaded here: https://macintoshgarden.org/apps/mac-os-x-snow-leopard-powerpc-the-early-106-developer-builds
More info on 10.6 PPC here: https://forums.macrumors.com/threads/snow-leopard-on-unsupported-ppc-machines.2232031/

Will it be possible to add this option to the script in order to extract needed components from this specific Xcode and install in Xcode 12?

as and ld Intel-only in ppc and ppc64 libexec?

I am sorry if I get this wrong, but as and ld files that are installed into /Applications/Xcode.app/Contents/Developer/usr/libexec/gcc/darwin/ppc and /Applications/Xcode.app/Contents/Developer/usr/libexec/gcc/darwin/ppc64 both contain only x86_64 and i386 architectures. Shouldn't they be for ppc and ppc64 instead?

I have used the script in its default form (complete install) on MacOS Catalina with Xcode 12.4.

setting `MACOSX_DEPLOYMENT_TARGET` does it require the sdk?

when working with cmake based projects i see some references while doing searches to set the below cmake/env var

MACOSX_DEPLOYMENT_TARGET

i've recently started setting that var (cmake) with -DMACOSX_DEPLOYMENT_TARGET="10.9" per this

i'm setting this var because i am publishing releases for older versions of macos and setting that var allows me to run my app bundles ie. MyProject.app on big sur, catalina, and mojave.

my question do i need to download the 10.9 SDK and set that up, or is the current version of xcode installed on big sur able to use that var with cmake without having to download install the older sdk?

thanks for making this github repo BTW 🙏

MacOSX10.5.sdk libgcc_s.10.5.dylib fix breaks linking PowerPC64 executables.

The Leopard SDK libgcc_s.10.5.dylib missing symbols bugfix replaces the Leopard SDK build of this library with the copy from the Snow Leopard SDK, which does not support PowerPC64. This prevents any PowerPC64 executable that needs this library from successfully linking.

If reasonable, it'd be nice to have the fix extract the PowerPC64 library from the old libgcc_s.10.5.dylib and insert it into the new one:

pushd /tmp/XC3-10.5/SDKs/MacOSX10.5.sdk/usr/lib/
cp libgcc_s.10.5.dylib libgcc_s.10.5.dylib.bak
lipo libgcc_s.10.5.dylib.bak -extract ppc64 -output _ppc64.dylib
lipo -create $SDKROOT/usr/lib/libgcc_s.10.5.dylib _ppc64.dylib -output libgcc_s.10.5.dylib
rm _ppc64.dylib
popd

Alternatively, a command line option to opt-out might be better than having to manually diagnose and revert it :(.

Xcode 7.3 MinimumSDKVersion key

After upgrading to Xcode 7.3 and copying the 10.6 SDK into Xcode.app, xcodebuild gave me the following error when building a 10.6 SDK-based project:

[MT] DVTSDK: Skipped SDK /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk; its version (10.6) is below required minimum (10.11) for the macosx platform.

Xcode 7.3's /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist now contains a MinimumSDKVersion key which is set to 10.11. After removing this key/value from the Info.plist, building with the 10.6 SDK works as it did before.
I haven't tested XcodeLegacy, but I imagine it will need to make this change for Xcode 7.3+.

10.11 SDK on Xcode 8.3.3: "SDK not found"

Xcodelegacy.sh installed the 10.11 SDK in the right place within my Xcode.app folder.

However, when I chang the Base SDK from macosx10.12 to macosx10.11, when I dismiss the popup
the Base SDK setting is "macosx10.11 (SDK not found)"

I speculate that I need the 10.11 SDK because the 10.12 is not correctly building my kernel extension. kextutil on 10.11 complains that my kext is missing a function symbol.

libLTO detect under Xcode 9

This patch work with Xcode 9 with target 10.6

--- a/XcodeLegacy.sh
+++ b/XcodeLegacy.sh
@@ -876,6 +876,9 @@ if [ "\$USE_OLD_LD" -eq '1' ]; then
                 elif [ "\$var" = '-object_path_lto' ]; then
                         OBJECT_PATH_LTO_FOUND=1
                         continue
+                elif [ "\$var" = '-lto_library' ]; then
+                        OBJECT_PATH_LTO_FOUND=1
+                        continue
                 elif [ "\$var" = '-no_deduplicate' ]; then
                         continue
                 elif [ "\$var" = '-export_dynamic' ]; then

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.