On Mar 15, 2008, at 12:01 AM, Peter Schorn wrote:
Gale Paeper wrote:
On Mar 14, 2008, at 12:23 PM, Peter Schorn wrote:
I'm trying to build the latest gpc (gpc-20070904.tar.bz2) with Adriaan's patches on a Macintosh OS X 10.5.2. with Intel.
I configure with ../gcc-4.1.2/configure --enable-languages=pascal,c --enable- threads=posix --prefix=/Developer/Pascal/gpc412
but the "make bootstrap" fails with
Undefined symbols: "___sysctl", referenced from: ___enable_execute_stack in _enable_execute_stack_s.o ld: symbol(s) not found /usr/bin/libtool: internal link edit command failed make[3]: *** [libgcc_s.dylib] Error 1 make[2]: *** [libgcc.a] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2
What am I missing?
I think you're missing the trampoline patch. I'm not sure what avenue I got it from Adriaan, but below is the trampoline patch that Adriaan and I ended up using in our attempts to get a gcc-4.1.2 based gpc-20070904 Mac OS X compiler built. Note: Last time I checked there's no fix for the back-end bug affecting the usability for production work for the Mac OS X gcc-4.1.2 based gpc-20070904 GPC build.
Actually I had installed the patch Gale mentioned and actually there is a problem. For some reason under 10.5.2 the symbol __sysctl is not found but sysctl works. I therefore replaced __sysctl by sysctl in the patch and the build now proceeds to a new kind of problem:
That one I think is new with 10.5.2. Since Adriaan's supplied trampoline patch doesn't use __sysctl, I'm curious as to where the symbol __sysctl occurrence is located.
...
../.././xgpc -B../.././ -L../.. -I../rts --automake --executable- file-name -W -Wall -Wmissing-prototypes -Wmissing-declarations -g - DENABLE_CHECKING -DENABLE_ASSERT_CHECKING --executable-path=. -- unit-path=/Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/rts -- unit-path=/Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/units "/ Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/utils/binobj.pas" can't find atom for N_GSYM stabs Gpc_input:G(0,2) in ../../libgpc.a (files.o) can't find atom for N_GSYM stabs Gpc_output:G(0,2) in ../../libgpc.a (files.o)
I encountered that one while trying to build the PPC 64 bit version of the static libgpc. Stabs format debugging symbols don't work/ aren't supportrf for the PPC64 [or 64 bit Mach-O ?] target. The fix is to turn off debugging symbol generation while building PPC64 PPC64 [or 64 bit Mach-O ?] targets.
The modification I made to Adriaan's build-on command file script was:
# build and install a 64-bit static libgpc
pushd gcc/p/rts make clean # make CFLAGS="-O2 -m64" make CFLAGS="-g0 -O2 -m64" sudo cp libgpc.a /Developer/Pascal/gpc412u1/lib/gcc/powerpc-apple- darwin8/4.1.2/ppc64/ popd
I also encountered problems trying to build the PPC64 dynanic libgpc in the linking stag. Since, your probably going to encounter that problem also, the modification I made to Adriaan's build-on command file script was:
# build and install a 64-bit dynamic libgpc
pushd gcc/p/rts make clean GPCSOLIBNAME=libgpc-gpc412u1.dylib # override GPCSOLIBOPTIONS to add -m64 to get ppc64 archecture linking make GPCSOLIBNAME=libgpc-gpc412u1.dylib GPCSOLIBOPTIONS="-m64 - dynamiclib -dylib_install_name,libgpc-gpc412u1.dylib" WITH_SHARED=yes TARGET_MACHO=1 CFLAGS="-O2 -g0 -m64" sudo lipo /usr/lib/libgpc-gpc412u1.dylib libgpc-gpc412u1.dylib - create -output /usr/lib/libgpc-gpc412u1.dylib popd cd ..
Note: The above two modified build command are from the build-on- powerpc-10-4.command file. Since your building on Intel, you'll need to make adjustments for cross-compiler compilimg.
... more "can't find atom ..." ...
../.././xgpc -B../.././ -L../.. -I../rts --automake --executable- file-name -W -Wall -Wmissing-prototypes -Wmissing-declarations -g - DENABLE_CHECKING -DENABLE_ASSERT_CHECKING --executable-path=. -- unit-path=/Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/rts -- unit-path=/Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/units - I. -I "/Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p" "/Users/ peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/utils/gpidump.pas" /Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/utils/gpidump.pas: In procedure `Flags': /Users/peterschorn/projects/gpc4/gcc-4.1.2/gcc/p/utils/gpidump.pas: 439: error: undeclared identifier `FUNCTION_TYPE' (first use in this routine)
The FUNCTION_TYPE declaration comes from the tree.inc file. That file gets autogenerated by the mk-t-inc shell script during the GPC building process. Check the build directory and see if a tree.inc is generated. The path to the file should be /build/gcc/p/utils/tree.inc.
Gale Paeper gpaeper@empirenet.com