aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2010-04-27 17:48:58 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2010-04-27 19:48:58 +0200
commitad21109137176779256ba227c2fe696dce8ea967 (patch)
treee0154da3cd27e351b191a34f7b5e465075192112 /gcc/config
parent126bac7bd6c3d7672f2ed913e53fbba65698d58c (diff)
downloadgcc-ad21109137176779256ba227c2fe696dce8ea967.zip
gcc-ad21109137176779256ba227c2fe696dce8ea967.tar.gz
gcc-ad21109137176779256ba227c2fe696dce8ea967.tar.bz2
collect2.c (TARGET_64BIT): Redefine to target's default.
2010-04-27 Kai Tietz <kai.tietz@onevision.com> * collect2.c (TARGET_64BIT): Redefine to target's default. * tlink.c: Likewise. * config/i386/cygming.h (USER_LABEL_PREFIX): Define dependent to TARGET_64BIT and USE_MINGW64_LEADING_UNDERSCORES. * config/i386/i386.h (CRT_CALL_STATIC_FUNCTION): Use for underscoring __USER_LABEL_PREFIX__. * config/i386/mingw-w64.h (SUB_LINK_ENTRY): New macro. (SUB_LINK_ENTRY32): New. (SUB_LINK_ENTRY64): New. (LINK_SPEC): Replace entry point spec by SUB_LINK_ENTRY. * config/i386/mingw32 (SUB_LINK_ENTRY32): New. (SUB_LINK_ENTRY64): New. (SUB_LINK_ENTRY): New. (LINK_SPEC): Use SUB_LINK_ENTRY instead of hard-coded entry-point. (DWARF2_UNWIND_INFO): Error out for use of dw2 unwind when x64 target is choosen. * config.in (USE_MINGW64_LEADING_UNDERSCORES): New. * configure: Regenerated. * configure.ac (leading-mingw64-underscores): Option added. From-SVN: r158791
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/cygming.h5
-rw-r--r--gcc/config/i386/i386.h9
-rw-r--r--gcc/config/i386/mingw-w64.h17
-rw-r--r--gcc/config/i386/mingw32.h22
4 files changed, 48 insertions, 5 deletions
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index a726bb4..71a5d8d 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3. If not see
#undef DEFAULT_ABI
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
+#if ! defined (USE_MINGW64_LEADING_UNDERSCORES)
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX (TARGET_64BIT ? "" : "_")
+#endif
+
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] \
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 4b83370..163cda1 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2148,9 +2148,12 @@ do { \
/* Switch to init or fini section via SECTION_OP, emit a call to FUNC,
and switch back. For x86 we do this only to save a few bytes that
would otherwise be unused in the text section. */
-#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
- asm (SECTION_OP "\n\t" \
- "call " USER_LABEL_PREFIX #FUNC "\n" \
+#define CRT_MKSTR2(VAL) #VAL
+#define CRT_MKSTR(x) CRT_MKSTR2(x)
+
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+ asm (SECTION_OP "\n\t" \
+ "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \
TEXT_SECTION_ASM_OP);
/* Print operand X (an rtx) in assembler syntax to file FILE.
diff --git a/gcc/config/i386/mingw-w64.h b/gcc/config/i386/mingw-w64.h
index 8584082..3aafb93 100644
--- a/gcc/config/i386/mingw-w64.h
+++ b/gcc/config/i386/mingw-w64.h
@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see
#define ASM_SPEC "%{v:-v} %{n} %{T} %{Ym,*} %{Yd,*} \
%{Wa,*:%*} %{m32:--32} %{m64:--64}"
+#undef SPEC_32
+#undef SPEC_64
#if TARGET_64BIT_DEFAULT
#define SPEC_32 "m32"
#define SPEC_64 "!m32"
@@ -47,8 +49,21 @@ along with GCC; see the file COPYING3. If not see
#define SPEC_64 "m64"
#endif
+#undef SUB_LINK_ENTRY32
+#undef SUB_LINK_ENTRY64
+#define SUB_LINK_ENTRY32 "-e _DllMainCRTStartup@12"
+#if defined(USE_MINGW64_LEADING_UNDERSCORES)
+#define SUB_LINK_ENTRY64 "-e _DllMainCRTStartup"
+#else
+#define SUB_LINK_ENTRY64 "-e DllMainCRTStartup"
+#endif
+
+#undef SUB_LINK_SPEC
+#undef SUB_LINK_ENTRY
#define SUB_LINK_SPEC "%{" SPEC_64 ":-m i386pep} %{" SPEC_32 ":-m i386pe}"
+#define SUB_LINK_ENTRY "%{" SPEC_64 ":" SUB_LINK_ENTRY64 "} %{" SPEC_32 ":" SUB_LINK_ENTRY32 "}"
+#undef MULTILIB_DEFAULTS
#if TARGET_64BIT_DEFAULT
#define MULTILIB_DEFAULTS { "m64" }
#else
@@ -61,5 +76,5 @@ along with GCC; see the file COPYING3. If not see
%{shared: %{mdll: %eshared and mdll are not compatible}} \
%{shared: --shared} %{mdll:--dll} \
%{static:-Bstatic} %{!static:-Bdynamic} \
- %{shared|mdll: -e _DllMainCRTStartup@12 --enable-auto-image-base} \
+ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
%(shared_libgcc_undefs)"
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 2e877d8..e08ea1c 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -47,6 +47,22 @@ along with GCC; see the file COPYING3. If not see
} \
while (0)
+#undef SUB_LINK_ENTRY32
+#undef SUB_LINK_ENTRY64
+#define SUB_LINK_ENTRY32 "-e _DllMainCRTStartup@12"
+#if defined(USE_MINGW64_LEADING_UNDERSCORES)
+#define SUB_LINK_ENTRY64 "-e _DllMainCRTStartup"
+#else
+#define SUB_LINK_ENTRY64 "-e DllMainCRTStartup"
+#endif
+
+#undef SUB_LINK_ENTRY
+#if TARGET_64BIT_DEFAULT
+#define SUB_LINK_ENTRY SUB_LINK_ENTRY64
+#else
+#define SUB_LINK_ENTRY SUB_LINK_ENTRY32
+#endif
+
/* Override the standard choice of /usr/include as the default prefix
to try when searching for header files. */
#undef STANDARD_INCLUDE_DIR
@@ -66,6 +82,10 @@ along with GCC; see the file COPYING3. If not see
/* Weak symbols do not get resolved if using a Windows dll import lib.
Make the unwind registration references strong undefs. */
#if DWARF2_UNWIND_INFO
+/* DW2-unwind is just available for 32-bit mode. */
+#if TARGET_64BIT_DEFAULT
+#error DW2 unwind is not available for 64-bit.
+#endif
#define SHARED_LIBGCC_UNDEFS_SPEC \
"%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}"
#else
@@ -81,7 +101,7 @@ along with GCC; see the file COPYING3. If not see
%{shared: %{mdll: %eshared and mdll are not compatible}} \
%{shared: --shared} %{mdll:--dll} \
%{static:-Bstatic} %{!static:-Bdynamic} \
- %{shared|mdll: -e _DllMainCRTStartup@12 --enable-auto-image-base} \
+ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
%(shared_libgcc_undefs)"
/* Include in the mingw32 libraries with libgcc */