Commit a7a4fd17 by Fred Fish Committed by Jason Merrill

beos-elf.h (STARTFILE_SPEC): Add i386-mcount.o when user gives -p option.

        * config/i386/beos-elf.h (STARTFILE_SPEC): Add i386-mcount.o
        when user gives -p option.  Add init_term_dyn.o for BeOS 5.0
        and later.

        * config/i386/beos-elf.h (INCLUDE_DEFAULTS): Add additional
        Be directories to search path.

        Remove support for __declspec(dllimport) and __declspec(dllexport).
        This is leftover cruft from the earlier BeOS gcc port when BeOS
        used Microsoft's PE object file format.
        * configure.in (i*86-*-beoself): Remove extra_objs=winnt.o.
        * config/i386/t-beos (winnt.o): Remove Makefile frag.
        * config/i386/beos-elf.h (TARGET_NOP_FUN_DLLIMPORT): Remove.
        (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
        (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
        (MERGE_MACHINE_DECL_ATTRIBUTES): Remove.
        (REDO_SECTION_INFO_P): Remove.
        (ASM_EXPORT_DECL): Remove.
        (ASM_DECLARE_FUNCTION_NAME): Remove.
        (ASM_DECLARE_OBJECT_NAME): Remove.
        (ASM_OUTPUT_ALIGNED_COMMON): Remove.
        (ASM_OUTPUT_ALIGNED_DECL_COMMON): Remove.
        (ASM_OUTPUT_ALIGNED_LOCAL): Remove.
        (STRIP_NAME_ENCODING): Remove.

        Remove support for obsolete version of BeOS that is no longer
        supported by Be.
        * configure.in (i*86-*-beospe*): Remove.
        * config/i386/beos-pe.h: Remove.

From-SVN: r35420
parent b53978a3
2000-08-02 Fred Fish <fnf@be.com>
* config/i386/beos-elf.h (STARTFILE_SPEC): Add i386-mcount.o
when user gives -p option. Add init_term_dyn.o for BeOS 5.0
and later.
* config/i386/beos-elf.h (INCLUDE_DEFAULTS): Add additional
Be directories to search path.
Remove support for __declspec(dllimport) and __declspec(dllexport).
This is leftover cruft from the earlier BeOS gcc port when BeOS
used Microsoft's PE object file format.
* configure.in (i*86-*-beoself): Remove extra_objs=winnt.o.
* config/i386/t-beos (winnt.o): Remove Makefile frag.
* config/i386/beos-elf.h (TARGET_NOP_FUN_DLLIMPORT): Remove.
(VALID_MACHINE_DECL_ATTRIBUTE): Remove.
(VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
(MERGE_MACHINE_DECL_ATTRIBUTES): Remove.
(REDO_SECTION_INFO_P): Remove.
(ASM_EXPORT_DECL): Remove.
(ASM_DECLARE_FUNCTION_NAME): Remove.
(ASM_DECLARE_OBJECT_NAME): Remove.
(ASM_OUTPUT_ALIGNED_COMMON): Remove.
(ASM_OUTPUT_ALIGNED_DECL_COMMON): Remove.
(ASM_OUTPUT_ALIGNED_LOCAL): Remove.
(STRIP_NAME_ENCODING): Remove.
Remove support for obsolete version of BeOS that is no longer
supported by Be.
* configure.in (i*86-*-beospe*): Remove.
* config/i386/beos-pe.h: Remove.
2000-08-01 Jeffrey Oldham <oldham@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>
......
......@@ -128,7 +128,7 @@ Boston, MA 02111-1307, USA. */
#define LIBGCC_SPEC ""
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s}"
#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s} init_term_dyn.o%s %{p:i386-mcount.o%s}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
......@@ -157,133 +157,6 @@ Boston, MA 02111-1307, USA. */
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
#endif
/*
* Support for __declspec(dllimport) & __declspec(dllexport).
*/
/* We don't care about dllimport. */
#define TARGET_NOP_FUN_DLLIMPORT 1
/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
is a valid machine specific attribute for DECL.
The attributes in ATTRIBUTES have previously been assigned to DECL. */
#undef VALID_MACHINE_DECL_ATTRIBUTE
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
i386_pe_valid_decl_attribute_p (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
extern int i386_pe_valid_decl_attribute_p ();
/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
is a valid machine specific attribute for TYPE.
The attributes in ATTRIBUTES have previously been assigned to TYPE. */
#undef VALID_MACHINE_TYPE_ATTRIBUTE
#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
i386_pe_valid_type_attribute_p (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
extern int i386_pe_valid_type_attribute_p ();
#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
i386_pe_merge_decl_attributes ((OLD), (NEW))
extern union tree_node *i386_pe_merge_decl_attributes ();
/* Used to implement dllexport overriding dllimport semantics. It's also used
to handle vtables - the first pass won't do anything because
DECL_CONTEXT (DECL) will be 0 so i386_pe_dll{ex,im}port_p will return 0.
It's also used to handle dllimport override semantics. */
#if 0
#define REDO_SECTION_INFO_P(DECL) \
((DECL_MACHINE_ATTRIBUTES (DECL) != NULL_TREE) \
|| (TREE_CODE (DECL) == VAR_DECL && DECL_VIRTUAL_P (DECL)))
#else
#define REDO_SECTION_INFO_P(DECL) 1
#endif
/* Used only here locally. If the decl has been exported, emit the
necessary assembly. */
#define ASM_EXPORT_DECL(FILE, NAME, DECL) \
do { \
if ((DECL) && i386_pe_dllexport_p (DECL)) \
{ \
fprintf ((FILE), ".section .exports\n"); \
fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP); \
assemble_name (FILE, NAME); \
fprintf ((FILE), "\"\n.previous\n"); \
} \
} while (0)
/* Write the extra assembler code needed to declare a function properly.
Some svr4 assemblers need to also have something extra said about the
function's return value. We allow for that here. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \
ASM_EXPORT_DECL(FILE, NAME, DECL); \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
putc ('\n', FILE); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
ASM_OUTPUT_LABEL(FILE, NAME); \
} while (0)
/* Write the extra assembler code needed to declare an object properly. */
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
do { \
ASM_EXPORT_DECL(FILE, NAME, DECL); \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
putc ('\n', FILE); \
size_directive_output = 0; \
if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
{ \
size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
int_size_in_bytes (TREE_TYPE (DECL))); \
fputc ('\n', FILE); \
} \
ASM_OUTPUT_LABEL(FILE, NAME); \
} while (0)
/* Similarly for COMMON symbols. */
#undef ASM_OUTPUT_ALIGNED_COMMON
#undef ASM_OUTPUT_ALIGNED_DECL_COMMON
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
ASM_EXPORT_DECL(FILE, NAME, DECL); \
fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
} while (0)
#undef ASM_OUTPUT_ALIGNED_LOCAL
#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), "\n"); \
ASM_OUTPUT_ALIGNED_DECL_COMMON((FILE), (DECL), (NAME), (SIZE), (ALIGN)); \
} while (0)
/* This macro gets just the user-specified name out of the string in a
SYMBOL_REF. Discard trailing @[NUM] encoded by ENCODE_SECTION_INFO. */
/* Unused except to let winnt.c compile. */
#undef STRIP_NAME_ENCODING
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) ((VAR) = (SYMBOL_NAME))
/* For native compiler, use standard BeOS include file search paths
rooted in /boot/develop/headers. For a cross compiler, don't
expect the host to use the BeOS directory scheme, and instead look
......@@ -310,14 +183,25 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
{ "/boot/develop/headers/be/kernel", 0, 0, 0 },\
{ "/boot/develop/headers/be/net", 0, 0, 0 },\
{ "/boot/develop/headers/be/midi", 0, 0, 0 },\
{ "/boot/develop/headers/be/midi2", 0, 0, 0 },\
{ "/boot/develop/headers/be/media", 0, 0, 0 },\
{ "/boot/develop/headers/be/interface", 0, 0, 0 },\
{ "/boot/develop/headers/be/device", 0, 0, 0 },\
{ "/boot/develop/headers/be/app", 0, 0, 0 },\
{ "/boot/develop/headers/cpp", 0, 0, 0 },\
{ "/boot/develop/headers/posix", 0, 0, 0 },\
{ "/boot/develop/headers/be/precompiled", 0, 0, 0 },\
{ "/boot/develop/headers/be/add-ons/input_server", 0, 0, 0 },\
{ "/boot/develop/headers/be/add-ons/net_server", 0, 0, 0 },\
{ "/boot/develop/headers/be/add-ons/screen_saver", 0, 0, 0 },\
{ "/boot/develop/headers/be/add-ons/tracker", 0, 0, 0 },\
{ "/boot/develop/headers/be/be_apps/Deskbar", 0, 0, 0 },\
{ "/boot/develop/headers/be/be_apps/NetPositive", 0, 0, 0 },\
{ "/boot/develop/headers/be/be_apps/Tracker", 0, 0, 0 },\
{ "/boot/develop/headers/be/drivers/tty", 0, 0, 0 },\
{ "/boot/develop/headers/be/net/netinet", 0, 0, 0 },\
{ "/boot/develop/headers/be/storage", 0, 0, 0 },\
{ "/boot/develop/headers/be", 0, 0, 0 },\
{ "/boot/develop/headers/cpp", 0, 0, 0 },\
{ "/boot/develop/headers/posix", 0, 0, 0 },\
{ "/boot/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
......@@ -341,14 +225,25 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
{ CROSS_INCLUDE_DIR "/be/kernel", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/net", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/midi", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/midi2", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/media", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/interface", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/device", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/app", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/cpp", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/posix", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/precompiled", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/add-ons/input_server", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/add-ons/net_server", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/add-ons/screen_saver", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/add-ons/tracker", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/be_apps/Deskbar", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/be_apps/NetPositive", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/be_apps/Tracker", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/drivers/tty", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/net/netinet", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be/storage", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/be", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/cpp", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/posix", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR , 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
......
/* Operating system specific defines for BeOS target.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com), based on cygwin32.h.
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. */
/* Get all the PE support related things. */
#include "cygwin32.h"
/* Change debugging to Dwarf2. */
#undef SDB_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
/* Support the __declspec keyword by turning them into attributes.
We currently only support: dllimport and dllexport.
Note that the current way we do this may result in a collision with
predefined attributes later on. This can be solved by using one attribute,
say __declspec__, and passing args to it. The problem with that approach
is that args are not accumulated: each new appearance would clobber any
existing args. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__BEOS__ -D__INTEL__ -D_X86_=1 \
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
-D__declspec(x)=__attribute__((x)) \
-Asystem(beos)"
#undef CPP_SPEC
#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
#define LIB_SPEC "-lroot -lbe -ltracker -lmedia -lnet -lnetdev -ldevice -lmidi -lgame -latalk -lmail"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "/boot/develop/lib/x86/start_dyn.o /boot/develop/lib/x86/init_term_dyn.o /boot/develop/lib/x86/glue-noinit.a"
/* Temporary. */
#define LINKERSCRIPT_SPEC "%{!T:-Tbeos.ld}"
/* No math library. */
#define MATH_LIBRARY ""
/* Don't ignore dllimport for functions. */
#undef TARGET_NOP_FUN_DLLIMPORT
#define TARGET_NOP_FUN_DLLIMPORT 0
#undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES
/* Disable DWARF2 unwind info; this doesn't appear to work on
COFF-based targets right now. (I want to say "duh?" but someone
will correct me later. */
#undef INCOMING_RETURN_ADDR_RTX
#undef DWARF2_UNWIND_INFO
/* In the current BeOS release (DR9), use of gcc's builtin alloca is a
problem because of the relatively low default stack size of 256K with no
way to expand it. So anything we compile for the BeOS target should not
use the builtin alloca. Defining SMALL_STACK disables builtin alloca. */
#define SMALL_STACK
/* Yuck. */
#ifndef CROSS_COMPILE
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
{ GCC_INCLUDE_DIR, "GCC", 0, 0 },\
{ TOOL_INCLUDE_DIR, "BINUTILS", 0, 1}, \
{ "/boot/develop/headers/be/add-ons/graphics", 0, 0, 0 },\
{ "/boot/develop/headers/be/translation", 0, 0, 0 },\
{ "/boot/develop/headers/be/mail", 0, 0, 0 },\
{ "/boot/develop/headers/gnu", 0, 0, 0 },\
{ "/boot/develop/headers/be/drivers", 0, 0, 0 },\
{ "/boot/develop/headers/be/game", 0, 0, 0 },\
{ "/boot/develop/headers/be/support", 0, 0, 0 },\
{ "/boot/develop/headers/be/storage", 0, 0, 0 },\
{ "/boot/develop/headers/be/kernel", 0, 0, 0 },\
{ "/boot/develop/headers/be/net", 0, 0, 0 },\
{ "/boot/develop/headers/be/midi", 0, 0, 0 },\
{ "/boot/develop/headers/be/media", 0, 0, 0 },\
{ "/boot/develop/headers/be/interface", 0, 0, 0 },\
{ "/boot/develop/headers/be/device", 0, 0, 0 },\
{ "/boot/develop/headers/be/app", 0, 0, 0 },\
{ "/boot/develop/headers/cpp", 0, 0, 0 },\
{ "/boot/develop/headers/posix", 0, 0, 0 },\
{ "/boot/develop/headers/be/precompiled", 0, 0, 0 },\
{ "/boot/develop/headers/be", 0, 0, 0 },\
{ "/boot/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
#endif
/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will
cause nasty problems if we override it. */
#define LIBRARY_PATH_ENV "BELIBRARIES"
......@@ -9,6 +9,3 @@ CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include/posix
# Use the system assert.h
INSTALL_ASSERT_H =
winnt.o: $(srcdir)/config/i386/winnt.c
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
......@@ -1423,23 +1423,12 @@ changequote([,])dnl
tmake_file=i386/t-i386bare
;;
changequote(,)dnl
i[34567]86-*-beospe*)
changequote([,])dnl
xm_file=i386/xm-beos.h
xm_defines="USE_C_ALLOCA"
tmake_file=i386/t-beos
tm_file=i386/beos-pe.h
xmake_file=i386/x-beos
extra_objs=winnt.o
;;
changequote(,)dnl
i[34567]86-*-beoself* | i[34567]86-*-beos*)
changequote([,])dnl
xm_file=i386/xm-beos.h
tmake_file='i386/t-beos i386/t-crtpic'
tm_file=i386/beos-elf.h
xmake_file=i386/x-beos
extra_objs=winnt.o
extra_parts='crtbegin.o crtend.o'
;;
changequote(,)dnl
......
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