summaryrefslogtreecommitdiff
path: root/gcc/config/vxworks.h
diff options
context:
space:
mode:
authorpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-24 07:13:10 +0000
committerpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-24 07:13:10 +0000
commite6eccdb304362a450c2ae3760cebabe6cc1c5d19 (patch)
tree043e6201134ccf2fb879689b66262419aefab937 /gcc/config/vxworks.h
parent29049716afd0fa4a560c538ae1da85b5f688d6c9 (diff)
downloadgcc-e6eccdb304362a450c2ae3760cebabe6cc1c5d19.tar.gz
2005-08-22 Phil Edwards <phil@codesourcery.com>
* config.gcc (*-*-vxworks*): Update tm_file, add extra_options, remove use_collect2. (powerpc-wrs-vxworks): Update, split out *-*-vxworksae target. * target-def.h (TARGET_HAVE_CTORS_DTORS): Allow target configuration files to override the default value. * config/t-vxworks: Remove INSTALL_ASSERT_H. Define STMP_FIXPROTO, EXTRA_HEADERS, and EXTRA_MULTILIB_PARTS. * config/vx-common.h: New file, split out from... * config/vxworks.h: here. Update for VxWorks 6.x and RTP mode. * config/vxworksae.h: New file, for VxWorks AE. * config/vxworks.opt: New file. * config/vxlib.c: Update for VxWorks 6. * config/rs6000/t-vxworks (MULTILIB_OPTIONS): New list. Adjust other MULTILIB_* variables appropriately. (LIB2FUNCS_EXTRA, EXTRA_MULTILIB_PARTS): Correct from t-ppccomm. * config/rs6000/t-vxworksae: New file, adjust multilibs for AE. * config/rs6000/vxworks.h: Update for VxWorks 6. * config/rs6000/vxworksae.h: New file, mostly placeholder for now. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103432 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/vxworks.h')
-rw-r--r--gcc/config/vxworks.h131
1 files changed, 85 insertions, 46 deletions
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index 1fe546b6124..26445454b61 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -1,64 +1,103 @@
-/* Common VxWorks target definitions for GCC.
- Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+/* Common VxWorks target definitions for GNU compiler.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Contributed by Wind River Systems.
+ Rewritten by CodeSourcery, LLC.
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 2, or (at your option)
-any later version.
+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 2, 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.
+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 COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
-/* Specify what to link with. */
-/* VxWorks does all the library stuff itself. */
-#undef LIB_SPEC
-#define LIB_SPEC ""
+/* In kernel mode, VxWorks provides all the libraries itself, as well as
+ the functionality of startup files, etc. In RTP mode, it behaves more
+ like a traditional Unix, with more external files. Most of our specs
+ must be aware of the difference. */
-#undef LINK_SPEC
-#define LINK_SPEC "-r"
+/* The directory containing the VxWorks target headers. */
+#define VXWORKS_TARGET_DIR "/home/tornado/base6/target"
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
+/* Since we provide a default -isystem, expand -isystem on the command
+ line early. */
+#undef VXWORKS_ADDITIONAL_CPP_SPEC
+#define VXWORKS_ADDITIONAL_CPP_SPEC " \
+ %{!nostdinc:%{isystem*}} \
+ %{mrtp: -D__RTP__=1 \
+ %{!nostdinc:-isystem " VXWORKS_TARGET_DIR "/usr/h}} \
+ %{!mrtp:-D_WRS_KERNEL=1 \
+ %{!nostdinc:-isystem " VXWORKS_TARGET_DIR "/h}}"
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
+/* The references to __init and __fini will be satisified by
+ libc_internal.a. */
+#undef VXWORKS_LIB_SPEC
+#define VXWORKS_LIB_SPEC \
+"%{mrtp:%{shared:-u " USER_LABEL_PREFIX "__init -u " USER_LABEL_PREFIX "__fini} \
+ %{!shared:%{non-static:-u " USER_LABEL_PREFIX "_STI__6__rtld -ldl} \
+ --start-group -lc -lgcc -lc_internal -lnet -ldsi \
+ --end-group}}"
-/* VxWorks cannot have dots in constructor labels, because it uses a
- mutant variation of collect2 that generates C code instead of
- assembly. Thus each constructor label must be a legitimate C
- symbol. FIXME: Have VxWorks use real collect2 instead. */
+/* The no-op spec for "-shared" below is present because otherwise GCC
+ will treat it as an unrecognized option. */
+#undef VXWORKS_LINK_SPEC
+#define VXWORKS_LINK_SPEC \
+"%{!mrtp:-r} \
+ %{!shared: \
+ %{mrtp:-q %{h*} \
+ %{R*} %{!Wl,-T*: %{!T*: %(link_start) }} \
+ %(link_target) %(link_os)}} \
+ %{v:-V} \
+ %{shared:-shared} \
+ %{Bstatic:-Bstatic} \
+ %{Bdynamic:-Bdynamic} \
+ %{!Xbind-lazy:-z now} \
+ %{Xbind-now:%{Xbind-lazy: \
+ %e-Xbind-now and -Xbind-lazy are incompatible}} \
+ %{mrtp:%{!shared:%{!non-static:-static} \
+ %{non-static:--force-dynamic --export-dynamic}}}"
-#undef NO_DOLLAR_IN_LABEL
-#define NO_DOT_IN_LABEL
+/* For VxWorks, the system provides libc_internal.a. This is a superset
+ of libgcc.a; we want to use it. Make sure not to dynamically export
+ any of its symbols, though. Always look for libgcc.a first so that
+ we get the latest versions of the GNU intrinsics during our builds. */
+#undef VXWORKS_LIBGCC_SPEC
+#define VXWORKS_LIBGCC_SPEC \
+ "-lgcc %{mrtp:--exclude-libs=libc_internal,libgcc -lc_internal}"
-/* We want #pragma pack(n) enabled and expect to inherit the proper
- definition of HANDLE_SYSV_PRAGMA from elfos.h for that purpose. */
+#undef VXWORKS_STARTFILE_SPEC
+#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:crt0.o%s}}"
+#define VXWORKS_ENDFILE_SPEC ""
-/* No underscore is prepended to any C symbol name. */
-#undef USER_LABEL_PREFIX
-#define USER_LABEL_PREFIX ""
+/* We can use .ctors/.dtors sections only in RTP mode.
+ Unfortunately this must be an integer constant expression;
+ fix up in override_options. */
+#undef VXWORKS_OVERRIDE_OPTIONS
+#define VXWORKS_OVERRIDE_OPTIONS do { \
+ targetm.have_ctors_dtors = TARGET_VXWORKS_RTP; \
+} while (0)
-/* VxWorks uses wchar_t == unsigned short (UCS2) on all architectures. */
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "short unsigned int"
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 16
+/* The VxWorks runtime uses a clever trick to get the sentinel entry
+ (-1) inserted at the beginning of the .ctors segment. This trick
+ will not work if we ever generate any entries in plain .ctors
+ sections; we must always use .ctors.PRIORITY. */
+#define ALWAYS_NUMBER_CTORS_SECTIONS 1
-/* Dwarf2 unwind info is not supported. */
-#define DWARF2_UNWIND_INFO 0
-/* Weak symbols and link-once sections are not enabled by default. */
-#define DEFAULT_USE_WEAK 0
+/* The name of the symbol for the table of GOTs in a particular
+ RTP. */
+#define VXWORKS_GOTT_BASE "__GOTT_BASE__"
+/* The name of the symbol for the index into the table of GOTs for the
+ GOT associated with the current shared library. */
+#define VXWORKS_GOTT_INDEX "__GOTT_INDEX__"
-/* Only supported debug format is Dwarf2. */
-#undef DBX_DEBUGGING_INFO
+#define VXWORKS_KIND VXWORKS_KIND_NORMAL