/* Target independent definitions for LynxOS.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002
+ Free Software Foundation, Inc.
This file is part of GNU CC.
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
We can get quite a bit from generic svr3, but have to do some overrides. */
#undef LIB_SPEC
#define LIB_SPEC "%{mthreads:-L/lib/thread/} \
%{msystem-v:-lc_v} \
- %{!msystem-v:%{mposix:-lc_p} -lc}"
+ %{!msystem-v:%{mposix:-lc_p} -lc -lm}"
/* Set the appropriate names for the Lynx startfiles. */
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{p:pinit1.o%s}%{!p:%{msystem-v:vinit1.o%s}%{!msystem-v:init1.o%s}}"
+#define STARTFILE_SPEC "%{p:%{mthreads:thread/pinit1.o%s}%{!mthreads:pinit1.o%s}}%{!p:%{msystem-v:vinit1.o%s -e_start}%{!msystem-v:%{mthreads:thread/init1.o%s}%{!mthreads:init1.o%s}}}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
/* We want to output DBX (stabs) debugging information normally. */
#define DBX_DEBUGGING_INFO
+#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
/* It is convenient to be able to generate standard coff debugging
#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(file, line) \
{ static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n", \
- line, sym_lineno, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
- sym_lineno); \
+ fprintf (file, ".stabn 68,0,%d,.LM%d-", \
+ line, sym_lineno); \
+ assemble_name (file, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ fprintf (file, "\n.LM%d:\n", sym_lineno); \
sym_lineno += 1; }
/* Handle #pragma pack and sometimes #pragma weak. */
#undef SUBTARGET_OVERRIDE_OPTIONS
#define SUBTARGET_OVERRIDE_OPTIONS \
-{ if (TARGET_SYSTEM_V && profile_flag) \
+do { \
+ 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, since LynxOS
- calls exit after main returns. */
-
-#define HAVE_ATEXIT
+ warning ("-msystem-v and -mthreads are incompatible"); \
+} while (0)
/* Since init.o et al put all sorts of stuff into the init section,
we can't use the standard init section support in crtbegin.o. */
#undef INIT_SECTION_ASM_OP
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors, in_fini,
+#define EXTRA_SECTIONS in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
- BSS_SECTION_FUNCTION \
- CTORS_SECTION_FUNCTION \
- DTORS_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
#undef CTORS_SECTION_ASM_OP
-#define CTORS_SECTION_ASM_OP ".section\t.ctors"
+#define CTORS_SECTION_ASM_OP "\t.section\t.ctors"
#undef DTORS_SECTION_ASM_OP
-#define DTORS_SECTION_ASM_OP ".section\t.dtors"
-
-#define INT_ASM_OP ".long"
-
-/* A C statement (sans semicolon) to output an element in the table of
- global constructors. */
-#undef ASM_OUTPUT_CONSTRUCTOR
-#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
- do { \
- ctors_section (); \
- fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
- assemble_name (FILE, NAME); \
- fprintf (FILE, "\n"); \
- } while (0)
-
-/* A C statement (sans semicolon) to output an element in the table of
- global destructors. */
-#undef ASM_OUTPUT_DESTRUCTOR
-#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
- do { \
- dtors_section (); \
- fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
- assemble_name (FILE, NAME); \
- fprintf (FILE, "\n"); \
- } while (0)
+#define DTORS_SECTION_ASM_OP "\t.section\t.dtors"
#undef DO_GLOBAL_CTORS_BODY
#undef DO_GLOBAL_DTORS_BODY
+
+/* LynxOS doesn't have mcount. */
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(file, profile_label_no)