README.osX 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. DARWIN / MAC OS X PLATFORM SPECIFIC NOTES FOR GCC4TI:
  2. ====================================================
  3. Purpose of this document
  4. ------------------------
  5. This document gives installation instructions specific to the Darwin / Mac OS X
  6. platform. This is necessary because, while compiling GCC4TI is easy on most Unix-
  7. style operating systems, and while GCC4TI can also be compiled on Darwin / OS X,
  8. installation on Darwin / OS X is unfortunately not an easy task. Please make
  9. sure you:
  10. 1. read README, README.linux (which also applies to other Unix-style operating
  11. systems than Linux, such as Darwin / OS X) and INSTALL
  12. 2. read this document carefully
  13. 3. start the installation only AFTER having read all these documents at least
  14. once
  15. 4. follow each of the steps given here
  16. 5. report any problems you encounter to me. I do not have a Macintosh to test
  17. GCC4TI on (the only platforms I can test on are Windows/x86 and Linux/x86), so
  18. I have to rely on user reports for other platforms.
  19. Credits
  20. -------
  21. Before I start, I have to mention the following people who helped me provide
  22. those instructions (as I said, I cannot test on OS X myself):
  23. - James Longstreet (generationxyu): He was the first to get TIGCC to compile on
  24. OS X (with my help), and most of the
  25. instructions below result from that
  26. compilation session.
  27. - The GCC developers: Most of the tips about how to get GCC to compile with
  28. Apple's patched GCC shipped with OS X are in their
  29. platform-specific build notes. (Some of the needed flags
  30. are hidden in a comment in their target-specific settings
  31. for STAGE1_CFLAGS though - unfortunately, there is no
  32. "stage 1" when building a cross-compiler like TIGCC, so
  33. the flags have to be specified manually.)
  34. - Christian Walther: He reminded me that I should mention gcc-core should be
  35. used (not the full gcc compiler collection), and reported
  36. trouble with using '-s' in $CFLAGS.
  37. He also provided up-to-date information for OS X 10.2 and
  38. 10.3.
  39. - James Longstreet, Christian Walther and Alfredo Aldundo for providing small
  40. source code patches to fix compiling problems on Darwin / OS X.
  41. - Schlum for testing TIGCC 0.95 Beta 1 r1 on OS X.
  42. Instructions
  43. ------------
  44. These are the instructions provided by the people listed above. Please report
  45. any errors in those instructions to me. Note that those are for OS X, running
  46. Apple's patched GCC. If you are running unpatched FSF GCC and/or other GNU
  47. utilities on Darwin, some steps might turn out not to be necessary.
  48. WARNING: XCode 2.2 and 2.2.1 are NOT supported, the GCC versions which come
  49. with them (Apple GCC 4.0.1 builds 5247 and 5250) WILL NOT COMPILE
  50. ld-tigcc. If you're using one of those versions, please upgrade to
  51. XCode 2.3 (Apple GCC 4.0.1 build 5341).
  52. 1. Use the full GCC-core (gcc-core ONLY, NOT full gcc with all the programming
  53. language frontends - TIGCC only supports C at the moment) and Binutils
  54. sources from a GNU mirror. Our local copy at tigcc.ticalc.org only supports
  55. the platforms for which we are distributing binaries (for space reasons, and
  56. because that's enough to comply with the GPL). I might add the necessary host
  57. headers for OS X to our local copy at a later time though.
  58. 2. Use the tar utility to unpack the GCC and Binutils tarballs (follow the build
  59. instructions in README.linux). Stuffit Expander apparently does some strange
  60. things when untarring (such as not extracting GCC to a gcc-3.2 subdirectory
  61. as it should).
  62. 3. For the shell, any shell should work. I got success reports for the old
  63. default tcsh (Christian Walther), sh (James Longstreet) and the current
  64. default bash (Schlum, Christian Walther). However, sh/bash is a more standard
  65. shell and less likely to cause problems than tcsh. (Note that Apple changed
  66. their default shell from tcsh to bash in OS X 10.3, probably for that very
  67. reason.)
  68. 4. Under older OS X versions (10.2 and older), you need to increase the stack
  69. limit. Under csh/tcsh, you can do it with the following command:
  70. limit stack 800
  71. Under sh/bash, you can do it with the following command:
  72. ulimit -s 800
  73. The default stack limit on those versions of OS X was too low to compile GCC.
  74. This is reportedly fixed since OS X 10.3 at least (the default stack limit is
  75. now set to 8192, which is even more than enough), so you can skip this step
  76. if you are running OS X 10.3 or higher.
  77. You now have 2 options. Either use the source installation wizard (Install),
  78. which does the rest for you, or follow the remaining instructions below:
  79. 5. When using Apple's GCC, set CC to 'cc -no-cpp-precomp'. The Apple
  80. preprocessor has bugs which keep huge projects like GCC and Binutils from
  81. getting compiled correctly.
  82. 6. Add the -DHAVE_DESIGNATED_INITIALIZERS=0 flag to $CC or $CFLAGS (needed when
  83. building GCC with Apple's GCC, and it won't hurt when building the rest of
  84. TIGCC, since only GCC tests for that #define).
  85. 7. Don't forget to set $TIGCC, $PATH and $CFLAGS as explained in INSTALL. Also
  86. note that the '-s' flag was not supported in older versions of the OS X
  87. toolchain (OS X 10.1 or older). If you have that problem, use only CFLAGS=-Os
  88. and run the 'strip' utility on the executables in $TIGCC/bin afterwards, the
  89. result is the same. But this has reportedly been fixed in OS X 10.2.
  90. 8. Only when done with all this, run the install script (Install_All).
  91. Kevin Kofler, maintainer of TIGCC for Linux, Unix and OS X