Commit a6198222 by Rainer Orth Committed by Rainer Orth

configure.ac (gcc_cv_ld_sol2_emulation): Test for GNU ld *_sol2 linker emulations.

	* configure.ac (gcc_cv_ld_sol2_emulation): Test for GNU ld *_sol2
	linker emulations.
	* configure: Regenerate.
	* config.in: Regenerate.

	* config/i386/sol2-10.h [TARGET_GNU_LD] (I386_EMULATION): Define.
	(X86_64_EMULATION): Define.
	(TARGET_LD_EMULATION): Use them.

	* config/sparc/sol2-gld-bi.h (SPARC32_EMULATION): Define.
	(SPARC64_EMULATION): Define.
	(LINK_ARCH_SPEC): Use them.

From-SVN: r160178
parent b6b7f703
2010-06-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac (gcc_cv_ld_sol2_emulation): Test for GNU ld *_sol2
linker emulations.
* configure: Regenerate.
* config.in: Regenerate.
* config/i386/sol2-10.h [TARGET_GNU_LD] (I386_EMULATION): Define.
(X86_64_EMULATION): Define.
(TARGET_LD_EMULATION): Use them.
* config/sparc/sol2-gld-bi.h (SPARC32_EMULATION): Define.
(SPARC64_EMULATION): Define.
(LINK_ARCH_SPEC): Use them.
2010-06-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gcc_type_for_interval): Use
......
......@@ -1194,6 +1194,12 @@
#endif
/* Define if your linker supports the *_sol2 emulations. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_SOL2_EMULATION
#endif
/* Define if your linker supports -Bstatic/-Bdynamic option. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_STATIC_DYNAMIC
......
......@@ -120,7 +120,18 @@ along with GCC; see the file COPYING3. If not see
#define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
#ifdef TARGET_GNU_LD
#define TARGET_LD_EMULATION "%{m64:-m elf_x86_64}%{!m64:-m elf_i386} "
/* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly
follow the Solaris 2 ABI. Prefer them if present. */
#ifdef HAVE_LD_SOL2_EMULATION
#define I386_EMULATION "elf_i386_sol2"
#define X86_64_EMULATION "elf_x86_64_sol2"
#else
#define I386_EMULATION "elf_i386"
#define X86_64_EMULATION "elf_x86_64"
#endif
#define TARGET_LD_EMULATION "%{m64:-m " X86_64_EMULATION "}" \
"%{!m64:-m " I386_EMULATION "} "
#else
#define TARGET_LD_EMULATION ""
#endif
......
......@@ -32,25 +32,35 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LINK_ARCH64_SPEC \
LINK_ARCH64_SPEC_BASE "%{!static: -rpath-link %R/usr/lib/sparcv9}"
/* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly
follow the Solaris 2 ABI. Prefer them if present. */
#ifdef HAVE_LD_SOL2_EMULATION
#define SPARC32_EMULATION "elf32_sparc_sol2"
#define SPARC64_EMULATION "elf64_sparc_sol2"
#else
#define SPARC32_EMULATION "elf32_sparc"
#define SPARC64_EMULATION "elf64_sparc"
#endif
#undef LINK_ARCH_SPEC
#if DISABLE_MULTILIB
#if DEFAULT_ARCH32_P
#define LINK_ARCH_SPEC "\
%{m32:-m elf32_sparc %(link_arch32)} \
%{m32:-m " SPARC32_EMULATION " %(link_arch32)} \
%{m64:%edoes not support multilib} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
#else
#define LINK_ARCH_SPEC "\
%{m32:%edoes not support multilib} \
%{m64:-m elf64_sparc %(link_arch64)} \
%{m64:-m " SPARC64_EMULATION " %(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
#endif
#else
#define LINK_ARCH_SPEC "\
%{m32:-m elf32_sparc %(link_arch32)} \
%{m64:-m elf64_sparc %(link_arch64)} \
%{m32:-m " SPARC32_EMULATION " %(link_arch32)} \
%{m64:-m " SPARC64_EMULATION " %(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
#endif
......
......@@ -24893,6 +24893,36 @@ $as_echo "$as_me: WARNING: --build-id is not supported by your linker; --enable-
fi
fi
# In binutils 2.21, GNU ld gained support for new emulations fully
# supporting the Solaris 2 ABI. Detect their presence in the linker used.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker *_sol2 emulation support" >&5
$as_echo_n "checking linker *_sol2 emulation support... " >&6; }
if test "${gcc_cv_ld_sol2_emulation+set}" = set; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_ld_sol2_emulation=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a \
"$gcc_cv_gld_minor_version" -ge 21 -o \
"$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_sol2_emulation=yes
fi
elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld -V 2>/dev/null | sed -e '1,/Supported emulations/d;q' | \
grep _sol2 > /dev/null; then
gcc_cv_ld_sol2_emulation=yes
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_sol2_emulation" >&5
$as_echo "$gcc_cv_ld_sol2_emulation" >&6; }
if test x"$gcc_cv_ld_sol2_emulation" = xyes; then
$as_echo "#define HAVE_LD_SOL2_EMULATION 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --sysroot support" >&5
$as_echo_n "checking linker --sysroot support... " >&6; }
if test "${gcc_cv_ld_sysroot+set}" = set; then :
......
......@@ -4034,6 +4034,29 @@ if test x"$enable_linker_build_id" = xyes; then
fi
fi
# In binutils 2.21, GNU ld gained support for new emulations fully
# supporting the Solaris 2 ABI. Detect their presence in the linker used.
AC_CACHE_CHECK(linker *_sol2 emulation support,
gcc_cv_ld_sol2_emulation,
[gcc_cv_ld_sol2_emulation=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a \
"$gcc_cv_gld_minor_version" -ge 21 -o \
"$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_sol2_emulation=yes
fi
elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld -V 2>/dev/null | sed -e '1,/Supported emulations/d;q' | \
grep _sol2 > /dev/null; then
gcc_cv_ld_sol2_emulation=yes
fi
fi])
if test x"$gcc_cv_ld_sol2_emulation" = xyes; then
AC_DEFINE(HAVE_LD_SOL2_EMULATION, 1,
[Define if your linker supports the *_sol2 emulations.])
fi
AC_CACHE_CHECK(linker --sysroot support,
gcc_cv_ld_sysroot,
[gcc_cv_ld_sysroot=no
......
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