Commit 3d05b15f by Neil Booth Committed by Neil Booth

config.gcc: Add an i386/sysv4-cpp.h.


	* config.gcc: Add an i386/sysv4-cpp.h.  Remove i386-aout.h from
	vxworks.
config/i386:
	* i386-aout.h, i386elf.h, sysv4.h: Remove CPP_PREDEFINES.
	* linux64.h: Use TARGET_OS_CPP_BUILTINS rather than
	CPP_PREDEFINES and part of CPP_SPEC.
	i386elf.h, mach.h, netware.h, rtemself.h, sco5.h, sol2.h,
	vsta.h, vxi386.h, win32.h: Similarly.
	* sysv4-cpp.h: New.

From-SVN: r54679
parent daefe58e
2002-06-16 Neil Booth <neil@daikokuya.demon.co.uk>
* config.gcc: Add an i386/sysv4-cpp.h. Remove i386-aout.h from
vxworks.
config/i386:
* i386-aout.h, i386elf.h, sysv4.h: Remove CPP_PREDEFINES.
* linux64.h: Use TARGET_OS_CPP_BUILTINS rather than
CPP_PREDEFINES and part of CPP_SPEC.
i386elf.h, mach.h, netware.h, rtemself.h, sco5.h, sol2.h,
vsta.h, vxi386.h, win32.h: Similarly.
* sysv4-cpp.h: New.
2002-06-16 Richard Henderson <rth@redhat.com>
PR c/7030
......
......@@ -1006,7 +1006,7 @@ i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
then
tm_file=i386/sysv4gdb.h
else
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h"
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h"
fi
extra_parts="crtbegin.o crtend.o"
tmake_file=i386/t-crtpic
......@@ -1031,7 +1031,7 @@ i[34567]86-sequent-sysv*) # would otherwise be caught by i?86-*-sysv*
exit 1
;;
i[34567]86-wrs-vxworks*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/i386-aout.h i386/vxi386.h"
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/vxi386.h"
thread_file='vxworks'
;;
i[34567]86-*-aout*)
......@@ -1230,7 +1230,7 @@ i[34567]86-*-sysv5*) # Intel x86 on System V Release 5
;;
i[34567]86-*-sysv4*) # Intel 80386's running system V.4
xm_defines="POSIX SMALL_ARG_MAX"
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h"
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
......
......@@ -23,9 +23,4 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (80386, BSD a.out syntax)");
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES ""
/* end of i386-aout.h */
......@@ -40,10 +40,6 @@ Boston, MA 02111-1307, USA. */
(TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
/* This used to define X86, but james@bigtex.cactus.org says that
is supposed to be defined optionally by user programs--not by default. */
#define CPP_PREDEFINES ""
#undef CPP_SPEC
#define CPP_SPEC ""
......
......@@ -23,11 +23,24 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)");
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -Asystem(posix)"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
builtin_define ("__gnu_linux__"); \
builtin_define ("__ELF__"); \
builtin_assert ("system=posix"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
} \
while (0)
#undef CPP_SPEC
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
/* Provide a LINK_SPEC. Here we provide support for the special GCC
options -static and -shared, which allow us to link things in one
......
......@@ -2,8 +2,15 @@
#define TARGET_VERSION fprintf (stderr, " (80386, Mach)");
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dunix -DMACH -Asystem=unix -Asystem=mach"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("unix"); \
builtin_define_std ("MACH"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=mach"); \
} \
while (0)
/* Specify extra dir to search for include files. */
#define SYSTEM_INCLUDE_DIR "/usr/mach/include"
......
......@@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (i386 Netware 4)");
/* These surely require augmentation */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-DAPX386 -D__i386__ -D__netware__ -Asystem=netware -Acpu=i386 -Amachine=i386"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("APX386"); \
builtin_define ("__netware__"); \
builtin_assert ("system=netware"); \
} \
while (0)
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
......
......@@ -21,11 +21,14 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#include <i386/i386elf.h>
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems \
-D__ELF__ -D__i386__ -D__USE_INIT_FINI__"
#undef CPP_SPEC
#define CPP_SPEC "%{msoft-float:-D_SOFT_FLOAT}"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__rtems__"); \
builtin_define ("__ELF__"); \
builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
if (!TARGET_80387) \
builtin_define ("_SOFT_FLOAT"); \
} \
while (0)
......@@ -634,20 +634,32 @@ init_section () \
%{mcoff:crtendS.o%s} \
%{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Asystem=svr3"
/* You are in a maze of GCC specs ... all alike */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__unix"); \
builtin_define ("_SCO_DS"); \
builtin_define ("_M_I386"); \
builtin_define ("_M_XENIX"); \
builtin_define ("_M_UNIX"); \
builtin_assert ("system=svr3"); \
if (flag_iso) \
cpp_define (pfile, "_STRICT_ANSI"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
} \
while (0)
#undef CPP_SPEC
#define CPP_SPEC "\
%{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \
%{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \
-D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \
%{!Xods30:-D_STRICT_NAMES} \
%{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
%{ansi:-isystem include/ansi%s -isystem /usr/include/ansi -D_STRICT_ANSI} \
%{ansi:-isystem include/ansi%s -isystem /usr/include/ansi} \
%{!ansi: \
%{posix:-isystem include/posix%s -isystem /usr/include/posix \
-D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \
......@@ -664,8 +676,6 @@ init_section () \
%{scointl:-DM_INTERNAT -D_M_INTERNAT} \
%{!mcoff:-D_SCO_ELF} \
%{mcoff:-D_M_COFF -D_SCO_COFF} \
%{!mcoff:%{fpic:-D__PIC__ -D__pic__} \
%{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \
%{Xa:-D_SCO_C_DIALECT=1} \
%{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
%{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \
......
......@@ -77,9 +77,26 @@ Boston, MA 02111-1307, USA. */
#define HANDLE_PRAGMA_REDEFINE_EXTNAME 1
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dunix -D__svr4__ -D__SVR4 -Dsun -D__PRAGMA_REDEFINE_EXTNAME -Asystem=svr4"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("unix"); \
builtin_define_std ("sun"); \
builtin_define ("__svr4__"); \
builtin_define ("__SVR4"); \
builtin_define ("__PRAGMA_REDEFINE_EXTNAME"); \
builtin_assert ("system=svr4"); \
/* For C++ we must add some additional macros \
required by the C++ standard library. */ \
if (c_language == clk_cplusplus) \
{ \
builtin_define ("_XOPEN_SOURCE=500"); \
builtin_define ("_LARGEFILE_SOURCE=1"); \
builtin_define ("_LARGEFILE64_SOURCE=1"); \
builtin_define ("-D__EXTENSIONS__"); \
} \
} \
while (0)
/* Solaris 2/Intel as chokes on #line directives. */
#undef CPP_SPEC
......@@ -89,14 +106,6 @@ Boston, MA 02111-1307, USA. */
%{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
/* For C++ we need to add some additional macro definitions required
by the C++ standard library. */
#define CPLUSPLUS_CPP_SPEC "\
-D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
-D__EXTENSIONS__ \
%(cpp) \
"
#undef LIB_SPEC
#define LIB_SPEC \
"%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
......
/* Target definitions for GNU compiler for Intel 80386 running System V.4
Copyright (C) 1991, 2001, 2002 Free Software Foundation, Inc.
Written by Ron Guilmette (rfg@netcom.com).
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("unix"); \
builtin_define ("__svr4__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=svr4"); \
} \
while (0)
......@@ -31,12 +31,6 @@ Boston, MA 02111-1307, USA. */
(TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
/* Define which macros to predefine. __svr4__ is our extension. */
/* This used to define X86, but james@bigtex.cactus.org says that
is supposed to be defined optionally by user programs--not by default. */
#define CPP_PREDEFINES \
"-Dunix -D__svr4__ -Asystem=unix -Asystem=svr4"
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
......@@ -140,6 +134,3 @@ Boston, MA 02111-1307, USA. */
"addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
: "=d"(BASE))
#endif
#undef CPP_SPEC
#define CPP_SPEC ""
......@@ -21,7 +21,12 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (80386, BSD syntax)");
#ifdef CPP_PREDEFINES
#undef CPP_PREDEFINES
#endif
#define CPP_PREDEFINES "-Dunix -DVSTA -Asystem=unix -Asystem=vsta"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("unix"); \
builtin_define ("VSTA"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=vsta"); \
} \
while (0)
......@@ -21,28 +21,31 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (80386, VxWorks BSD syntax)");
#undef CPP_CPU_SPEC
#define CPP_CPU_SPEC "\
-Asystem=unix -Acpu=i386 -Amachine=i386 \
%{!ansi:-Di386} -D__i386 -D__i386__ \
%{march=i386:-DCPU=I80386} \
%{march=i486:-DCPU=I80486 %(cpp_486)} \
%{march=pentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \
%{march=pentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \
%{!march=*: \
%{mcpu=i386:-DCPU=I80386} \
%{mcpu=i486:-DCPU=I80486 %(cpp_486)} %{m486:-DCPU=I80486 %(cpp_486)} \
%{mpentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \
%{mcpu=pentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \
%{mpentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \
%{mcpu=pentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \
%{!mcpu*:%{!m486:%{!mpentium*:-DCPU=I80386}}}}"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__vxworks"); \
builtin_assert ("system=unix"); \
\
if (TARGET_386) \
builtin_define ("CPU=I80386"); \
else if (TARGET_486) \
builtin_define ("CPU=I80486"); \
else if (TARGET_PENTIUM) \
{ \
builtin_define ("CPU=PENTIUM"); \
builtin_define ("CPU_VARIANT=PENTIUM"); \
} \
else if (TARGET_PENTIUMPRO) \
{ \
builtin_define ("CPU=PENTIUM"); \
builtin_define ("CPU_VARIANT=PENTIUMPRO"); \
} \
} \
while (0)
#define HANDLE_SYSV_PRAGMA
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__vxworks"
/* VxWorks does all the library stuff itself. */
#undef LIB_SPEC
......
......@@ -62,11 +62,24 @@ Boston, MA 02111-1307, USA. */
{ "no-nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, "" },
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D_WIN32 -DWINNT -D_X86_=1 \
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
-Asystem=winnt"
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("_WIN32"); \
builtin_define_std ("WINNT"); \
builtin_define ("_X86_"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=winnt"); \
if (TARGET_CYGWIN) \
{ \
builtin_define ("__CYGWIN32__"); \
builtin_define ("__CYGWIN__"); \
} \
else \
builtin_define ("__MINGW32__"); \
} \
while (0)
#undef STARTFILE_SPEC
......@@ -75,8 +88,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
%{!mcygwin:-iwithprefixbefore include/mingw32 -D__MINGW32__} \
%{mcygwin:-D__CYGWIN32__ -D__CYGWIN__}"
%{!mcygwin:-iwithprefixbefore include/mingw32}"
/* We have to dynamic link to get to the system DLLs. All of libc, libm and
the Unix stuff is in cygwin.dll. The import library is called
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment