This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cft] configure tests for .hidden
On Tue, Apr 30, 2002 at 08:33:18PM -0400, Phil Edwards wrote:
> Debian adds a distro-vendor string, but leaves the date:
>
> 21% ld --version
> GNU ld version 2.12.90.0.1 20020307 Debian/GNU Linux
New patch.
r~
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.576.4.9
diff -c -p -d -r1.576.4.9 configure.in
*** configure.in 29 Apr 2002 15:20:52 -0000 1.576.4.9
--- configure.in 1 May 2002 00:38:33 -0000
*************** changequote([,])dnl
*** 1200,1205 ****
--- 1200,1206 ----
changequote(,)dnl
gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+ gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
changequote([,])dnl
fi
*************** AC_MSG_RESULT($gcc_cv_as_weak)
*** 1482,1488 ****
AC_MSG_CHECKING(assembler hidden support)
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
! if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
gcc_cv_as_hidden="yes"
fi
elif test x$gcc_cv_as != x; then
--- 1483,1495 ----
AC_MSG_CHECKING(assembler hidden support)
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
! if test "$gcc_cv_gas_major_version" -eq 2 \
! -a "$gcc_cv_gas_minor_version" -eq 12 \
! -a "$gcc_cv_gas_patch_version" -ge 1 \
! -o "$gcc_cv_gas_major_version" -eq 2 \
! -a "$gcc_cv_gas_minor_version" -gt 12 \
! -o "$gcc_cv_gas_major_version" -gt 2 \
! && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
gcc_cv_as_hidden="yes"
fi
elif test x$gcc_cv_as != x; then
*************** elif test x$gcc_cv_as != x; then
*** 1493,1585 ****
gcc_cv_as_hidden="yes"
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
- fi
! # Sparc binutils 2.12.0 has broken .hidden support in the linker.
! # I've no idea how to check for this non-native...
! if test x"$gcc_cv_as_hidden" = xyes \
! && test "$target" = "$host" \
! && test "$target" = "$build"; then
! case "$target" in
! sparc*-*-*)
! # Compiled from
! # void func1 (void) { }
! # void * func2 (void) { return (void *) func1; }
! # int main() { return func2() ? 0 : 1; }
! # asm(".hidden func1");
! # but we don't know what the bootstrap compiler is, whether
! # it can handle asm(), what the option for pic code is.
! # In addition, the code has been tweaked slightly to run in
! # both 32 and 64-bit mode.
! changequote(,)dnl
! cat > conftest.s <<'EOF'
! .section ".text"
! .align 4
! .global func1
! .type func1,#function
! .proc 020
! func1:
! retl
! nop
! .LLfe1:
! .size func1,.LLfe1-func1
! .align 4
! .LLGETPC0:
! retl
! add %o7,%l7,%l7
! .align 4
! .global func2
! .type func2,#function
! .proc 0120
! func2:
! save %sp, -192, %sp
! sethi %hi(func1), %o0
! sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
! call .LLGETPC0
! add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
! or %o0, %lo(func1), %o0
! ldn [%l7+%o0], %i0
! ret
! restore
! .LLfe2:
! .size func2,.LLfe2-func2
! .align 4
! .global main
! .type main,#function
! .proc 04
! main:
! !#PROLOGUE# 0
! save %sp, -192, %sp
! call func2, 0
! nop
! subcc %g0, %o0, %g0
! subx %g0, -1, %i0
! ret
! restore
! .LLfe3:
! .size main,.LLfe3-main
! .hidden func1
! EOF
! $gcc_cv_as -o conftest.o -KPIC conftest.s
! $CC -o conftest conftest.o -v 2> conftest-ld1
! if grep collect2 conftest-ld1 > conftest-ld2; then
! :
! elif grep /usr/ccs/bin/ld conftest-ld1 2> conftest-ld2; then
! :
! else
! AC_MSG_ERROR([internal error -- confused about linking])
! exit 1
! fi
! $gcc_cv_ld `sed 's/^ *[^ ]* //' conftest-ld2` > /dev/null 2>&1
! if (./conftest) >/dev/null 2>&1 ; then
! :
! else
! gcc_cv_as_hidden=no
fi
- rm -f conftest*
- changequote([,])dnl
- ;;
- esac
fi
if test x"$gcc_cv_as_hidden" = xyes; then
--- 1500,1516 ----
gcc_cv_as_hidden="yes"
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
! # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
! # This is irritatingly difficult to feature test for. Look for
! # the date string after the version number.
! ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
! if echo "$ld_ver" | grep GNU > /dev/null; then
! ld_date=`echo $ld_ver | sed 's/.* (20[0-9]*).*/\1/'`
! if test "$ld_date" -lt 20020404; then
! gcc_cv_as_hidden="no"
! fi
fi
fi
if test x"$gcc_cv_as_hidden" = xyes; then