Has anybody successfully installed GPC on Mac OS 10.4 (Tiger)?
Thanks.
Aleck Brinkman Temple University
Aleck Brinkman wrote:
Has anybody successfully installed GPC on Mac OS 10.4 (Tiger)?
Ah, I haven't had time to try it out yet, neither did I receive reports that it didn't work. I believe, some on the list are running gpc on Mac OS X 10.4. Peter ? Gale ?
Regards,
Adriaan van Os
P.S. When building from source on OS X 10.4, the following patch may be needed (see <http://cvs.opendarwin.org/index.cgi/dports/lang/gcc34/files/patch- darwin.h?rev=1.3&content-type=text/x-cvsweb-markup>). Thanks to Peter N. Lewis for sending me the diff. The patch is needed because Apple has changed the rules once again.
--- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 13:56:37.000000000 -0400 +++ ../gcc-3.4.3/gcc/config/darwin.h 2005-05-18 13:57:48.000000000 -0400 @@ -275,7 +275,8 @@ /* Machine dependent libraries. */
#undef LIB_SPEC -#define LIB_SPEC "%{!static:-lSystem}" +#define LIB_SPEC "%{!static:-lSystemStubs -lSystem}" +
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
Adriaan van Os wrote:
When building from source on OS X 10.4, the following patch may be needed (see <http://cvs.opendarwin.org/index.cgi/dports/lang/gcc34/files/patch- darwin.h?rev=1.3&content-type=text/x-cvsweb-markup>). Thanks to Peter N. Lewis for sending me the diff. The patch is needed because Apple has changed the rules once again.
So I take it we should not include it with GPC, as it might break things with other verions, right?
Frank
Adriaan van Os wrote:
Aleck Brinkman wrote:
Has anybody successfully installed GPC on Mac OS 10.4 (Tiger)?
Ah, I haven't had time to try it out yet, neither did I receive reports that it didn't work. I believe, some on the list are running gpc on Mac OS X 10.4. Peter ? Gale ?
I haven't tried it. For GPC usage, I boot up with Mac OS X 10.3 since I know there isn't any Apple 10.4 change issues to worrry about in that run configuration.
Given that with Mac OS X 10.4 Apple's gcc is based on gcc 4.x and Apple had documented some backward compatibility issues with prior gcc versions (I think it is primarily with C++ support), it didn't seem like a GPC install was going to be a simple, trouble free install. So, I deferred GPC install attempts until I had a sufficiently sized block of time to deal with posssible installation issues.
Gale Paeper gpaeper@empirenet.com
At 17:40 -0700 30/6/05, Gale Paeper wrote:
Given that with Mac OS X 10.4 Apple's gcc is based on gcc 4.x and Apple had documented some backward compatibility issues with prior gcc versions (I think it is primarily with C++ support), it didn't seem like a GPC install was going to be a simple, trouble free install. So, I deferred GPC install attempts until I had a sufficiently sized block of time to deal with posssible installation issues.
I have GPC running on 10.4, compiled from source. I'll include the docs of what I did below (lots of info is much the same as Adriaan's docs previously).
There are a couple gotchas:
You need to patch gcc 3.4.3's darwin.h to include -lSystemStubs. I gues probably somehow configure or whatever should figure out if there is a SystemStubs library and include it, or it should be conditionally included for 10.4+ (darwin8+?). This isn't a GPC issue, so I wouldn't include the patch with GPC. Adriaan will no doubt include a reference to the patch on his pages.
When doing "make bootstrap" on gpc/gcc, there is a problem where the default flags include -no-cpp-precomp for STAGE1, which is fine until it tries to use the built compiler (xgpc) with this flag to compile the RTS. Then it fails with an error because the flag is supported only on the Apple installed gcc, not the newly build gpc/gcc. This seems to be a failure in the build system, since the new compiler should not be called with flags not suitable for it. But the easiest way I found to avoid it is to specify the STAGE1_CFLAGS explicitly to exclude the -no-cpp-precomp - I could not find any way to set STAGE1_CFLAGS to "STAGE1_CFLAGS without -no-cpp-precomp" - perhaps someone smarter than me knows how to do that.
The documentation below is a draft spec of what I did to get gpc compiling under 10.4
Enjoy, Peter.
Compiling GPC from scratch
0 - Create a build directory 1 - Install bison version 2.0 2 - Install flex version 2.5.27 3 - Install sed version 4.1.4 4 - Install help2man version 1.35.1 5 - Download gcc version 3.4.3 6 - Download gpc-20050331 7 - Configure gcc/gpc 8 - Patch gcc for Mac OS X 9 - Build gcc 10 - Install gp 11 - Setup some links
STEP 0 - Create a build directory
cd mkdir gpc-build cd gpc-build
STEP 1 - Install bison version 2.0
curl -s -S -O http://ftp.gnu.org/gnu/bison/bison-2.0.tar.gz tar zxf bison-2.0.tar.gz cd bison-2.0 ./configure make sudo make install cd ..
STEP 2 - Install flex version 2.5.31
curl -s -S -O http://easynews.dl.sourceforge.net/sourceforge/lex/flex-2.5.27.tar.gz tar zxf flex-2.5.27.tar.gz cd flex-2.5.27 ./configure make sudo make install cd ..
STEP 3 - Install sed version 4.1.4
curl -s -S -O http://ftp.gnu.org/gnu/sed/sed-4.1.4.tar.gz tar zxf sed-4.1.4.tar.gz cd sed-4.1.4 ./configure make sudo make install cd ..
STEP 4 - Install help2man version 1.35.1
curl -s -S -O ftp://ftp.gnu.org/gnu/help2man/help2man-1.35.1.tar.gz tar zxf help2man-1.35.1.tar.gz cd help2man-1.35.1 ./configure --enable-nls=no make sudo make install cd ..
STEP 5 - Download gcc version 3.4.3
curl -s -S -O ftp://ftp.gnu.org/gnu/gcc/gcc-3.4.3/gcc-core-3.4.3.tar.bz2 bunzip2 gcc-core-3.4.3.tar.bz2 tar xf gcc-core-3.4.3.tar
STEP 6 - Download gpc-20050331
curl -s -S -O http://www.g-n-u.de/gpc/gpc-20050331.tar.bz2 bunzip2 gpc-20050331.tar.bz2 tar xf gpc-20050331.tar mv p gcc-3.4.3/gcc
STEP 7 - Configure gcc/gpc
mkdir build cd build ../gcc-3.4.3/configure --enable-languages=pascal,c --enable-threads=posix --prefix=/Developer/Pascal/gpc-20050331
STEP 8 - Patch gcc for Mac OS X
gcc 3.4.3 has a problem with Mac OS X 10.4, so apply the patch from http://cvs.opendarwin.org/index.cgi/dports/lang/gcc34/files/patch-darwin.h?rev=1.3&content-type=text/x-cvsweb-markup, execute the patch command, paste in the following lines, then press control D (^D)
patch -p0 --ignore-whitespace --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 13:56:37.000000000 -0400 +++ ../gcc-3.4.3/gcc/config/darwin.h 2005-05-18 13:57:48.000000000 -0400 @@ -275,7 +275,8 @@ /* Machine dependent libraries. */
#undef LIB_SPEC -#define LIB_SPEC "%{!static:-lSystem}" +#define LIB_SPEC "%{!static:-lSystemStubs -lSystem}" +
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ ^D
STEP 9 - Build gcc
make EXTRA_PFLAGS=--longjmp-all-nonlocal-labels STAGE1_CFLAGS='-g -DHAVE_DESIGNATED_INITIALIZERS=0' bootstrap sudo make install cd ..
STEP 10 - Install gp
gp does not handle capital letters in unit names, even on case insensitive file systems. The patch resolves that issue. Remember that ^D means press control-D.
curl -s -S -O http://fjf.gnu.de/misc/gp.tar.bz2 bunzip2 gp.tar.tar.bz2 cd gp-0.60 ./configure --prefix=/Developer/Pascal/gpc-20050331 patch -p1 --ignore-whitespace --- gp-0.60/gp.pas 2005-06-06 04:31:51.000000000 +0800 +++ gp-0.60-mine/gp.pas 2005-06-25 11:21:53.000000000 +0800 @@ -708,7 +710,7 @@ if FileName <> '' then UnitNameMatch := (Dep.SrcBaseNameExt = FileName) or (Dep.SrcBaseName = FileName) else - UnitNameMatch := Dep.SrcBaseName = InterfaceName + UnitNameMatch := LoCaseStr( Dep.SrcBaseName ) = LoCaseStr( InterfaceName ); end;
function NewUsesElement (const InterfaceName, FileName: String; Next: PUnitList) = p: PUnitList; ^D make sudo make install cd ..
STEP 11 - Setup some links
sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/gpc /usr/bin/gpc sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/gcc /usr/bin/gpcgcc sudo ln -s -f -h /Developer/Pascal/gpc-20050331/lib/gcc/powerpc-apple-darwin7/3.4.3/ /Developer/Pascal/gpclibs sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/gpidump /usr/bin/gpidump sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/binobj /usr/bin/gpcbinobj sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/gpc-run /usr/bin/gpc-run sudo ln -s -f /Developer/Pascal/gpc-20050331/bin/gp /usr/bin/gp
Peter N Lewis wrote:
At 17:40 -0700 30/6/05, Gale Paeper wrote:
Given that with Mac OS X 10.4 Apple's gcc is based on gcc 4.x and Apple had documented some backward compatibility issues with prior gcc versions (I think it is primarily with C++ support), it didn't seem like a GPC install was going to be a simple, trouble free install. So, I deferred GPC install attempts until I had a sufficiently sized block of time to deal with posssible installation issues.
I have GPC running on 10.4, compiled from source.
I will work towards a new binary release on my website
- based on gpc-20050331 and gcc-3.4.4 or gcc-3.4.3 - with Waldek's patches for Mac/Delphi objects - compatible with Mac OS X 10.4.
Peter, Gale and I are also working (together with the FPC team) on a new release of the Pascal Interfaces for Mac OS X. There will be different but compatible sets of Interfaces for:
- MetroWerks CodeWarrior Pascal - GPC - FPC (FreePascal)
Regards,
Adriaan van Os
Just two side notes.
Peter N Lewis wrote:
7 - Configure gcc/gpc 8 - Patch gcc for Mac OS X
Usually it's better to first patch the sources before starting to configure/build. (In this case it probably won't matter.)
execute the patch command, paste in the following lines, then press control D (^D)
patch -p0 --ignore-whitespace --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] ^D
BTW, with most shells you can do this, so everything, including the "EOF" can be pasted (or run from a script):
patch -p0 --ignore-whitespace << EOF --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] EOF
Frank
patch -p0 --ignore-whitespace --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] ^D
BTW, with most shells you can do this, so everything, including the "EOF" can be pasted (or run from a script):
patch -p0 --ignore-whitespace << EOF --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] EOF
Sadly this does not seem to work with tcsh, which was the default shell until recently (now they default to zsh).
I don't suppose there is anything that works for both? Peter.
Peter N Lewis wrote:
patch -p0 --ignore-whitespace --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] ^D
BTW, with most shells you can do this, so everything, including the "EOF" can be pasted (or run from a script):
patch -p0 --ignore-whitespace << EOF --- ../gcc-3.4.3/gcc/config/darwin.h.sav 2005-05-18 [...] EOF
Sadly this does not seem to work with tcsh, which was the default shell until recently (now they default to zsh).
Which version? Seems to work with mine (tcsh-6.09).
Frank
Sadly this does not seem to work with tcsh, which was the default shell until recently (now they default to zsh).
Which version? Seems to work with mine (tcsh-6.09).
Ahh, ok, you are quite right, tcsh does support it, the problem is it seems to parse the input, and so when it sees this line in the patch:
error ("right operand of `%s' must be an object type", opname);
it complains about the unmatched quote (`) with:
tcsh: Unmatched `.
and aborts the input.
It appears you can avoid this by using:
patch -p0 --ignore-whitespace << "EOF" ... "EOF"
Thanks for the tip! Peter.