Adriaan van Os wrote:
You were quite right about -fPIC. All the failures, except emil9.pas disappear with -fno-pic. However, many of the other tests fail with -fno-pic, because the option disables dynamic linking on Mac OS X. The PPC back-end has a workaround (-mdynamic-no-pic) but that doesn't seem to work for i686-apple-darwin.
I have just realized that Darwin PIC problem have nothing to do with Linux PIC problems: Darwin does not use the binutils feature (ELF GOT relocations) that Linux uses.
Updating the linker and assembler to odcctools-20050327 had no effect on testsuite results.
So, I must either
- find a backport of i686-apple-darwin PIC fixes
- find a solution for gcc-3.4 bootstrap problems
- wait for gcc-4.0 support.
Still, I am glad with the results so far.
Well, I was able build 3.3.6 based cross-compiler for i686-apple-darwin target, and I can see duplicate labels in the assembler output. It seems that 3.4.3 has changed the parts responsible for generating those labels. I have found that 3.4.[34] contain blatant bug with easy fix:
--- gcc-3.4.4/gcc/config/i386/darwin.h.orig Thu Jun 16 01:10:29 2005 +++ gcc-3.4.4/gcc/config/i386/darwin.h Thu Jun 16 01:10:32 2005 @@ -43,7 +43,7 @@
/* Use the following macro for any Darwin/x86-specific command-line option translation. */ -#define SUBTARGET_OPTION_TRANSLATE_TABLE +#define SUBTARGET_OPTION_TRANSLATE_TABLE { 0, 0 }
#define ASM_SPEC "-arch i386 \ %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
After that I can build the compiler proper. However I get ICE when building gcc runtime. Trying gpc on knuth3.pas (to get assembler output) give me ICE. Both ICE-s seem related to generting labels needed in PIC code...
So, it seems that nobody tried gcc-3.4.x for i686-darwin for almost a year (ChangeLog entry for SUBTARGET_OPTION_TRANSLATE_TABLE change is from 2004-08-23)