This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
success gcc-3.1-20020423 on macosx
- From: Konstantin Olchanski <olchansk at sam dot triumf dot ca>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 28 Apr 2002 19:13:14 -0700
- Subject: success gcc-3.1-20020423 on macosx
This is a report of a successful bootstrap of gcc-3.1-20020423.tar.bz2 on
macosx 10.1.4 using the stock Apple gcc (version?).
I was unable to run the testsuite because it requires additional
software (dejagnu(?)) that I do not have (yet).
I wish the gcc test suite had a trivial to use perl-ish "make test" and
I wish all the required pieces were part of the snapshot.
These kludges had to be applied to the gcc tree before I could bootstrap:
1) add real functions for isalnum() and friends (if libstdc++ authors wants
them to be real functions, why do *I* have to provide the silly
wrappers?)
2) defeat silly games with size_t in Apple's /usr/include/string.h
Also:
3) why is gcc building the soft-float libraries (multilib?)?
Does macosx and Darwin run on any FPU-less systems?
My build instructions are below- hopefully somebody more knowledgable
than I can produce and submit them as patches to gcc-3.1.x:
1) untar the gcc tarball, mkdir and cd to the build directory
as per gcc instructions
2) configure gcc:
../gcc-3.1-20020423/configure --prefix=/usr/local/gcc-3.1-20020423
3) run "make bootstrap". This will build the N stages of gcc
and eventually bomb-out in libstdc++ because of missing isalnum() & co
functions.
4) apply the kludges:
a) in powerpc-apple-darwin5.4/libstdc++-v3/include/cctype
add these wrappers right after the "#undef isxxx" block:
int isalnum(const char c) { return __istype((c), (_A|_D)); }
int isalpha(const char c) { return __istype((c), _A); }
int iscntrl(const char c) { return __istype((c), _C); }
int isdigit(const char c) { return __isctype((c), _D); }
int isgraph(const char c) { return __istype((c), _G); }
int islower(const char c) { return __istype((c), _L); }
int isprint(const char c) { return __istype((c), _R); }
int ispunct(const char c) { return __istype((c), _P); }
int isspace(const char c) { return __istype((c), _S); }
int isupper(const char c) { return __istype((c), _U); }
int isxdigit(const char c) { return __isctype((c), _X); }
b) cp /usr/include/string.h powerpc-apple-darwin5.4/libstdc++-v3/include/
cp /usr/include/string.h powerpc-apple-darwin5.4/soft-float/libstdc++-v3/include/
in both copies of string.h, bracket the "typedef size_t" block
in "#if 0/#endif":
#if 0
#ifndef _BSD_SIZE_T_DEFINED_
#define _BSD_SIZE_T_DEFINED_
typedef _BSD_SIZE_T_ size_t;
#endif
#endif
5) run "make bootstrap" again. This will resume building libstdc++
and all the other libaries.
6) run "sudo make install". This will install gcc.
Random technical details:
- "uname -a" output:
Darwin localhost 5.4 Darwin Kernel Version 5.4: Wed Apr 10 09:27:47 PDT 2002; root:xnu/xnu-201.19.3.obj~1/RELEASE_PPC Power Macintosh powerpc
- gcc configuration from config.status:
../gcc-3.1-20020423/configure --with-gcc-version-trigger=/Users/olchansk/src/gcc/gcc-3.1-20020423/gcc/version.c --host=powerpc-apple-darwin5.4 --prefix=/usr/local/gcc-3.1-20020423 --norecursion
- "gcc -v" output:
% /usr/local/gcc-3.1-20020423/bin/gcc -v
Reading specs from /usr/local/gcc-3.1-20020423/lib/gcc-lib/powerpc-apple-darwin5.4/3.1/specs
Configured with: ../gcc-3.1-20020423/configure --prefix=/usr/local/gcc-3.1-20020423
Thread model: single
gcc version 3.1 20020423 (prerelease)
--
Konstantin Olchanski
Email: olchansk@triumf.ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada