[patch] Separate {OS,CPU}_CPP_BUILTINS macros into C-family and language-independent macros

FX fxcoudert@gmail.com
Thu Oct 7 10:49:00 GMT 2010


The attached patch fixes PR 42954: when Fortran moved to using libcpp directly from the front-end (instead of calling cc1 to do its preprocessing), we lost all target-specific CPP built-in macros. The issue is that part of the code in TARGET_OS_CPP_BUILTINS and TARGET_CPU_CPP_BUILTINS depends on C-only flags, and thus cannot be moved to a directory outside gcc/c-family/.

The patch moves this C-only code to specific TARGET_OS_CPP_BUILTINS_CFAMILY and TARGET_CPU_CPP_BUILTINS_CFAMILY macros. I manually audited all the targets in config/ twice, to check that I did not leave any code behind. I have bootstrapped and regtested an all-language compiler on x86_64-linux and i686-darwin. I have also built C and Fortran cross-compilers (make all-gcc && make fortran) for the following targets (which cover all gcc/config/ files changed):

avr-elf
frv-elf
spu-elf
i386-pc-netware
alpha-linux
ia64-hpux
mips-linux
mips-sgi-irix6.5
hppa2.0w-hp-hpux11.00
sparc-sun-solaris2.10
i686-pc-mingw32
powerpc-darwin

In all cases, the cross-compiler built successfully and seemed to work. In each case, I checked a few of the target-specific macros (but did not check all of them).


I also tried to build cross-compilers for the following i386-pc-interix3 and alpha-dec-osf5.1, but they failed to build even without my patch:

  -- i386-pc-interix3 fails to build winnt.c over use of undeclared use_pe_aligned_common()
  -- alpha-dec-osf5.1 fails to build mips-tfile.o

Rainer (as osf maintainer) is CC'ed to this mail. Interix hasn't seen a specific patch for it (not part of mechanical changes) since 2003, and I don't know whom to forward this information to.


OK to commit?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp.ChangeLog
Type: application/octet-stream
Size: 3891 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101007/2174f50a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp.diff
Type: application/octet-stream
Size: 77371 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101007/2174f50a/attachment-0001.obj>


More information about the Gcc-patches mailing list