X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fconfig%2Flynx.h;h=656dae563468e5b1047f6e83cbe55d97bd5d70a4;hb=eff1687c7f3b0d6e246579efea7f96c3bb283c57;hp=fde0e729be0fa805a6cea05beac01a0e70402c08;hpb=83ebdf385c00353bfabdf983fd9cccc9b9683a69;p=pf3gnuchains%2Fgcc-fork.git
diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h
index fde0e729be0..656dae56346 100644
--- a/gcc/config/lynx.h
+++ b/gcc/config/lynx.h
@@ -1,100 +1,177 @@
-/* Target independent definitions for LynxOS. */
-
-/* ??? The -C option may need to change to whatever option the GNU assembler
- actually accepts. */
-#undef ASM_SPEC
-#define ASM_SPEC "%{mcoff:-C}"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%{mthreads:-D_MULTITHREADED} %{mposix:-D_POSIX_SOURCE} %{msystem-v:-I/usr/include_v}"
-
-/* Provide required defaults for linker switches. */
-/* ??? The -k option may need to change to whatever option the GNU linker
- actually accepts. This is to produce COFF output. */
-/* ??? The -V option may need to change to whatever option the GNU linker
- actually accepts. This is to produce System-V magic numbers. */
-#undef LINK_SPEC
-#define LINK_SPEC "-P1000 %{msystem-v:-V} %{mcoff:-k}"
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{mthreads:-L/lib/thread/} %{msystem-v:-lc_v} %{!msystem-v:%{mposix:-lc_p} -lc}"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{p:%{mcoff:pinit1.o%s} %{!mcoff:pinit.o%s}} %{!p:%{msystem-v:%{mcoff:vinit1.o%s} %{!mcoff:vinit.o%s}} %{!msystem-v:%{mcoff:init1.o%s}%{!mcoff:init.o%s}}}"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "%{mcoff:initn.o%s} %{p:_etext.o%s}"
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "long int"
-
-/* We want to output DBX debugging information. */
-
-#define DBX_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* We optionally want to be able to produce SDB debugging output so that
- we can create debuggable SDB/coff files. This won't be needed when
- stabs-in-coff works. */
-
-#define SDB_DEBUGGING_INFO
-
-/* Generate calls to memcpy, memcmp and memset. */
-
-#define TARGET_MEM_FUNCTIONS
-
-/* Handle #pragma pack and sometimes #pragma weak. */
-
-#define HANDLE_SYSV_PRAGMA
-
-#define TARGET_THREADS (target_flags & MASK_THREADS)
-#define MASK_THREADS 0x40000000
-
-#define TARGET_POSIX (target_flags & MASK_POSIX)
-#define MASK_POSIX 0x20000000
-
-#define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V)
-#define MASK_SYSTEM_V 0x10000000
-
-#define TARGET_COFF (target_flags & MASK_COFF)
-#define MASK_COFF 0x08000000
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
- {"threads", MASK_THREADS}, \
- {"posix", MASK_POSIX}, \
- {"system-v", MASK_SYSTEM_V}, \
- {"coff", MASK_COFF},
-
-#undef SUBTARGET_OVERRIDE_OPTIONS
-#define SUBTARGET_OVERRIDE_OPTIONS \
-{ if (TARGET_SYSTEM_V && profile_flag) \
- warning ("-msystem-v and -p are incompatible"); \
- if (TARGET_SYSTEM_V && TARGET_THREADS) \
- warning ("-msystem-v and -mthreads are incompatible"); }
-
-/* Define this so that C++ destructors will use atexit. */
-
-#define HAVE_ATEXIT
-
-/* This is defined only so that we can find the assembler. Everything else
- is in /bin. */
-
-#define MD_EXEC_PREFIX "/usr/local/lib/gcc-"
-
-/* ??? This is needed because /bin/ld does not handle -L options correctly.
- This can be deleted if GNU ld is being used. */
-
-#define LINK_LIBGCC_SPECIAL_1
-
-/* The Lynx linker considers __main to be a possible entry point, so we
- must use a different name. */
-
-#define NAME__MAIN "____main"
-#define SYMBOL__MAIN ____main
+/* Target independent definitions for LynxOS.
+ Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004,
+ 2007 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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 3, or (at your option)
+any later version.
+
+GCC 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 GCC; see the file COPYING3. If not see
+. */
+
+/* In this file we set up defaults that can be chosen by
+ /lynx.h files. A target-specific lynx.h file can decide
+ either to define and override these definitions or to use them by
+ ensuring they are undefined at this point. If we were to #undef
+ them here we might accidentally disable some target-specific
+ defines. */
+
+#ifndef EXTRA_OS_LYNX_TARGET_SPECS
+# define EXTRA_OS_LYNX_TARGET_SPECS
+#endif
+
+#ifndef EXTRA_OS_LYNX_SPECS
+# define EXTRA_OS_LYNX_SPECS \
+ { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
+ { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
+ { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
+ { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
+ { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
+ EXTRA_OS_LYNX_TARGET_SPECS
+#endif
+
+#ifndef SUBTARGET_EXTRA_SPECS
+# define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
+#endif
+
+#ifndef CPP_SPEC
+# define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
+#endif
+
+#ifndef LIB_SPEC
+# define LIB_SPEC "%(lib_os_lynx)"
+#endif
+
+#ifndef LINK_SPEC
+# define LINK_SPEC "%(link_os_lynx)"
+#endif
+
+#ifndef STARTFILE_SPEC
+# define STARTFILE_SPEC "%(startfile_os_lynx)"
+#endif
+
+#ifndef ENDFILE_SPEC
+# define ENDFILE_SPEC "%(endfile_os_lynx)"
+#endif
+
+#ifndef CPP_OS_LYNX_SPEC
+# define CPP_OS_LYNX_SPEC \
+"%{mthreads: \
+ %{mlegacy-threads: \
+ %ecannot use mthreads and mlegacy-threads together}} \
+ %{mthreads: -D_MULTITHREADED} \
+ %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
+ -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
+#endif
+
+#ifndef LIB_OS_LYNX_SPEC
+# define LIB_OS_LYNX_SPEC \
+"%{mlegacy-threads:-lposix-pre1c} -lm -lc"
+#endif
+
+/* We link static executables for LynxOS by default unless -mshared is
+ used when linking an executable. Along the same line, we link to
+ shared libraries when linking a shared object by default unless
+ -static is used.
+
+ We have to pass in our -L options here otherwise the translated
+ startfile directories (%D) will take priority over this.
+ Furthermore since we have to pass in -L options here we have to
+ make sure that -L options provided by the user take priority over
+ everything we specify. */
+
+#ifndef LINK_OS_LYNX_SPEC
+# define LINK_OS_LYNX_SPEC \
+"%{shared} %{static} \
+ %{mshared: %{static: %ecannot use mshared and static together}} \
+ %{!mshared: %{!shared: %{!static: -static}}} \
+ %{L*} \
+ %{mthreads: \
+ %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
+ %{shared: \
+ %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
+ %{!mshared: -L/lib/thread}} \
+ %{shared: %{static: -L/lib/thread}}} \
+ %{!mthreads: \
+ %{mshared: -L/lib/shlib -rpath /lib/shlib} \
+ %{shared: -L/lib/shlib -rpath /lib/shlib}} \
+ %{mlegacy-threads:-lposix-pre1c} -lm -lc"
+#endif
+
+#ifndef STARTFILE_OS_LYNX_SPEC
+# define STARTFILE_OS_LYNX_SPEC \
+"%{!shared: \
+ %{!mthreads: \
+ %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
+ %{!p:%{!pg:crt1.o%s}}} \
+ %{mthreads: \
+ %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
+ %{!p:%{!pg:thread/crt1.o%s }}}}\
+ %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
+ %{!shared: crtbegin.o%s} \
+ %{shared: crtbeginS.o%s}"
+#endif
+
+#ifndef ENDFILE_OS_LYNX_SPEC
+# define ENDFILE_OS_LYNX_SPEC \
+"%{!shared: crtend.o%s} \
+ %{shared: crtendS.o%s} \
+ %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
+#endif
+
+/* Define the actual types of some ANSI-mandated types. */
+
+#ifndef SIZE_TYPE
+# define SIZE_TYPE "unsigned int"
+#endif
+
+#ifndef PTRDIFF_TYPE
+# define PTRDIFF_TYPE "int"
+#endif
+
+#ifndef WCHAR_TYPE
+# define WCHAR_TYPE "long int"
+#endif
+
+#ifndef WCHAR_TYPE_SIZE
+# define WCHAR_TYPE_SIZE BITS_PER_WORD
+#endif
+
+/* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
+ the .align directive with GAS. */
+
+#ifndef ASM_OUTPUT_ALIGN
+# define ASM_OUTPUT_ALIGN(FILE, LOG) \
+ do \
+ { \
+ if ((LOG) != 0) \
+ fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \
+ } \
+ while (0)
+#endif
+
+/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
+ the default on LynxOS. */
+
+#ifndef PREFERRED_DEBUGGING_TYPE
+# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#endif
+
+/* We have C++ support in our system headers. */
+
+#ifndef NO_IMPLICIT_EXTERN_C
+# define NO_IMPLICIT_EXTERN_C
+#endif
+
+#ifndef TARGET_POSIX_IO
+# define TARGET_POSIX_IO
+#endif