Code Monkey home page Code Monkey logo

Comments (8)

devernay avatar devernay commented on August 20, 2024

/Developer/SDKs should be a symlink to the place where Xcode finds the SDKs, and where XcodeLegacy installs these. Was there no /Developer/SDKs symlink on your system? I don't know if mine was created by Xcode or if I did it my self (5 years ago):

$ ls -l /Developer/SDKs
lrwxr-xr-x  1 root  wheel  83  4 avr  2012 /Developer/SDKs -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

Can you please give me the output of the above command on your system?

If that link doesn't exist on your system, create it with

sudo mkdir /Developer
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /Developer/SDKs

cc is the system's compiler, and should remain linked to clang, the default compiler for your system.

It is not advisable to use cc or clang to compile for 10.4. You should explicitly modify the compiler name in your build system and use either gcc-4.0 or gcc-4.2, because there maybe problems with more recent versions of gcc in the SDK.

from xcodelegacy.

trevorsandy avatar trevorsandy commented on August 20, 2024

Here's the info you requested - sorry for the length.

I want to start with this item:

It is not advisable to use cc or clang to compile for 10.4. You should explicitly modify the compiler name in your build system and use either gcc-4.0 or gcc-4.2, because there maybe problems with more recent versions of gcc in the SDK.

I'm building a submodule to my project for backwards compatibility. Ldglite. 135a318 is the specific commit around this issue.

cc (clang) was used to compile the original makefiles (see makefile.macx) and, if I recall I had a link issue using gcc-4.0 and gcc-4.2 with 10.4 (or SDK 10.7 and 10.9 for that matter), I can't remember but I'll try again later to validate. Perhaps the link issue was because the code uses Carbon?

Anyway, you're quite right about issues with cc and 10.4u (see error output at the bottom). I was successful to compile using cc on 10.7 and later however but I still can't get the -arch ppc target to work at that SDK.

==========

/Developer/SDKs should be a symlink to the place where Xcode finds the SDKs, and where XcodeLegacy installs these. Was there no /Developer/SDKs symlink on your system? I don't know if mine was created by Xcode or if I did it my self (5 years ago):

I'm using a virgin Sierra build (10.12) on VMWare. There was no symlink or SDKs directory in /Developer

Can you please give me the output of the above command on your system?

Trevors-Mac:xcodelegacy-master trevorsandy$ ./XcodeLegacy.sh -osx104 buildpackages
*** Info: found Xcode >= 4.3
Checksumming Driver Descriptor Map (DDM : 0)…
     Driver Descriptor Map (DDM : 0): verified   CRC32 $39967158
Checksumming  (Apple_Free : 1)…
                    (Apple_Free : 1): verified   CRC32 $00000000
Checksumming Apple (Apple_partition_map : 2)…
     Apple (Apple_partition_map : 2): verified   CRC32 $343E1E47
Checksumming Macintosh (Apple_Driver_ATAPI : 3)…
  Macintosh (Apple_Driver_ATAPI : 3): verified   CRC32 $F1E8BA9E
Checksumming  (Apple_Free : 4)…
                    (Apple_Free : 4): verified   CRC32 $00000000
Checksumming disk image (Apple_HFS : 5)…
.................................................................................................................................................................................................
          disk image (Apple_HFS : 5): verified   CRC32 $7713A7E9
Checksumming  (Apple_Free : 6)…
                    (Apple_Free : 6): verified   CRC32 $00000000
verified   CRC32 $60727D28
/dev/disk1          Apple_partition_scheme         
/dev/disk1s1        Apple_partition_map            
/dev/disk1s2        Apple_Driver_ATAPI             
/dev/disk1s3        Apple_HFS                      /Users/trevorsandy/Downloads/xcodelegacy-master/mount.3cS/Xcode and iOS SDK
patching file hashtable
*** Created Xcode104SDK.tar.gz in directory /Users/trevorsandy/Downloads/xcodelegacy-master
"disk1" unmounted.
"disk1" ejected.
Trevors-Mac:xcodelegacy-master trevorsandy$ sudo ./XcodeLegacy.sh -osx104 install
Password:
*** Info: found Xcode >= 4.3
*** installed Xcode104SDK.tar.gz
*** modified MacOSX Info.plist
Trevors-Mac:xcodelegacy-master trevorsandy$

===========

The SDK was installed ok:

MacOSX10.4u.sdk - Mac OS X 10.4 (macosx10.4)
SDKVersion: 10.4
Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.4u.sdk
PlatformVersion: 1.1
PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
ProductBuildVersion: 8S2167
ProductCopyright: 1983-2007 Apple Inc.
ProductName: Mac OS X
ProductUserVisibleVersion: 10.4.11
ProductVersion: 10.4.11

===========

Error Generated:

Trevors-Mac:ldglite trevorsandy$ make -f makefile.macx
cc -g -I./osx -DUNIX -DMACOS_X -DUSING_CARBON -DUSE_OPENGL -DUSE_L3_PARSER -DUSE_BMP8 -DNEED_MIN_MAX -I./macx/include -DUSE_PNG -I./macx/png/include -DTILE_RENDER_OPTION -DCGL_OFFSCREEN_OPTION -DTEST_MUI_GUI -I./mui/src -DUSE_GLUT_MENUS -I./macx/glut/include -Ildrawini -DNOT_WARPING -DVISIBLE_SPIN_CURSOR -DSAVE_DEPTH_ALL -DSAVE_COLOR_ALL -DMACOS_X_TEST2 -DHAVE_STRDUP -arch i386 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk   -c -o ldliteVR_main.o ldliteVR_main.c
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.4u.sdk'
ldliteVR_main.c:19:10: fatal error: 'stdio.h' file not found
#include "stdio.h"
         ^
1 error generated.
make: *** [ldliteVR_main.o] Error

===========

When using 10.4u, I got the error below which I understand is due to additional mach checks started in 10.11. This is using an extracted instance of the 10.4 build by XcodeLegacy.

SDK10.4u error:

if [ -d mui/src/mui ] ; then cd mui/src/mui ; /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.macx libmui.a ; fi
cc -I../../src -I../../../macx/glut/include -arch i386 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -force_cpusubtype_ALL gizmo.o glutmui.o displaylist.o uicolor.o miscui.o mui.o vslider.o textlist.o button.o pulldown.o hslider.o -o mui -framework OpenGL -framework GLUT -framework Carbon -lobjc -lstdc++  -lm 
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
ld: in '/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//Accelerate.framework/Versions/A/Accelerate', malformed mach-o, symbol table not in __LINKEDIT
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libmui.a] Error 1
make: *** [libmui.a] Error 2

=============

cc is the system's compiler, and should remain linked to clang, the default compiler for your system.

I agree. My point was not to point cc to something else, but to have the SDK (-isysroot) recognized when using it. I imagine the linking you suggested will resolve the reported behaviour.

Cheers,

from xcodelegacy.

devernay avatar devernay commented on August 20, 2024

The command I wanted to see the output of is:

$ ls -l /Developer/SDKs
lrwxr-xr-x  1 root  wheel  83  4 avr  2012 /Developer/SDKs -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

If that link doesn't exist on your system, simply create it with

sudo mkdir /Developer
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /Developer/SDKs

from xcodelegacy.

devernay avatar devernay commented on August 20, 2024

and you should really use gcc-4.2/g++-4.2 when compiling for 10.4. The Xcode clang is not capable of producing ppc code anyway.

from xcodelegacy.

trevorsandy avatar trevorsandy commented on August 20, 2024

Your solution worked very well - many thanks.

Is there a separate debugger for ppc that should be installed with its respective SDK(s) ? I'm trying to build a ppc toolchain kit for Qt. (QtCreator). I'm not allowed to select a ppc debugger (ldb or lldb) because the installed debuggers are reported to have an incompatible ABI.

If you want this question on its own issue, let me know. Thanks.

from xcodelegacy.

devernay avatar devernay commented on August 20, 2024

from xcodelegacy.

reukiodo avatar reukiodo commented on August 20, 2024

I know this is not the best place to ask this, but how would one configure a project to compile such that architecture defines sdk used, then merged into a universal binary:
ppc -> 10.4 sdk
ppc64 -> 10.5 sdk
i386 -> 10.6 sdk
x86_64 -> 10.9 sdk

from xcodelegacy.

devernay avatar devernay commented on August 20, 2024

build each binary for each arch separately, then merge them using lipo. The problem is that the info.plist should specify a minimum osx version. in your case, that would be 10.4, but the i386 binary would be 10.6.
What I would do is provide two binaries: ppc/i386 for 10.4 and x86_64/i386 for 10.6. That covers every system until 10.12
all ppc64 can run ppc, so you don't really need this.

from xcodelegacy.

Related Issues (20)

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.