Preparing GCC Build: Difference between revisions

Clean up macOS instructions a bit but honestly this is a mess
[unchecked revision][unchecked revision]
m (Update Gentoo notes)
(Clean up macOS instructions a bit but honestly this is a mess)
Line 157:
Portage uses overlays to store packages that are not part of the original package management. Crossdev needs one overlay where it can store its binutils and gcc packages before building them. You can configure one properly, or you can use PORTDIR_OVERLAY to point at where it should keep its package manager files. Using PORTDIR_OVERLAY is not a good idea with existing overlays, but by then you should know how you have personally set them up earlier anyway and how to do it properly.
 
=== OS XmacOS Users ===
Additionally, OS XmacOS users need a replacement libiconv because the system libiconv is seriously out of date. OS XmacOS users can download the latest libiconv release by visiting the [https://gnu.org/software/libiconv/ libiconv website] or directly accessing the [https://ftp.gnu.org/gnu/libiconv/ GNU main FTP mirror]. Otherwise you may get unresolved symbol errors related to libiconv when compiling GCC 4.3 or higher on OS X 10.4 and 10.5.
 
When compiling GCC 4.3 or higher on OS X 10.4 and 10.5, you may get unresolved symbol errors related to libiconv. This is because the version shipped with OS X is seriously out of date. Install a new version (compile it yourself or use MacPorts) and add <tt>--with-libiconv-prefix=/opt/local</tt> (or <tt>/usr/local</tt> if you compiled it yourself) to GCC's <tt>./configure</tt> line. Alternatively you may place the libiconv source as gcc-x.y.z/libiconv and it will be compiled as part of the GCC compilation process. (This trick also works for MPFR, GMP, and MpcMPC).
 
The makefiles of Binutils and GCC use the <source lang="make" enclose="none">$(CC)</source> variable to invoke the compiler. On OS X, this resolves to <source lang="text" enclose="none">GCCgcc</source> by default, which is actually not the "real thing", but <source lang="bash" enclose="none">Clangclang</source>. NotePrior that since at leastto OS X 10.8, the Clang that came with Xcode's Command Line Tools package comeswas withnot Clang,able andto thisbuild versiona ofworking ClangGCC. doesUsers indeedrunning workOS toX compile10.7 aor workingbelow versionmay ofneed to find and install GCC, unlikeeither from [http://brew.sh Homebrew], or from somewhere on Apple's website. You can try with the old GCC that comes whatpreinstalled theseon instructionssome previouslymacOS reflectedversions.
 
Note that users running OS X 10.7 may need to find and install GCC, either from [http://brew.sh Homebrew], or from somewhere on Apple's website.
Thus, the instructions below are really only relevant for these users, but your mileage may vary.
<source lang="bash">
# This is only necessary for OS X users running 10.7 or below.
Line 174 ⟶ 172:
</source>
 
You mightwill want to unset these exports once you compiled and installed the cross compiler, as it might confuse other builds. '''Do not''' make these permanent!
 
'''Note for Lion users:''' If you're on Lion (or above) chances are that you don't have the "real" GCC since Apple removed it from the Xcode package, but you can still install it. You can do it via Homebrew or by compiling from source, both are perfectly described on [http://apple.stackexchange.com/a/38247 a StackExchange answer].
Line 180 ⟶ 178:
'''Note for Maverick users:''' You can build binutils-2.24 and gcc-4.8.3 (possible other version) with Xcode 5.1.1. Note that building GCC with LLVM is not officially supported and may cause interesting bugs, if you are willing to take this risk and save time building host-gcc just to compile a cross-gcc, follow this.
Install GMP, MPFR, Mpc with [http://http://www.macports.org/ MacPorts].
 
sudo port install gmp mpfr libmpc
 
Line 194 ⟶ 193:
--with-gmp=/usr --with-mpc=/opt/local --with-mpfr=/opt/local
 
*'''Note:''' that thereThere is an issue with port's GMP, we useso the version from OS X from /usr is used instead.
 
=== Windows Users ===
Anonymous user