Commit ad211091 by Kai Tietz Committed by Kai Tietz

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
parent 126bac7b
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.
2010-04-27 Jan Hubicka <jh@suse.cz> 2010-04-27 Jan Hubicka <jh@suse.cz>
* doc/invoke.texi (-fipa-profile): Document. * doc/invoke.texi (-fipa-profile): Document.
......
...@@ -35,6 +35,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -35,6 +35,10 @@ along with GCC; see the file COPYING3. If not see
# define SIGCHLD SIGCLD # define SIGCHLD SIGCLD
#endif #endif
/* TARGET_64BIT may be defined to use driver specific functionality. */
#undef TARGET_64BIT
#define TARGET_64BIT TARGET_64BIT_DEFAULT
#ifndef LIBRARY_PATH_ENV #ifndef LIBRARY_PATH_ENV
#define LIBRARY_PATH_ENV "LIBRARY_PATH" #define LIBRARY_PATH_ENV "LIBRARY_PATH"
#endif #endif
......
...@@ -1679,6 +1679,12 @@ ...@@ -1679,6 +1679,12 @@
#endif #endif
/* Define if we should use leading underscore on 64 bit mingw targets */
#ifndef USED_FOR_TARGET
#undef USE_MINGW64_LEADING_UNDERSCORES
#endif
/* Enable extensions on AIX 3, Interix. */ /* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
# undef _ALL_SOURCE # undef _ALL_SOURCE
......
...@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3. If not see
#undef DEFAULT_ABI #undef DEFAULT_ABI
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_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 #undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \ #define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] \ (TARGET_64BIT ? dbx64_register_map[n] \
......
...@@ -2148,9 +2148,12 @@ do { \ ...@@ -2148,9 +2148,12 @@ do { \
/* Switch to init or fini section via SECTION_OP, emit a call to FUNC, /* 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 and switch back. For x86 we do this only to save a few bytes that
would otherwise be unused in the text section. */ would otherwise be unused in the text section. */
#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ #define CRT_MKSTR2(VAL) #VAL
asm (SECTION_OP "\n\t" \ #define CRT_MKSTR(x) CRT_MKSTR2(x)
"call " USER_LABEL_PREFIX #FUNC "\n" \
#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); TEXT_SECTION_ASM_OP);
/* Print operand X (an rtx) in assembler syntax to file FILE. /* Print operand X (an rtx) in assembler syntax to file FILE.
......
...@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see
#define ASM_SPEC "%{v:-v} %{n} %{T} %{Ym,*} %{Yd,*} \ #define ASM_SPEC "%{v:-v} %{n} %{T} %{Ym,*} %{Yd,*} \
%{Wa,*:%*} %{m32:--32} %{m64:--64}" %{Wa,*:%*} %{m32:--32} %{m64:--64}"
#undef SPEC_32
#undef SPEC_64
#if TARGET_64BIT_DEFAULT #if TARGET_64BIT_DEFAULT
#define SPEC_32 "m32" #define SPEC_32 "m32"
#define SPEC_64 "!m32" #define SPEC_64 "!m32"
...@@ -47,8 +49,21 @@ along with GCC; see the file COPYING3. If not see ...@@ -47,8 +49,21 @@ along with GCC; see the file COPYING3. If not see
#define SPEC_64 "m64" #define SPEC_64 "m64"
#endif #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_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 #if TARGET_64BIT_DEFAULT
#define MULTILIB_DEFAULTS { "m64" } #define MULTILIB_DEFAULTS { "m64" }
#else #else
...@@ -61,5 +76,5 @@ along with GCC; see the file COPYING3. If not see ...@@ -61,5 +76,5 @@ along with GCC; see the file COPYING3. If not see
%{shared: %{mdll: %eshared and mdll are not compatible}} \ %{shared: %{mdll: %eshared and mdll are not compatible}} \
%{shared: --shared} %{mdll:--dll} \ %{shared: --shared} %{mdll:--dll} \
%{static:-Bstatic} %{!static:-Bdynamic} \ %{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)" %(shared_libgcc_undefs)"
...@@ -47,6 +47,22 @@ along with GCC; see the file COPYING3. If not see ...@@ -47,6 +47,22 @@ along with GCC; see the file COPYING3. If not see
} \ } \
while (0) 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 /* Override the standard choice of /usr/include as the default prefix
to try when searching for header files. */ to try when searching for header files. */
#undef STANDARD_INCLUDE_DIR #undef STANDARD_INCLUDE_DIR
...@@ -66,6 +82,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -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. /* Weak symbols do not get resolved if using a Windows dll import lib.
Make the unwind registration references strong undefs. */ Make the unwind registration references strong undefs. */
#if DWARF2_UNWIND_INFO #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 \ #define SHARED_LIBGCC_UNDEFS_SPEC \
"%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}" "%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}"
#else #else
...@@ -81,7 +101,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -81,7 +101,7 @@ along with GCC; see the file COPYING3. If not see
%{shared: %{mdll: %eshared and mdll are not compatible}} \ %{shared: %{mdll: %eshared and mdll are not compatible}} \
%{shared: --shared} %{mdll:--dll} \ %{shared: --shared} %{mdll:--dll} \
%{static:-Bstatic} %{!static:-Bdynamic} \ %{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)" %(shared_libgcc_undefs)"
/* Include in the mingw32 libraries with libgcc */ /* Include in the mingw32 libraries with libgcc */
......
...@@ -895,6 +895,7 @@ enable_initfini_array ...@@ -895,6 +895,7 @@ enable_initfini_array
enable_sjlj_exceptions enable_sjlj_exceptions
with_system_libunwind with_system_libunwind
enable_secureplt enable_secureplt
enable_leading_mingw64_underscores
enable_cld enable_cld
enable_win32_registry enable_win32_registry
enable_static enable_static
...@@ -1592,6 +1593,8 @@ Optional Features: ...@@ -1592,6 +1593,8 @@ Optional Features:
--enable-sjlj-exceptions --enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling arrange to use setjmp/longjmp exception handling
--enable-secureplt enable -msecure-plt by default for PowerPC --enable-secureplt enable -msecure-plt by default for PowerPC
--enable-leading-mingw64-underscores
Enable leading underscores on 64 bit mingw targets
--enable-cld enable -mcld by default for 32bit x86 --enable-cld enable -mcld by default for 32bit x86
--disable-win32-registry --disable-win32-registry
disable lookup of installation paths in the disable lookup of installation paths in the
...@@ -10685,6 +10688,17 @@ if test "${enable_secureplt+set}" = set; then : ...@@ -10685,6 +10688,17 @@ if test "${enable_secureplt+set}" = set; then :
fi fi
# Check whether --enable-leading-mingw64-underscores was given.
if test "${enable_leading_mingw64_underscores+set}" = set; then :
enableval=$enable_leading_mingw64_underscores;
fi
if test x"$enable_leading_mingw64_underscores" = xyes ; then :
$as_echo "#define USE_MINGW64_LEADING_UNDERSCORES 1" >>confdefs.h
fi
# Check whether --enable-cld was given. # Check whether --enable-cld was given.
if test "${enable_cld+set}" = set; then : if test "${enable_cld+set}" = set; then :
enableval=$enable_cld; enableval=$enable_cld;
...@@ -17094,7 +17108,7 @@ else ...@@ -17094,7 +17108,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 17097 "configure" #line 17111 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -17200,7 +17214,7 @@ else ...@@ -17200,7 +17214,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 17203 "configure" #line 17217 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
......
...@@ -1568,6 +1568,14 @@ AC_ARG_ENABLE(secureplt, ...@@ -1568,6 +1568,14 @@ AC_ARG_ENABLE(secureplt,
[ --enable-secureplt enable -msecure-plt by default for PowerPC], [ --enable-secureplt enable -msecure-plt by default for PowerPC],
[], []) [], [])
AC_ARG_ENABLE(leading-mingw64-underscores,
AS_HELP_STRING([--enable-leading-mingw64-underscores],
[Enable leading underscores on 64 bit mingw targets]),
[],[])
AS_IF([ test x"$enable_leading_mingw64_underscores" = xyes ],
[AC_DEFINE(USE_MINGW64_LEADING_UNDERSCORES, 1,
[Define if we should use leading underscore on 64 bit mingw targets])])
AC_ARG_ENABLE(cld, AC_ARG_ENABLE(cld,
[ --enable-cld enable -mcld by default for 32bit x86], [], [ --enable-cld enable -mcld by default for 32bit x86], [],
[enable_cld=no]) [enable_cld=no])
......
...@@ -32,6 +32,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -32,6 +32,10 @@ along with GCC; see the file COPYING3. If not see
#include "collect2.h" #include "collect2.h"
#include "libiberty.h" #include "libiberty.h"
/* TARGET_64BIT may be defined to use driver specific functionality. */
#undef TARGET_64BIT
#define TARGET_64BIT TARGET_64BIT_DEFAULT
#define MAX_ITERATIONS 17 #define MAX_ITERATIONS 17
/* Defined in the automatically-generated underscore.c. */ /* Defined in the automatically-generated underscore.c. */
......
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