* [PATCH 03/10] alpha: Define TLS_DTV_UNALLOCATED.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 4:29 ` [PATCH 06/10] alpha: Convert to crt[in].S Richard Henderson
` (9 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 2 ++
sysdeps/alpha/dl-tls.h | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index a1732f9..ae6839d 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/alpha/dl-tls.h (TLS_DTV_UNALLOCATED): New.
+
* sysdeps/unix/sysv/linux/alpha/configure.in: New file.
* sysdeps/unix/sysv/linux/alpha/configure: Build.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h: Protect from
diff --git a/sysdeps/alpha/dl-tls.h b/sysdeps/alpha/dl-tls.h
index f81f95d..d40d0a4 100644
--- a/sysdeps/alpha/dl-tls.h
+++ b/sysdeps/alpha/dl-tls.h
@@ -25,5 +25,7 @@ typedef struct
unsigned long int ti_offset;
} tls_index;
-
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 06/10] alpha: Convert to crt[in].S.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
2012-02-09 4:29 ` [PATCH 03/10] alpha: Define TLS_DTV_UNALLOCATED Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 4:29 ` [PATCH 01/10] alpha: Remove HAVE_TLS_SUPPORT and HAVE___THREAD tests Richard Henderson
` (8 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
A particularly trivial conversion, since we were already using
assembler, smuggled inside the C file.
---
ChangeLog.alpha | 4 +
sysdeps/alpha/elf/crti.S | 100 ++++++++++++++++++++++++++++++
sysdeps/alpha/elf/crtn.S | 50 +++++++++++++++
sysdeps/alpha/elf/initfini.c | 110 ----------------------------------
sysdeps/alpha/nptl/elf/pt-initfini.c | 89 ---------------------------
5 files changed, 154 insertions(+), 199 deletions(-)
create mode 100644 sysdeps/alpha/elf/crti.S
create mode 100644 sysdeps/alpha/elf/crtn.S
delete mode 100644 sysdeps/alpha/elf/initfini.c
delete mode 100644 sysdeps/alpha/nptl/elf/pt-initfini.c
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 42e3c85..e76205d 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,9 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/alpha/elf/crti.S, sysdeps/alpha/elf/crtn.S: New files...
+ * sysdeps/alpha/elf/initfini.c: ... split from here. Remove file.
+ * sysdeps/alpha/nptl/elf/pt-initfini.c: Remove file.
+
* sysdeps/unix/alpha/sysdep.h (INTERNAL_SYSCALL_DECL): Mark unused.
* sysdeps/unix/sysv/linux/alpha/bits/stat.h (_STAT_VER_LINUX): New.
diff --git a/sysdeps/alpha/elf/crti.S b/sysdeps/alpha/elf/crti.S
new file mode 100644
index 0000000..b5989bf
--- /dev/null
+++ b/sysdeps/alpha/elf/crti.S
@@ -0,0 +1,100 @@
+/* Special .init and .fini section support for Alpha.
+ Copyright (C) 2001, 2002, 2003, 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* crti.S puts a function prologue at the beginning of the .init and
+ .fini sections and defines global symbols for those addresses, so
+ they can be called as functions. The symbols _init and _fini are
+ magic and cause the linker to emit DT_INIT and DT_FINI.
+
+ This differs from what would be generated for ordinary code in that
+ we save and restore the GP within the function. In order for linker
+ relaxation to work, the value in the GP register on exit from a function
+ must be valid for the function entry point. Normally, a function is
+ contained within one object file and this is not an issue, provided
+ that the function reloads the gp after making any function calls.
+ However, _init and _fini are constructed from pieces of many object
+ files, all of which may have different GP values. So we must reload
+ the GP value from crti.o in crtn.o. */
+
+#include <libc-symbols.h>
+#include <sysdep.h>
+
+#ifndef PREINIT_FUNCTION
+# define PREINIT_FUNCTION __gmon_start__
+#endif
+
+#ifndef PREINIT_FUNCTION_WEAK
+# define PREINIT_FUNCTION_WEAK 1
+#endif
+
+#if PREINIT_FUNCTION_WEAK
+ weak_extern (PREINIT_FUNCTION)
+#else
+ .hidden PREINIT_FUNCTION
+#endif
+
+ .section .init, "ax", @progbits
+ .globl _init
+ .type _init, @function
+ .usepv _init, std
+_init:
+ ldgp $29, 0($27)
+ subq $30, 16, $30
+#if PREINIT_FUNCTION_WEAK
+ lda $27, PREINIT_FUNCTION
+#endif
+ stq $26, 0($30)
+ stq $29, 8($30)
+#if PREINIT_FUNCTION_WEAK
+ beq $27, 1f
+ jsr $26, ($27), PREINIT_FUNCTION
+ ldq $29, 8($30)
+1:
+#else
+ bsr $26, PREINIT_FUNCTION !samegp
+#endif
+ .p2align 3
+
+ .section .fini, "ax", @progbits
+ .globl _fini
+ .type _fini,@function
+ .usepv _fini,std
+_fini:
+ ldgp $29, 0($27)
+ subq $30, 16, $30
+ stq $26, 0($30)
+ stq $29, 8($30)
+ .p2align 3
diff --git a/sysdeps/alpha/elf/crtn.S b/sysdeps/alpha/elf/crtn.S
new file mode 100644
index 0000000..50e772f
--- /dev/null
+++ b/sysdeps/alpha/elf/crtn.S
@@ -0,0 +1,50 @@
+/* Special .init and .fini section support for Alpha.
+ Copyright (C) 2001, 2002, 2003, 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* crtn.S puts function epilogues in the .init and .fini sections
+ corresponding to the prologues in crti.S. */
+
+ .section .init, "ax", @progbits
+ ldq $26, 0($30)
+ ldq $29, 8($30)
+ addq $30, 16, $30
+ ret
+
+ .section .fini, "ax", @progbits
+ ldq $26, 0($30)
+ ldq $29, 8($30)
+ addq $30, 16, $30
+ ret
diff --git a/sysdeps/alpha/elf/initfini.c b/sysdeps/alpha/elf/initfini.c
deleted file mode 100644
index 4d3342d..0000000
--- a/sysdeps/alpha/elf/initfini.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Special .init and .fini section support for Alpha.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* This file is compiled into assembly code which is then munged by a sed
- script into two files: crti.s and crtn.s.
-
- * crti.s puts a function prologue at the beginning of the .init and .fini
- sections and defines global symbols for those addresses, so they can be
- called as functions.
-
- * crtn.s puts the corresponding function epilogues in the .init and .fini
- sections.
-
- This differs from what would be generated by the generic code in that
- we save and restore the GP within the function. In order for linker
- relaxation to work, the value in the GP register on exit from a function
- must be valid for the function entry point. Normally, a function is
- contained within one object file and this is not an issue, provided
- that the function reloads the gp after making any function calls.
- However, _init and _fini are constructed from pieces of many object
- files, all of which may have different GP values. So we must reload
- the GP value from crti.o in crtn.o. */
-
-__asm__ (" \n\
-#include \"defs.h\" \n\
- \n\
-/*@HEADER_ENDS*/ \n\
- \n\
-/*@_init_PROLOG_BEGINS*/ \n\
- .section .init, \"ax\", @progbits \n\
- .globl _init \n\
- .type _init, @function \n\
- .usepv _init, std \n\
-_init: \n\
- ldgp $29, 0($27) \n\
- subq $30, 16, $30 \n\
- lda $27, __gmon_start__ \n\
- stq $26, 0($30) \n\
- stq $29, 8($30) \n\
- beq $27, 1f \n\
- jsr $26, ($27), __gmon_start__ \n\
- ldq $29, 8($30) \n\
- .align 3 \n\
-1: \n\
-/*@_init_PROLOG_ENDS*/ \n\
- \n\
-/*@_init_EPILOG_BEGINS*/ \n\
- .section .init, \"ax\", @progbits \n\
- ldq $26, 0($30) \n\
- ldq $29, 8($30) \n\
- addq $30, 16, $30 \n\
- ret \n\
-/*@_init_EPILOG_ENDS*/ \n\
- \n\
-/*@_fini_PROLOG_BEGINS*/ \n\
- .section .fini, \"ax\", @progbits \n\
- .globl _fini \n\
- .type _fini,@function \n\
- .usepv _fini,std \n\
-_fini: \n\
- ldgp $29, 0($27) \n\
- subq $30, 16, $30 \n\
- stq $26, 0($30) \n\
- stq $29, 8($30) \n\
- .align 3 \n\
-/*@_fini_PROLOG_ENDS*/ \n\
- \n\
-/*@_fini_EPILOG_BEGINS*/ \n\
- .section .fini, \"ax\", @progbits \n\
- ldq $26, 0($30) \n\
- ldq $29, 8($30) \n\
- addq $30, 16, $30 \n\
- ret \n\
-/*@_fini_EPILOG_ENDS*/ \n\
- \n\
-/*@TRAILER_BEGINS*/ \n\
-");
diff --git a/sysdeps/alpha/nptl/elf/pt-initfini.c b/sysdeps/alpha/nptl/elf/pt-initfini.c
deleted file mode 100644
index ba2e419..0000000
--- a/sysdeps/alpha/nptl/elf/pt-initfini.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Special .init and .fini section support for Alpha. NPTL version.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* This file is compiled into assembly code which is then munged by a sed
- script into two files: crti.s and crtn.s.
-
- * crti.s puts a function prologue at the beginning of the .init and .fini
- sections and defines global symbols for those addresses, so they can be
- called as functions.
-
- * crtn.s puts the corresponding function epilogues in the .init and .fini
- sections.
-
- This differs from what would be generated by the generic code in that
- we save and restore the GP within the function. In order for linker
- relaxation to work, the value in the GP register on exit from a function
- must be valid for the function entry point. Normally, a function is
- contained within one object file and this is not an issue, provided
- that the function reloads the gp after making any function calls.
- However, _init and _fini are constructed from pieces of many object
- files, all of which may have different GP values. So we must reload
- the GP value from crti.o in crtn.o. */
-
-__asm__ (" \n\
-#include \"defs.h\" \n\
- \n\
-/*@HEADER_ENDS*/ \n\
- \n\
-/*@_init_PROLOG_BEGINS*/ \n\
- .section .init, \"ax\", @progbits \n\
- .globl _init \n\
- .type _init,@function \n\
- .usepv _init,std \n\
-_init: \n\
- ldgp $29, 0($27) \n\
- subq $30, 16, $30 \n\
- stq $26, 0($30) \n\
- stq $29, 8($30) \n\
- bsr $26, __pthread_initialize_minimal_internal !samegp \n\
- .align 3 \n\
-/*@_init_PROLOG_ENDS*/ \n\
- \n\
-/*@_init_EPILOG_BEGINS*/ \n\
- .section .init, \"ax\", @progbits \n\
- ldq $26, 0($30) \n\
- ldq $29, 8($30) \n\
- addq $30, 16, $30 \n\
- ret \n\
-/*@_init_EPILOG_ENDS*/ \n\
- \n\
-/*@_fini_PROLOG_BEGINS*/ \n\
- .section .fini, \"ax\", @progbits \n\
- .globl _fini \n\
- .type _fini,@function \n\
- .usepv _fini,std \n\
-_fini: \n\
- ldgp $29, 0($27) \n\
- subq $30, 16, $30 \n\
- stq $26, 0($30) \n\
- stq $29, 8($30) \n\
- .align 3 \n\
-/*@_fini_PROLOG_ENDS*/ \n\
- \n\
-/*@_fini_EPILOG_BEGINS*/ \n\
- .section .fini, \"ax\", @progbits \n\
- ldq $26, 0($30) \n\
- ldq $29, 8($30) \n\
- addq $30, 16, $30 \n\
- ret \n\
-/*@_fini_EPILOG_ENDS*/ \n\
- \n\
-/*@TRAILER_BEGINS*/ \n\
-");
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 01/10] alpha: Remove HAVE_TLS_SUPPORT and HAVE___THREAD tests.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
2012-02-09 4:29 ` [PATCH 03/10] alpha: Define TLS_DTV_UNALLOCATED Richard Henderson
2012-02-09 4:29 ` [PATCH 06/10] alpha: Convert to crt[in].S Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 4:29 ` [PATCH 04/10] alpha: Define _STAT_VER_LINUX Richard Henderson
` (7 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 8 +++
sysdeps/alpha/elf/configure | 122 ++++++++++++++++++++++++++++++++--------
sysdeps/alpha/elf/configure.in | 9 +--
sysdeps/alpha/nptl/tls.h | 16 +----
sysdeps/unix/alpha/sysdep.h | 64 +++++++--------------
5 files changed, 132 insertions(+), 87 deletions(-)
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index b011d3c..9c304d7 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,3 +1,11 @@
+2012-02-08 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/alpha/nptl/tls.h: Don't test HAVE_TLS_SUPPORT.
+ * sysdeps/unix/alpha/sysdep.h: Don't test HAVE___THREAD.
+ * sysdeps/alpha/elf/configure.in (libc_cv_alpha_tls): Error out if
+ the test fails. Don't set HAVE_TLS_SUPPORT.
+ * sysdeps/alpha/elf/configure: Rebuild.
+
2012-01-07 Joseph Myers <joseph@codesourcery.com>
* sysdeps/alpha/backtrace.c: Use x86_64 version of backtrace.c.
diff --git a/sysdeps/alpha/elf/configure b/sysdeps/alpha/elf/configure
index 1d594dc..5da9875 100644
--- a/sysdeps/alpha/elf/configure
+++ b/sysdeps/alpha/elf/configure
@@ -1,12 +1,92 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/alpha/elf.
-if test "$usetls" != no; then
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:$LINENO: checking for Alpha TLS support" >&5
+# Check for support of thread-local storage handling in assembler and linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Alpha TLS support" >&5
$as_echo_n "checking for Alpha TLS support... " >&6; }
-if test "${libc_cv_alpha_tls+set}" = set; then
+if ${libc_cv_alpha_tls+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.s <<\EOF
@@ -44,30 +124,26 @@ baz:
lda $16, n($31) !tprel
EOF
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
libc_cv_alpha_tls=yes
else
libc_cv_alpha_tls=no
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_alpha_tls" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_tls" >&5
$as_echo "$libc_cv_alpha_tls" >&6; }
-if test $libc_cv_alpha_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_alpha_tls = no; then
+ as_fn_error $? "the assembler must support TLS" "$LINENO" 5
fi
-{ $as_echo "$as_me:$LINENO: checking for GP relative module local relocs" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GP relative module local relocs" >&5
$as_echo_n "checking for GP relative module local relocs... " >&6; }
-if test "${libc_cv_alpha_hidden_gprel+set}" = set; then
+if ${libc_cv_alpha_hidden_gprel+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.c <<\EOF
@@ -78,11 +154,11 @@ EOF
libc_cv_alpha_hidden_gprel=no
if { ac_try='${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&5'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
if grep -q 'bar.*!gprel' conftest.s \
&& grep -q 'baz.*!gprel' conftest.s \
&& ! grep -q 'bar.*!literal' conftest.s \
@@ -92,11 +168,9 @@ if { ac_try='${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&5'
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_alpha_hidden_gprel" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_hidden_gprel" >&5
$as_echo "$libc_cv_alpha_hidden_gprel" >&6; }
if test $libc_cv_alpha_hidden_gprel = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define PI_STATIC_AND_HIDDEN 1
-_ACEOF
+ $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
fi
diff --git a/sysdeps/alpha/elf/configure.in b/sysdeps/alpha/elf/configure.in
index 3a47934..75fff53 100644
--- a/sysdeps/alpha/elf/configure.in
+++ b/sysdeps/alpha/elf/configure.in
@@ -1,9 +1,7 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/alpha/elf.
-if test "$usetls" != no; then
-# Check for support of thread-local storage handling in assembler and
-# linker.
+# Check for support of thread-local storage handling in assembler and linker.
AC_CACHE_CHECK(for Alpha TLS support, libc_cv_alpha_tls, [dnl
cat > conftest.s <<\EOF
.section ".tdata", "awT", @progbits
@@ -46,9 +44,8 @@ else
libc_cv_alpha_tls=no
fi
rm -f conftest*])
-if test $libc_cv_alpha_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_alpha_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
AC_CACHE_CHECK(for GP relative module local relocs, libc_cv_alpha_hidden_gprel, [dnl
diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index e77b1ff..887a457 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/Alpha version.
- Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,18 +38,6 @@ typedef union dtv
} pointer;
} dtv_t;
-#else /* __ASSEMBLER__ */
-# include <tcb-offsets.h>
-#endif /* __ASSEMBLER__ */
-
-
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
-#ifndef __ASSEMBLER__
-
/* Get system call information. */
# include <sysdep.h>
@@ -144,6 +132,8 @@ typedef struct
#define THREAD_GSCOPE_WAIT() \
GL(dl_wait_lookup_done) ()
+#else /* __ASSEMBLER__ */
+# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
#endif /* tls.h */
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index d9009c1..64add9e 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -200,39 +200,19 @@ __LABEL(name) \
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
"$22", "$23", "$24", "$25", "$27", "$28", "memory"
-/* If TLS is in use, we have a conflict between the PAL_rduniq primitive,
- as modeled within GCC, and explicit use of the R0 register. If we use
- the register via the asm, the scheduler may place the PAL_rduniq insn
- before we've copied the data from R0 into _sc_ret. If this happens
- we'll get a reload abort, since R0 is live at the same time it is
- needed for the PAL_rduniq.
-
- Solve this by using the "v" constraint instead of an asm for the syscall
- output. We don't do this unconditionally to allow compilation with
- older compilers. */
-
-#ifdef HAVE___THREAD
-#define inline_syscall_r0_asm
-#define inline_syscall_r0_out_constraint "=v"
-#else
-#define inline_syscall_r0_asm __asm__("$0")
-#define inline_syscall_r0_out_constraint "=r"
-#endif
-
/* It is moderately important optimization-wise to limit the lifetime
of the hard-register variables as much as possible. Thus we copy
in/out as close to the asm as possible. */
#define inline_syscall0(name, args...) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = name; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19) \
+ : "=v"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0) \
: inline_syscall_clobbers, \
"$16", "$17", "$18", "$20", "$21"); \
@@ -241,7 +221,7 @@ __LABEL(name) \
#define inline_syscall1(name,arg1) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_19 __asm__("$19"); \
register long _tmp_16 = (long) (arg1); \
@@ -250,8 +230,7 @@ __LABEL(name) \
_sc_16 = _tmp_16; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16) \
+ : "=v"(_sc_0), "=r"(_sc_19), "=r"(_sc_16) \
: "0"(_sc_0), "2"(_sc_16) \
: inline_syscall_clobbers, \
"$17", "$18", "$20", "$21"); \
@@ -260,7 +239,7 @@ __LABEL(name) \
#define inline_syscall2(name,arg1,arg2) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_19 __asm__("$19"); \
@@ -272,8 +251,8 @@ __LABEL(name) \
_sc_17 = _tmp_17; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3 %4" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17) \
+ : "=v"(_sc_0), "=r"(_sc_19), \
+ "=r"(_sc_16), "=r"(_sc_17) \
: "0"(_sc_0), "2"(_sc_16), "3"(_sc_17) \
: inline_syscall_clobbers, \
"$18", "$20", "$21"); \
@@ -282,7 +261,7 @@ __LABEL(name) \
#define inline_syscall3(name,arg1,arg2,arg3) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
@@ -297,9 +276,8 @@ __LABEL(name) \
_sc_18 = _tmp_18; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3 %4 %5" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
- "=r"(_sc_18) \
+ : "=v"(_sc_0), "=r"(_sc_19), "=r"(_sc_16), \
+ "=r"(_sc_17), "=r"(_sc_18) \
: "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
"4"(_sc_18) \
: inline_syscall_clobbers, "$20", "$21"); \
@@ -308,7 +286,7 @@ __LABEL(name) \
#define inline_syscall4(name,arg1,arg2,arg3,arg4) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
@@ -325,9 +303,8 @@ __LABEL(name) \
_sc_19 = _tmp_19; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3 %4 %5 %6" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
- "=r"(_sc_18) \
+ : "=v"(_sc_0), "=r"(_sc_19), "=r"(_sc_16), \
+ "=r"(_sc_17), "=r"(_sc_18) \
: "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
"4"(_sc_18), "1"(_sc_19) \
: inline_syscall_clobbers, "$20", "$21"); \
@@ -336,7 +313,7 @@ __LABEL(name) \
#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
@@ -356,9 +333,8 @@ __LABEL(name) \
_sc_20 = _tmp_20; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
- "=r"(_sc_18), "=r"(_sc_20) \
+ : "=v"(_sc_0), "=r"(_sc_19), "=r"(_sc_16), \
+ "=r"(_sc_17), "=r"(_sc_18), "=r"(_sc_20) \
: "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
"4"(_sc_18), "1"(_sc_19), "5"(_sc_20) \
: inline_syscall_clobbers, "$21"); \
@@ -367,7 +343,7 @@ __LABEL(name) \
#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
{ \
- register long _sc_0 inline_syscall_r0_asm; \
+ register long _sc_0; \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
@@ -390,9 +366,9 @@ __LABEL(name) \
_sc_21 = _tmp_21; \
__asm__ __volatile__ \
("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8" \
- : inline_syscall_r0_out_constraint (_sc_0), \
- "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
- "=r"(_sc_18), "=r"(_sc_20), "=r"(_sc_21) \
+ : "=v"(_sc_0), "=r"(_sc_19), "=r"(_sc_16), \
+ "=r"(_sc_17), "=r"(_sc_18), "=r"(_sc_20), \
+ "=r"(_sc_21) \
: "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), "4"(_sc_18), \
"1"(_sc_19), "5"(_sc_20), "6"(_sc_21) \
: inline_syscall_clobbers); \
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 04/10] alpha: Define _STAT_VER_LINUX.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (2 preceding siblings ...)
2012-02-09 4:29 ` [PATCH 01/10] alpha: Remove HAVE_TLS_SUPPORT and HAVE___THREAD tests Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 17:52 ` Richard Henderson
2012-02-09 4:29 ` [PATCH 02/10] alpha: Require kernel version 2.6.0 Richard Henderson
` (6 subsequent siblings)
10 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 2 ++
sysdeps/unix/sysv/linux/alpha/bits/stat.h | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index ae6839d..afcf75a 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/unix/sysv/linux/alpha/bits/stat.h (_STAT_VER_LINUX): New.
+
* sysdeps/alpha/dl-tls.h (TLS_DTV_UNALLOCATED): New.
* sysdeps/unix/sysv/linux/alpha/configure.in: New file.
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index d7241bd..e70e836 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2010
+/* Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2010,2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -30,7 +30,8 @@
#define _STAT_VER_GLIBC2_1 2
#define _STAT_VER_KERNEL64 3
#define _STAT_VER_GLIBC2_3_4 3
-#define _STAT_VER _STAT_VER_GLIBC2_3_4
+#define _STAT_VER_LINUX 3
+#define _STAT_VER _STAT_VER_LINUX
/* Versions of the `xmknod' interface. */
#define _MKNOD_VER_LINUX 0
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 04/10] alpha: Define _STAT_VER_LINUX.
2012-02-09 4:29 ` [PATCH 04/10] alpha: Define _STAT_VER_LINUX Richard Henderson
@ 2012-02-09 17:52 ` Richard Henderson
2012-02-13 2:43 ` Carlos O'Donell
0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 17:52 UTC (permalink / raw)
To: libc-ports
On 02/08/2012 08:28 PM, Richard Henderson wrote:
> -#define _STAT_VER _STAT_VER_GLIBC2_3_4
> +#define _STAT_VER_LINUX 3
> +#define _STAT_VER _STAT_VER_LINUX
I meant to note for the record that I actually think that this is
a bug in the generic bits of sysdeps/unix/sysv/linux/ in that they
ought to be testing _STAT_VER and not _STAT_VER_LINUX.
But this is a cheap out for me to avoid that drama.
r~
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 04/10] alpha: Define _STAT_VER_LINUX.
2012-02-09 17:52 ` Richard Henderson
@ 2012-02-13 2:43 ` Carlos O'Donell
0 siblings, 0 replies; 14+ messages in thread
From: Carlos O'Donell @ 2012-02-13 2:43 UTC (permalink / raw)
To: Richard Henderson; +Cc: libc-ports
On Thu, Feb 9, 2012 at 12:52 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 02/08/2012 08:28 PM, Richard Henderson wrote:
>> -#define _STAT_VER _STAT_VER_GLIBC2_3_4
>> +#define _STAT_VER_LINUX 3
>> +#define _STAT_VER _STAT_VER_LINUX
>
> I meant to note for the record that I actually think that this is
> a bug in the generic bits of sysdeps/unix/sysv/linux/ in that they
> ought to be testing _STAT_VER and not _STAT_VER_LINUX.
>
> But this is a cheap out for me to avoid that drama.
File a bug for it so we don't forget? We'll fit it for you :-)
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 02/10] alpha: Require kernel version 2.6.0.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (3 preceding siblings ...)
2012-02-09 4:29 ` [PATCH 04/10] alpha: Define _STAT_VER_LINUX Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 4:29 ` [PATCH 05/10] alpha: Eliminate set-but-not-used warnings with internal syscalls Richard Henderson
` (5 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
The minimum version that supports TLS. Also avoids having to
fix the build for ancient __ASSUME_* settings.
---
ChangeLog.alpha | 5 +++++
sysdeps/unix/sysv/linux/alpha/configure | 8 ++++++++
sysdeps/unix/sysv/linux/alpha/configure.in | 8 ++++++++
sysdeps/unix/sysv/linux/alpha/kernel-features.h | 9 +++++++++
4 files changed, 30 insertions(+), 0 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/alpha/configure
create mode 100644 sysdeps/unix/sysv/linux/alpha/configure.in
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 9c304d7..a1732f9 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,10 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/unix/sysv/linux/alpha/configure.in: New file.
+ * sysdeps/unix/sysv/linux/alpha/configure: Build.
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h: Protect from
+ multiple includes. Disable statfs64 entirely.
+
* sysdeps/alpha/nptl/tls.h: Don't test HAVE_TLS_SUPPORT.
* sysdeps/unix/alpha/sysdep.h: Don't test HAVE___THREAD.
* sysdeps/alpha/elf/configure.in (libc_cv_alpha_tls): Error out if
diff --git a/sysdeps/unix/sysv/linux/alpha/configure b/sysdeps/unix/sysv/linux/alpha/configure
new file mode 100644
index 0000000..80528ee
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/configure
@@ -0,0 +1,8 @@
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/alpha
+
+# There are several bits that no longer compile cleanly without
+# realtime signal support (ver 2.2.0). Given that we also now
+# require TLS (ver 2.6.0), it seems pointless to fix them.
+# ??? Surely this should now be the generic default.
+arch_minimum_kernel=2.6.0
diff --git a/sysdeps/unix/sysv/linux/alpha/configure.in b/sysdeps/unix/sysv/linux/alpha/configure.in
new file mode 100644
index 0000000..7136b85
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/configure.in
@@ -0,0 +1,8 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/alpha
+
+# There are several bits that no longer compile cleanly without
+# realtime signal support (ver 2.2.0). Given that we also now
+# require TLS (ver 2.6.0), it seems pointless to fix them.
+# ??? Surely this should now be the generic default.
+arch_minimum_kernel=2.6.0
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index 9c640f9..ce4d160 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -18,6 +18,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#ifndef _KERNEL_FEATURES_H
+#define _KERNEL_FEATURES_H 1
+
/* alpha switched to a 64-bit timeval sometime before 2.2.0. */
#if __LINUX_KERNEL_VERSION >= 131584
# define __ASSUME_TIMEVAL64 1
@@ -96,3 +99,9 @@
#if __LINUX_KERNEL_VERSION < 0x020621
# undef __ASSUME_FALLOCATE
#endif
+
+/* There never has been support for fstat64. */
+#undef __ASSUME_STATFS64
+#define __ASSUME_STATFS64 0
+
+#endif /* _KERNEL_FEATURES_H */
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 05/10] alpha: Eliminate set-but-not-used warnings with internal syscalls.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (4 preceding siblings ...)
2012-02-09 4:29 ` [PATCH 02/10] alpha: Require kernel version 2.6.0 Richard Henderson
@ 2012-02-09 4:29 ` Richard Henderson
2012-02-09 4:35 ` [PATCH 09/10] alpha: Add tls-macros.h Richard Henderson
` (4 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:29 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 2 ++
sysdeps/unix/alpha/sysdep.h | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index afcf75a..42e3c85 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/unix/alpha/sysdep.h (INTERNAL_SYSCALL_DECL): Mark unused.
+
* sysdeps/unix/sysv/linux/alpha/bits/stat.h (_STAT_VER_LINUX): New.
* sysdeps/alpha/dl-tls.h (TLS_DTV_UNALLOCATED): New.
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 64add9e..224c95d 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -190,7 +190,9 @@ __LABEL(name) \
_sc_ret; \
})
-#define INTERNAL_SYSCALL_DECL(err) long int err
+#define INTERNAL_SYSCALL_DECL(err) \
+ long int err __attribute__((unused))
+
/* Make sure and "use" the variable that we're not returning,
in order to suppress unused variable warnings. */
#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void)val, err)
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 09/10] alpha: Add tls-macros.h.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (5 preceding siblings ...)
2012-02-09 4:29 ` [PATCH 05/10] alpha: Eliminate set-but-not-used warnings with internal syscalls Richard Henderson
@ 2012-02-09 4:35 ` Richard Henderson
2012-02-09 4:35 ` [PATCH 10/10] alpha: Add ldsodefs.h and tst-audit.h Richard Henderson
` (3 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:35 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 2 ++
sysdeps/alpha/tls-macros.h | 25 +++++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
create mode 100644 sysdeps/alpha/tls-macros.h
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 8ade582..804dd64 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/alpha/tls-macros.h: New file.
+
* sysdeps/unix/sysv/linux/alpha/getitimer.S: Don't check HAVE_ELF.
* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
diff --git a/sysdeps/alpha/tls-macros.h b/sysdeps/alpha/tls-macros.h
new file mode 100644
index 0000000..0385d93
--- /dev/null
+++ b/sysdeps/alpha/tls-macros.h
@@ -0,0 +1,25 @@
+/* Macros to support TLS testing in times of missing compiler support. */
+
+extern void *__tls_get_addr (void *);
+
+# define TLS_GD(x) \
+ ({ void *__result; \
+ asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result)); \
+ __tls_get_addr (__result); })
+
+# define TLS_LD(x) \
+ ({ void *__result; \
+ asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result)); \
+ __result = __tls_get_addr (__result); \
+ asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result)); \
+ __result; })
+
+# define TLS_IE(x) \
+ ({ long ofs; \
+ asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs)); \
+ __builtin_thread_pointer () + ofs; })
+
+# define TLS_LE(x) \
+ ({ void *__result = __builtin_thread_pointer (); \
+ asm ("lda %0, " #x "(%0) !tprel" : "+r" (__result)); \
+ __result; })
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 10/10] alpha: Add ldsodefs.h and tst-audit.h.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (6 preceding siblings ...)
2012-02-09 4:35 ` [PATCH 09/10] alpha: Add tls-macros.h Richard Henderson
@ 2012-02-09 4:35 ` Richard Henderson
2012-02-09 4:35 ` [PATCH 08/10] alpha: Remove HAVE_ELF tests Richard Henderson
` (2 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:35 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 2 ++
sysdeps/alpha/ldsodefs.h | 43 +++++++++++++++++++++++++++++++++++++++++++
sysdeps/alpha/tst-audit.h | 24 ++++++++++++++++++++++++
3 files changed, 69 insertions(+), 0 deletions(-)
create mode 100644 sysdeps/alpha/ldsodefs.h
create mode 100644 sysdeps/alpha/tst-audit.h
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 804dd64..b82edba 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/alpha/ldsodefs.h: New file.
+ * sysdeps/alpha/tst-audit.h: New file.
* sysdeps/alpha/tls-macros.h: New file.
* sysdeps/unix/sysv/linux/alpha/getitimer.S: Don't check HAVE_ELF.
diff --git a/sysdeps/alpha/ldsodefs.h b/sysdeps/alpha/ldsodefs.h
new file mode 100644
index 0000000..a059cb1
--- /dev/null
+++ b/sysdeps/alpha/ldsodefs.h
@@ -0,0 +1,43 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __LDSODEFS_H
+
+#include <elf.h>
+
+struct La_alpha_regs;
+struct La_alpha_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf64_Addr (*alpha_gnu_pltenter) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_alpha_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep);
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*alpha_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_alpha_regs *, \
+ struct La_alpha_retval *, \
+ const char *);
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/sysdeps/alpha/tst-audit.h b/sysdeps/alpha/tst-audit.h
new file mode 100644
index 0000000..3bc50fa
--- /dev/null
+++ b/sysdeps/alpha/tst-audit.h
@@ -0,0 +1,24 @@
+/* Definitions for testing PLT entry/exit auditing. Alpha version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define pltenter la_alpha_gnu_pltenter
+#define pltexit la_alpha_gnu_pltexit
+#define La_regs La_alpha_regs
+#define La_retval La_alpha_retval
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 08/10] alpha: Remove HAVE_ELF tests.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (7 preceding siblings ...)
2012-02-09 4:35 ` [PATCH 10/10] alpha: Add ldsodefs.h and tst-audit.h Richard Henderson
@ 2012-02-09 4:35 ` Richard Henderson
2012-02-09 4:36 ` [PATCH 07/10] alpha: Support __NR_fstatat64 Richard Henderson
2012-02-09 19:04 ` [PATCH 00/10] Alpha compilation fixes Roland McGrath
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:35 UTC (permalink / raw)
To: libc-ports
---
ChangeLog.alpha | 9 +++++++++
sysdeps/unix/sysv/linux/alpha/getitimer.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/getrusage.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/gettimeofday.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/select.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/setitimer.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/settimeofday.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/utimes.S | 6 +++---
sysdeps/unix/sysv/linux/alpha/wait4.S | 6 +++---
9 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index e76205d..8ade582 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,14 @@
2012-02-08 Richard Henderson <rth@twiddle.net>
+ * sysdeps/unix/sysv/linux/alpha/getitimer.S: Don't check HAVE_ELF.
+ * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.
+
* sysdeps/alpha/elf/crti.S, sysdeps/alpha/elf/crtn.S: New files...
* sysdeps/alpha/elf/initfini.c: ... split from here. Remove file.
* sysdeps/alpha/nptl/elf/pt-initfini.c: Remove file.
diff --git a/sysdeps/unix/sysv/linux/alpha/getitimer.S b/sysdeps/unix/sysv/linux/alpha/getitimer.S
index 6644a5c..c29b3bd 100644
--- a/sysdeps/unix/sysv/linux/alpha/getitimer.S
+++ b/sysdeps/unix/sysv/linux/alpha/getitimer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define GETITIMER __getitimer_tv64
#else
#define GETITIMER getitimer
@@ -108,6 +108,6 @@ $error:
END(GETITIMER)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__getitimer_tv64, getitimer, GLIBC_2.1)
#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/getrusage.S b/sysdeps/unix/sysv/linux/alpha/getrusage.S
index 0bca4b5..2516ab0 100644
--- a/sysdeps/unix/sysv/linux/alpha/getrusage.S
+++ b/sysdeps/unix/sysv/linux/alpha/getrusage.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define GETRUSAGE __getrusage_tv64
#else
#define GETRUSAGE __getrusage
@@ -140,7 +140,7 @@ $error:
END(GETRUSAGE)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
strong_alias(__getrusage_tv64, ____getrusage_tv64)
default_symbol_version (____getrusage_tv64, __getrusage, GLIBC_2.1)
default_symbol_version (__getrusage_tv64, getrusage, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
index 7c9183a..2910830 100644
--- a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
+++ b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2002, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2002, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define GETTIMEOFDAY __gettimeofday_tv64
#else
#define GETTIMEOFDAY __gettimeofday
@@ -106,7 +106,7 @@ $error:
END(GETTIMEOFDAY)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__gettimeofday_tv64, __gettimeofday, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
diff --git a/sysdeps/unix/sysv/linux/alpha/select.S b/sysdeps/unix/sysv/linux/alpha/select.S
index 35a81e9..94f209b 100644
--- a/sysdeps/unix/sysv/linux/alpha/select.S
+++ b/sysdeps/unix/sysv/linux/alpha/select.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2002,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2002,2003,2006,2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define SELECT __select_tv64
#else
#define SELECT __select
@@ -224,7 +224,7 @@ $error:
END(SELECT)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__select_tv64, __select, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
diff --git a/sysdeps/unix/sysv/linux/alpha/setitimer.S b/sysdeps/unix/sysv/linux/alpha/setitimer.S
index 59caeac..59f97f7 100644
--- a/sysdeps/unix/sysv/linux/alpha/setitimer.S
+++ b/sysdeps/unix/sysv/linux/alpha/setitimer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define SETITIMER __setitimer_tv64
#else
#define SETITIMER __setitimer
@@ -124,7 +124,7 @@ $error:
END(SETITIMER)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__setitimer_tv64, __setitimer, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
diff --git a/sysdeps/unix/sysv/linux/alpha/settimeofday.S b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
index e39eadc..e80d054 100644
--- a/sysdeps/unix/sysv/linux/alpha/settimeofday.S
+++ b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define SETTIMEOFDAY __settimeofday_tv64
#else
#define SETTIMEOFDAY __settimeofday
@@ -105,7 +105,7 @@ $error:
END(SETTIMEOFDAY)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__settimeofday_tv64, __settimeofday, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
diff --git a/sysdeps/unix/sysv/linux/alpha/utimes.S b/sysdeps/unix/sysv/linux/alpha/utimes.S
index 0dd0a93..2ab2b19 100644
--- a/sysdeps/unix/sysv/linux/alpha/utimes.S
+++ b/sysdeps/unix/sysv/linux/alpha/utimes.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define UTIMES __utimes_tv64
#else
#define UTIMES __utimes
@@ -110,7 +110,7 @@ $error:
END(UTIMES)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__utimes_tv64, __utimes, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
diff --git a/sysdeps/unix/sysv/linux/alpha/wait4.S b/sysdeps/unix/sysv/linux/alpha/wait4.S
index 634993d..5e1e5d4 100644
--- a/sysdeps/unix/sysv/linux/alpha/wait4.S
+++ b/sysdeps/unix/sysv/linux/alpha/wait4.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
.text
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
#define WAIT4 __wait4_tv64
#else
#define WAIT4 __wait4
@@ -143,7 +143,7 @@ $error:
END(WAIT4)
#endif /* __ASSUME_TIMEVAL64 */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+#if defined PIC && defined DO_VERSIONING
default_symbol_version (__wait4_tv64, __wait4, GLIBC_2.1)
/* It seems to me to be a misfeature of the assembler that we can only
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 07/10] alpha: Support __NR_fstatat64.
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (8 preceding siblings ...)
2012-02-09 4:35 ` [PATCH 08/10] alpha: Remove HAVE_ELF tests Richard Henderson
@ 2012-02-09 4:36 ` Richard Henderson
2012-02-09 19:04 ` [PATCH 00/10] Alpha compilation fixes Roland McGrath
10 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2012-02-09 4:36 UTC (permalink / raw)
To: libc-ports
---
sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c | 9 ++++
sysdeps/unix/sysv/linux/alpha/fxstatat.c | 63 ++++++++++++++++--------
2 files changed, 51 insertions(+), 21 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c
diff --git a/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c b/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c
new file mode 100644
index 0000000..41e83bc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c
@@ -0,0 +1,9 @@
+/* In this implementation we do not really care whether the call fails
+ because of missing kernel support since we do not even call the
+ function in this case. */
+/* For Alpha, in <kernel-features.h> we redefine the default definition of
+ when __ASSUME_ATFCTS is present. The hack must wait until after that. */
+#include <kernel-features.h>
+#undef __ASSUME_ATFCTS
+#define __ASSUME_ATFCTS 1
+#include "fxstatat.c"
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
index 6fa3aeb..a6fd06b 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
@@ -30,11 +30,44 @@
#undef __fxstatat64
+#ifdef __ASSUME_ATFCTS
+# define __have_atfcts 1
+#endif
+#ifdef __ASSUME_STAT64_SYSCALL
+# define __libc_missing_axp_stat64 0
+#endif
/* Get information about the file NAME in BUF. */
int
__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
{
+ INTERNAL_SYSCALL_DECL (err);
+ int result, errno_out;
+
+ /* ??? The __fxstatat entry point is new enough that it must be using
+ vers == _STAT_VER_KERNEL64. For the benefit of dl-fxstatat64.c, we
+ cannot actually check this, lest the compiler not optimize the rest
+ of the function away. */
+
+#ifdef __NR_fstatat64
+ if (__have_atfcts >= 0)
+ {
+ result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
+#ifndef __ASSUME_ATFCTS
+ if (errno_out == ENOSYS)
+ __have_atfcts = -1;
+ else
+#endif
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
+ }
+#endif /* __NR_fstatat64 */
+
if (flag & ~AT_SYMLINK_NOFOLLOW)
{
__set_errno (EINVAL);
@@ -67,12 +100,8 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
file = buf;
}
- INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
- struct kernel_stat kst;
-
-#if __ASSUME_STAT64_SYSCALL > 0
- if (vers == _STAT_VER_KERNEL64)
+#ifdef __NR_stat64
+ if (!__libc_missing_axp_stat64)
{
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
@@ -82,24 +111,16 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- goto fail;
- }
-#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
+# if __ASSUME_STAT64_SYSCALL == 0
+ if (errno_out == ENOSYS)
+ __libc_missing_axp_stat64 = 1;
else
- result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
+# endif
goto fail;
- __libc_missing_axp_stat64 = 1;
}
-#endif
+#endif /* __NR_stat64 */
+
+ struct kernel_stat kst;
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/10] Alpha compilation fixes
2012-02-09 4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
` (9 preceding siblings ...)
2012-02-09 4:36 ` [PATCH 07/10] alpha: Support __NR_fstatat64 Richard Henderson
@ 2012-02-09 19:04 ` Roland McGrath
10 siblings, 0 replies; 14+ messages in thread
From: Roland McGrath @ 2012-02-09 19:04 UTC (permalink / raw)
To: Richard Henderson; +Cc: libc-ports
> I've yet to figure out why binfmt_misc has trouble letting qemu
> execute the direct ld.so invocations that we use in a full glibc test...
I think it's based on exact matching of header byte patterns. The qemu
setup probably only registered the patterns with ET_EXEC, not the ET_DYN
ones.
^ permalink raw reply [flat|nested] 14+ messages in thread