aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-03-07 11:52:52 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-03-07 11:52:52 +0000
commitef6727554227774efb21cf1053472f6d419d3ace (patch)
tree5e80d3400fff9fbc6fe3c3b9b6f7807f76ff114c
parent7afb5f3b680a05911b640ce88460e84063427258 (diff)
downloadgcc-ef6727554227774efb21cf1053472f6d419d3ace.zip
gcc-ef6727554227774efb21cf1053472f6d419d3ace.tar.gz
gcc-ef6727554227774efb21cf1053472f6d419d3ace.tar.bz2
vxworks.h (vxworks_override_options): Declare.
gcc/ * config/vxworks.h (vxworks_override_options): Declare. (VXWORKS_OVERRIDE_OPTIONS): Use it. * config/vxworks.c: Include target.h and toplev.h. (vxworks_override_options): New function. * config/t-vxworks (vxworks.o): Depend on $(TARGET_H) and toplev.h. From-SVN: r122657
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/t-vxworks2
-rw-r--r--gcc/config/vxworks.c15
-rw-r--r--gcc/config/vxworks.h9
4 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5d702fd..d4ae2b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-07 Richard Sandiford <richard@codesourcery.com>
+
+ * config/vxworks.h (vxworks_override_options): Declare.
+ (VXWORKS_OVERRIDE_OPTIONS): Use it.
+ * config/vxworks.c: Include target.h and toplev.h.
+ (vxworks_override_options): New function.
+ * config/t-vxworks (vxworks.o): Depend on $(TARGET_H) and toplev.h.
+
2007-03-07 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (override_options): Don't emit an error when
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks
index 3741581..c9d69e0 100644
--- a/gcc/config/t-vxworks
+++ b/gcc/config/t-vxworks
@@ -33,5 +33,5 @@ LIMITS_H_TEST = true
EXTRA_MULTILIB_PARTS =
vxworks.o: $(srcdir)/config/vxworks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- output.h $(TM_H)
+ $(TARGET_H) toplev.h output.h $(TM_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index 4ac33ab..16dbc09 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -23,6 +23,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "target.h"
+#include "toplev.h"
#include "output.h"
#include "tm.h"
@@ -54,3 +56,16 @@ vxworks_asm_out_destructor (rtx symbol, int priority)
/*constructor_p=*/false);
assemble_addr_to_section (symbol, sec);
}
+
+/* Do VxWorks-specific parts of OVERRIDE_OPTIONS. */
+
+void
+vxworks_override_options (void)
+{
+ /* We can use .ctors/.dtors sections only in RTP mode. */
+ targetm.have_ctors_dtors = TARGET_VXWORKS_RTP;
+
+ /* PIC is only supported for RTPs. */
+ if (flag_pic && !TARGET_VXWORKS_RTP)
+ error ("PIC is only supported for RTPs");
+}
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index 055bf09..2d8bfbd 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -82,13 +82,10 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:crt0.o%s}}"
#define VXWORKS_ENDFILE_SPEC ""
-/* We can use .ctors/.dtors sections only in RTP mode.
- Unfortunately this must be an integer constant expression;
- fix up in override_options. */
+/* Do VxWorks-specific parts of OVERRIDE_OPTIONS. */
#undef VXWORKS_OVERRIDE_OPTIONS
-#define VXWORKS_OVERRIDE_OPTIONS do { \
- targetm.have_ctors_dtors = TARGET_VXWORKS_RTP; \
-} while (0)
+#define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options ()
+extern void vxworks_override_options (void);
/* VxWorks requires special handling of constructors and destructors.
All VxWorks configurations must use these functions. */