Bug#324549: glibc: FTBFS on hurd-i386: gcc-4.0 build failures [patch]
Package: glibc
Version: 2.3.5-4
Severity: important
Tags: patch
Hi,
attached is a dpatch which fixes gcc-4.0 build issues on hurd-i386. The
parts by Roland McGrath have been taken from CVS, the part by Alfred M.
Szmidt has not been applied yet and was thus taken from
http://sources.redhat.com/ml/libc-alpha/2005-08/msg00018.html
cheers,
Michael
#! /bin/sh -e
# DP: Description: Fix gcc-4.0 build erorrs
# DP: Author: Roland McGrath and Alfred M. Szmidt
# DP: Upstream status: Parts by Roland McGrath are in CVS HEAD,
# DP: part by Alfred M. Szmidt not
# DP: Date: 20 Aug 2005
if [ $# -ne 2 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
-unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
esac
exit 0
2005-08-05 Roland McGrath <roland@redhat.com>
* sysdeps/mach/hurd/mig-reply.c (reply_port): Don't use ?: as lvalue.
2005-08-05 Roland McGrath <roland@redhat.com>
* mach/shortcut.awk: Ignore `weak_alias' lines.
Reported by Alfred M. Szmidt <ams@gnu.org>.
2005-08-05 Alfred M. Szmidt <ams@gnu.org>
* hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Silence GCC 4.x
errors.
* sysdeps/mach/hurd/setitimer.c: Likewise,
* sysdeps/mach/hurd/profil.c: Likewise.
* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/mig-reply.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- libc/sysdeps/mach/hurd/mig-reply.c 2001/07/06 04:55:57 1.10
+++ libc/sysdeps/mach/hurd/mig-reply.c 2005/08/05 21:16:28 1.11
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1997,2005 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
@@ -22,7 +22,7 @@
#define GETPORT \
mach_port_t *portloc = \
(mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY)
-#define reply_port (use_threadvar ? *portloc : global_reply_port)
+#define reply_port (*(use_threadvar ? portloc : &global_reply_port))
static int use_threadvar;
static mach_port_t global_reply_port;
===================================================================
RCS file: /cvs/glibc/libc/mach/shortcut.awk,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- libc/mach/shortcut.awk 2002/02/18 01:50:15 1.7
+++ libc/mach/shortcut.awk 2005/08/08 20:52:23 1.8
@@ -7,6 +7,8 @@
$1 == "LINTLIBRARY" { print "#include <mach.h>"; next }
+$1 == "weak_alias" { next }
+
# Copy the first line of the definition, but
# replace the function name (RPC) with CALL.
$NF == rpc \
--- libc/hurd/intr-msg.c
+++ libc/hurd/intr-msg.c
@@ -201,9 +201,10 @@
case MACH_MSG_TYPE_MOVE_SEND:
for (i = 0; i < number; i++)
__mach_port_deallocate (__mach_task_self (), *ports++);
- (ty->msgtl_header.msgt_longform
- ? ty->msgtl_name : ty->msgtl_header.msgt_name)
- = MACH_MSG_TYPE_COPY_SEND;
+ if (ty->msgtl_header.msgt_longform)
+ ty->msgtl_name = MACH_MSG_TYPE_COPY_SEND;
+ else
+ ty->msgtl_header.msgt_name = MACH_MSG_TYPE_COPY_SEND;
break;
case MACH_MSG_TYPE_COPY_SEND:
case MACH_MSG_TYPE_MOVE_RECEIVE:
@@ -223,29 +224,29 @@
name = ty->msgtl_name;
size = ty->msgtl_size;
number = ty->msgtl_number;
- (char *) ty += sizeof (mach_msg_type_long_t);
+ ty = (char *) ty + sizeof (mach_msg_type_long_t);
}
else
{
name = ty->msgtl_header.msgt_name;
size = ty->msgtl_header.msgt_size;
number = ty->msgtl_header.msgt_number;
- (char *) ty += sizeof (mach_msg_type_t);
+ ty = (char *) ty + sizeof (mach_msg_type_t);
}
if (ty->msgtl_header.msgt_inline)
{
clean_ports ((void *) ty, 0);
/* calculate length of data in bytes, rounding up */
- (char *) ty += (((((number * size) + 7) >> 3)
- + sizeof (mach_msg_type_t) - 1)
- &~ (sizeof (mach_msg_type_t) - 1));
+ ty = (char *) ty + (((((number * size) + 7) >> 3)
+ + sizeof (mach_msg_type_t) - 1)
+ &~ (sizeof (mach_msg_type_t) - 1));
}
else
{
clean_ports (*(void **) ty,
ty->msgtl_header.msgt_deallocate);
- ++(void **) ty;
+ ty = (void **) ty + 1;
}
}
#else /* Untyped Mach IPC flavor. */
--- libc/sysdeps/mach/hurd/setitimer.c
+++ libc/sysdeps/mach/hurd/setitimer.c
@@ -37,6 +37,9 @@
vm_address_t _hurd_itimer_thread_stack_size; /* Size of its stack. */
struct timeval _hurd_itimer_started; /* Time the thread started waiting. */
+static int setitimer_locked (const struct itimerval *new,
+ struct itimerval *old, void *crit);
+
static void
quantize_timeval (struct timeval *tv)
{
@@ -126,15 +129,11 @@
}
}
-
static sighandler_t
restart_itimer (struct hurd_signal_preemptor *preemptor,
struct hurd_sigstate *ss,
int *signo, struct hurd_signal_detail *detail)
{
- static int setitimer_locked (const struct itimerval *new,
- struct itimerval *old, void *crit);
-
/* This function gets called in the signal thread
each time a SIGALRM is arriving (even if blocked). */
struct itimerval it;
--- libc/sysdeps/mach/hurd/profil.c
+++ libc/sysdeps/mach/hurd/profil.c
@@ -49,6 +49,7 @@
sampled_pc_array_t,
mach_msg_type_number_t *);
static void fetch_samples (void);
+static void profile_waiter (void);
/* Enable statistical profiling, writing samples of the PC into at most
SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
@@ -64,7 +65,6 @@
if (profile_thread == MACH_PORT_NULL)
{
/* Set up the profiling collector thread. */
- static void profile_waiter (void);
err = __thread_create (__mach_task_self (), &profile_thread);
if (! err)
err = __mach_setup_thread (__mach_task_self (), profile_thread,
--- libc/sysdeps/mach/hurd/ioctl.c
+++ libc/sysdeps/mach/hurd/ioctl.c
@@ -136,9 +136,11 @@
Rather than pointing to the value, ARG is the value itself. */
#ifdef MACH_MSG_TYPE_BIT
*t++ = io2mach_type (1, _IOTS (integer_t));
- *((integer_t *) t)++ = (integer_t) arg;
+ *(integer_t *) t = (integer_t) arg;
+ t += sizeof (integer_t);
#else
- *((integer_t *) p)++ = (integer_t) arg;
+ *(integer_t *) p = (integer_t) arg;
+ p += sizeof (integer_t);
#endif
}
Reply to: