From jakub@redhat.com Thu Jul 3 14:26:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 03 Jul 2003 14:26:00 -0000 Subject: [PATCH] Typo fix in prof-freq.c Message-ID: <20030703142542.GM20507@sunsite.ms.mff.cuni.cz> Hi! Furthermore, there is a typo in the ChangeLog: * sysdeps/unix/sysv/linux/prof-freq.h: New file. while it should be prof-freq.c. 2003-07-03 Jakub Jelinek * sysdeps/unix/sysv/linux/prof-freq.c (__profile_frequency): Fix a typo. --- libc/sysdeps/unix/sysv/linux/prof-freq.c 3 Jul 2003 08:36:44 -0000 1.1 +++ libc/sysdeps/unix/sysv/linux/prof-freq.c 3 Jul 2003 14:22:04 -0000 @@ -29,7 +29,7 @@ __profile_frequency (void) #ifdef __ASSUME_AT_CLKTCK return GL(dl_clktck); #else - if (GL(dl_clktck) != ) + if (GL(dl_clktck) != 0) return GL(dl_clktck); struct itimerval tim; Jakub From jakub@redhat.com Fri Jul 4 19:22:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 04 Jul 2003 19:22:00 -0000 Subject: [PATCH] Fix Scrt1.o on s390{,x} Message-ID: <20030704192224.GQ20507@sunsite.ms.mff.cuni.cz> Hi! On s390 without this patch PIEs were be just DT_TEXTREL, on s390x crashed because __libc_start_main was usually not close enough to _start. 2003-07-04 Jakub Jelinek * sysdeps/s390/s390-32/elf/start.S: Emit position independent code if PIC. * sysdeps/s390/s390-64/elf/start.S: Likewise. --- libc/sysdeps/s390/s390-32/elf/start.S.jj 2002-12-09 15:37:23.000000000 -0500 +++ libc/sysdeps/s390/s390-32/elf/start.S 2003-07-04 15:07:32.000000000 -0400 @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF s390 ABI. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -66,19 +66,35 @@ _start: l %r6,.L2-.Llit(%r13) # load pointer to __libc_csu_fini l %r5,.L1-.Llit(%r13) # load pointer to __libc_csu_init l %r2,.L3-.Llit(%r13) # load pointer to main + l %r1,.L4-.Llit(%r13) # load pointer to __libc_start_main +#ifdef PIC + l %r12,.L5-.Llit(%r13) # load .got pointer + la %r6,0(%r13,%r6) + la %r5,0(%r13,%r5) + la %r2,0(%r13,%r2) + la %r1,0(%r13,%r1) + la %r12,0(%r13,%r12) +#endif /* ok, now branch to the libc main routine */ - l %r1,.L4-.Llit(%r13) basr %r14,%r1 /* crash if __libc_start_main returns */ .word 0 .Llit: +#ifndef PIC .L1: .long __libc_csu_init .L2: .long __libc_csu_fini .L3: .long main .L4: .long __libc_start_main +#else +.L1: .long __libc_csu_init-.Llit +.L2: .long __libc_csu_fini-.Llit +.L3: .long main-.Llit +.L4: .long __libc_start_main@plt-.Llit +.L5: .long _GLOBAL_OFFSET_TABLE_-.Llit +#endif /* FIXME: FPU flags or what ?!? */ --- libc/sysdeps/s390/s390-64/elf/start.S.jj 2002-12-09 15:37:20.000000000 -0500 +++ libc/sysdeps/s390/s390-64/elf/start.S 2003-07-04 15:07:17.000000000 -0400 @@ -1,5 +1,5 @@ /* Startup code compliant to the 64 bit S/390 ELF ABI. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -64,7 +64,11 @@ _start: larl %r2,main # load pointer to main /* Ok, now branch to the libc main routine. */ +#ifdef PIC + brasl %r14,__libc_start_main@plt +#else brasl %r14,__libc_start_main +#endif /* Crash if __libc_start_main returns. */ .word 0 Jakub From jakub@redhat.com Mon Jul 7 21:44:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 07 Jul 2003 21:44:00 -0000 Subject: [PATCH] Fix Scrt1.o on ppc64 Message-ID: <20030707214423.GX20507@sunsite.ms.mff.cuni.cz> Hi! This patch prevents DT_TEXTREL PIEs just because Scrt1.o was linked in. 2003-07-07 Jakub Jelinek * sysdeps/powerpc/powerpc64/elf/start.S: Put L(start_address) into .data.rel.ro.local section if PIC to avoid DT_TEXTREL. --- libc/sysdeps/powerpc/powerpc64/elf/start.S.jj 2002-12-09 15:37:21.000000000 -0500 +++ libc/sysdeps/powerpc/powerpc64/elf/start.S 2003-07-07 17:41:46.000000000 -0400 @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. PowerPC64 version. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998,1999,2000,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 @@ -21,7 +21,11 @@ #include "bp-sym.h" /* These are the various addresses we require. */ +#ifdef PIC + .section ".data.rel.ro.local" +#else .section ".rodata" +#endif .align 3 L(start_addresses): .quad 0 /* was _SDA_BASE_ but not in 64-bit ABI*/ Jakub From drepper@redhat.com Tue Jul 8 03:44:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 08 Jul 2003 03:44:00 -0000 Subject: [PATCH] Fix Scrt1.o on ppc64 In-Reply-To: <20030707214423.GX20507@sunsite.ms.mff.cuni.cz> References: <20030707214423.GX20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F0A3DEE.8080407@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-07 Jakub Jelinek > > * sysdeps/powerpc/powerpc64/elf/start.S: Put L(start_address) > into .data.rel.ro.local section if PIC to avoid DT_TEXTREL. Applied. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Cj3u2ijCOnn/RHQRAjsjAKCh1dUzTArFwQw9/jt7SQe02ULMMACdE62j o7mOWg1RcsTnIzZcHrZXWJk= =uPBB -----END PGP SIGNATURE----- From drepper@redhat.com Tue Jul 8 03:45:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 08 Jul 2003 03:45:00 -0000 Subject: [PATCH] Fix Scrt1.o on s390{,x} In-Reply-To: <20030704192224.GQ20507@sunsite.ms.mff.cuni.cz> References: <20030704192224.GQ20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F0A3E56.8020004@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-04 Jakub Jelinek > > * sysdeps/s390/s390-32/elf/start.S: Emit position independent code > if PIC. > * sysdeps/s390/s390-64/elf/start.S: Likewise. Applied. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Cj5W2ijCOnn/RHQRAji8AJ0VNa4Gd/tAgVV4tEHQ65nuoMrK5gCgkSEO oULg16PsP1geTLikuwSdd40= =Eo4j -----END PGP SIGNATURE----- From jakub@redhat.com Thu Jul 10 15:35:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 10 Jul 2003 15:35:00 -0000 Subject: [PATCH] Embarrassing ppc64 -pie fix Message-ID: <20030710153458.GF20507@sunsite.ms.mff.cuni.cz> Hi! I was testing the patch with .data section and just later on changed it to .data.rel.ro.local. The difference is that .data has default section flags while .data.rel.ro.local does not have it... 2003-07-10 Jakub Jelinek * sysdeps/powerpc/powerpc64/elf/start.S: Set section flags of .data.rel.ro.local to "aw". --- libc/sysdeps/powerpc/powerpc64/elf/start.S.jj 2003-07-10 11:27:20.000000000 -0400 +++ libc/sysdeps/powerpc/powerpc64/elf/start.S 2003-07-10 11:31:29.000000000 -0400 @@ -22,7 +22,7 @@ /* These are the various addresses we require. */ #ifdef PIC - .section ".data.rel.ro.local" + .section ".data.rel.ro.local","aw" #else .section ".rodata" #endif Jakub From drepper@redhat.com Thu Jul 10 17:07:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 10 Jul 2003 17:07:00 -0000 Subject: [PATCH] Embarrassing ppc64 -pie fix In-Reply-To: <20030710153458.GF20507@sunsite.ms.mff.cuni.cz> References: <20030710153458.GF20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F0D9D1E.4070703@redhat.com> Jakub Jelinek wrote: > 2003-07-10 Jakub Jelinek > > * sysdeps/powerpc/powerpc64/elf/start.S: Set section flags of > .data.rel.ro.local to "aw". Applied. -- --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- From jakub@redhat.com Fri Jul 11 15:07:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 11 Jul 2003 15:07:00 -0000 Subject: [PATCH] Kill 4 warnings Message-ID: <20030711150704.GJ20507@sunsite.ms.mff.cuni.cz> Hi! 2003-07-11 Jakub Jelinek * sysdeps/unix/sysv/linux/sigwait.c: Include string.h. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sleep.c (__sleep): Cast value to unsigned int before assigning to max to avoid warnings. --- libc/sysdeps/unix/sysv/linux/sigwait.c.jj 2003-06-17 16:44:31.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sigwait.c 2003-07-11 09:56:27.000000000 -0400 @@ -20,6 +20,7 @@ #include #define __need_NULL #include +#include #include #include --- libc/sysdeps/unix/sysv/linux/sigwaitinfo.c.jj 2003-06-17 16:44:31.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sigwaitinfo.c 2003-07-11 10:11:57.000000000 -0400 @@ -20,6 +20,7 @@ #include #define __need_NULL #include +#include #include #include --- libc/sysdeps/unix/sysv/linux/sigtimedwait.c.jj 2003-06-17 16:44:31.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sigtimedwait.c 2003-07-11 10:12:15.000000000 -0400 @@ -18,6 +18,7 @@ #include #include +#include #include #include --- libc/sysdeps/unix/sysv/linux/sleep.c.jj 2003-07-11 10:13:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sleep.c 2003-07-11 10:23:21.000000000 -0400 @@ -40,7 +40,8 @@ cl (void *arg) unsigned int __sleep (unsigned int seconds) { - const unsigned int max = ((unsigned long int) (~((time_t) 0))) >> 1; + const unsigned int max + = (unsigned int) (((unsigned long int) (~((time_t) 0))) >> 1); struct timespec ts; sigset_t set, oset; unsigned int result; Jakub From drepper@redhat.com Fri Jul 11 22:50:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 11 Jul 2003 22:50:00 -0000 Subject: [PATCH] Kill 4 warnings In-Reply-To: <20030711150704.GJ20507@sunsite.ms.mff.cuni.cz> References: <20030711150704.GJ20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F0F3F00.8050103@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-11 Jakub Jelinek > > * sysdeps/unix/sysv/linux/sigwait.c: Include string.h. > * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. > * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. > * sysdeps/unix/sysv/linux/sleep.c (__sleep): Cast value to unsigned > int before assigning to max to avoid warnings. Checked in, thanks, - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Dz8A2ijCOnn/RHQRAiVwAKCSeyTiwGtJPkkeO064/6l7MEFrhgCeIbcJ 31zccUtfSgQWOociY7Q/3H0= =8nSr -----END PGP SIGNATURE----- From kkojima@rr.iij4u.or.jp Sat Jul 12 01:06:00 2003 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Sat, 12 Jul 2003 01:06:00 -0000 Subject: [PATCH] SH fix for socket syscall wrapper Message-ID: <200307120106.h6C16Gm24634@r-rr.iij4u.or.jp> Hi, SH's __socket syscall wrapper is broken for the cancellation case. Here is a fix. Regards, kaz -- 2003-07-12 Kaz Kojima * sysdeps/unix/sysv/linux/sh/socket.S: Save and restore the PR register across CENABLE and CDISABLE. diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/socket.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/socket.S --- ORIG/libc/sysdeps/unix/sysv/linux/sh/socket.S Wed Jan 8 08:37:36 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/socket.S Thu Jul 10 13:19:45 2003 @@ -94,7 +94,9 @@ ENTRY (__socket) #if defined NEED_CANCELLATION && defined CENABLE .Lsocket_cancel: /* Enable asynchronous cancellation. */ + sts.l pr,@-r15 CENABLE + lds.l @r15+,pr /* Do the system call trap. */ mov #+P(SOCKOP_,socket), r4 @@ -102,9 +104,11 @@ ENTRY (__socket) mov.l .L1,r3 trapa #0x12 + sts.l pr,@-r15 mov.l r0,@-r15 CDISABLE mov.l @r15+,r0 + lds.l @r15+,pr /* Pop args off the stack */ P(POPARGS_,NARGS) From jakub@redhat.com Sat Jul 12 14:19:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Sat, 12 Jul 2003 14:19:00 -0000 Subject: [PATCH] Misc fixes Message-ID: <20030712141939.GO20507@sunsite.ms.mff.cuni.cz> Hi! 2003-07-12 Jakub Jelinek * sysdeps/unix/sysv/linux/futimes.c: Include kernel-features.h. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMES): Fix a typo. --- libc/sysdeps/unix/sysv/linux/futimes.c 12 Jul 2003 09:10:10 -0000 1.1.1.1 +++ libc/sysdeps/unix/sysv/linux/futimes.c 12 Jul 2003 09:48:04 -0000 1.2 @@ -23,6 +23,8 @@ #include #include +#include "kernel-features.h" + /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1], but do not follow symlinks. --- libc/sysdeps/unix/sysv/linux/kernel-features.h 12 Jul 2003 09:10:10 -0000 1.1.1.39 +++ libc/sysdeps/unix/sysv/linux/kernel-features.h 12 Jul 2003 09:48:04 -0000 1.24 @@ -347,7 +347,7 @@ #endif /* The utimes syscall has been available for some architectures forever. */ -#if defined __alpha__ || defined __ia64__ || defined __hppa_ \ +#if defined __alpha__ || defined __ia64__ || defined __hppa__ \ || defined __sparc__ # define __ASSUME_UTIMES 1 #endif Jakub From drepper@redhat.com Sat Jul 12 18:49:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 12 Jul 2003 18:49:00 -0000 Subject: [PATCH] Misc fixes In-Reply-To: <20030712141939.GO20507@sunsite.ms.mff.cuni.cz> References: <20030712141939.GO20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F105822.4020308@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-12 Jakub Jelinek > > * sysdeps/unix/sysv/linux/futimes.c: Include kernel-features.h. > * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMES): Fix > a typo. Applied. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/EFgi2ijCOnn/RHQRAtQdAKDODR1hMmdrhx8P9gBgS5fW8rIEgQCfYSEE ZRI73xAhtcr/7EMSuxUE6zQ= =CBiL -----END PGP SIGNATURE----- From drepper@redhat.com Tue Jul 15 07:22:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 07:22:00 -0000 Subject: more cancellation work Message-ID: <3F13AB99.9060305@redhat.com> I've checked in some more cancellation work today. It took a while to get this done mainly because I went back and forth on some of the decisions. This is the time when policies have to be made and I think I got it down to some reasonable set now. The problem is the set of functions which POSIX lists as possible cancellation points plus all the functions not in POSIX. If the implementation of the functions uses a function which is a cancellation point it can also become cancelable. And in fact it will unless steps are taken. For each function a decision has to be made. In case the decision is to not make a function cancelable a not-cancelable version of the syscall wrapper has to be used. The decisions I made so far are as follows: ~ functions needed for error messages etc are not cancelable. This includes catgets, gettext, strerror. This will allow generating some output before a thread dies. ~ if possible, all functions related to closing a descriptor are not cancelable. Unfortunately close() itself must be cancelable since POSIX says so. But think a second what this means. If close() is canceled it is not known whether the descriptor has been closed or not. I.e., the program leaks. Better avoid this if possible. ~ the dlfcn code is not cancelable. Mostly because most of the code is in ld.so and there it is not cancelable. ~ the headers reflect exactly the cancelability of the function. I.e., even if a function is listed in POSIX as a possible cancellation point but it is not cancelable in glibc, it still gets the __THROW marker. I have also introduced some code which inside glibc itself uses the C cleanup handling. The use of this feature will increase significantly in future. But using it brought up a problem: the unwinder code is now used internally. This causes problem since we already compile in parts of unwind-dw2.c. If now the other unwind code is pulled in from libgcc_eh.a we get a collision of symbol due to the few symbols we already have from our own copy of unwind-dw2.c. rth said he doesn't want to split the file to avoid exposing more interfaces. This means we have to pull in all of the unwinder code which might mean we get maintainance problems in future where old glibcs cannot be compiled with new gccs. I see no other solution for this. Another problem is ia64. The unwinder code for ia64 is different from the rest. We probably need to pull in that code from gcc as well. I haven't done it yet which means ia64 might not link/run correctly. Anyway, there is a lot more work to be done. All possible cancellation points have to be investigated. Then all functions implementations need to be investigated whether they are using (transitively) and cancelable function. In case this is the case and the function is in POSIX the code must e rewritten to avoid the cancellation points. Otherwise we have to make a decision. The whole matter is worse since I know this feature will hardly ever be used (and rightly so). It's such a waste. -- --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- From davidm@napali.hpl.hp.com Tue Jul 15 15:59:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 15:59:00 -0000 Subject: more cancellation work In-Reply-To: <3F13AB99.9060305@redhat.com> References: <3F13AB99.9060305@redhat.com> Message-ID: <16148.9321.504185.96989@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 00:22:01 -0700, Ulrich Drepper said: Uli> rth said he doesn't want to split the file to avoid exposing Uli> more interfaces. This means we have to pull in all of the Uli> unwinder code which might mean we get maintainance problems in Uli> future where old glibcs cannot be compiled with new gccs. I Uli> see no other solution for this. Uli> Another problem is ia64. The unwinder code for ia64 is Uli> different from the rest. We probably need to pull in that code Uli> from gcc as well. I haven't done it yet which means ia64 might Uli> not link/run correctly. Have you considered using libunwind? The API is portable, full implementation exists for ia64, and a partial one for x86. See: http://www.hpl.hp.com/research/linux/libunwind/ for some more info. I'm not sure exactly what functionality you need, but if something is missing, let me know. --david From drepper@redhat.com Tue Jul 15 17:31:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 17:31:00 -0000 Subject: more cancellation work In-Reply-To: <16148.9321.504185.96989@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> Message-ID: <3F143A35.5040906@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > Have you considered using libunwind? The API is portable, full > implementation exists for ia64, and a partial one for x86. See: > > http://www.hpl.hp.com/research/linux/libunwind/ > > for some more info. I'm not sure exactly what functionality you need, > but if something is missing, let me know. We have to use whatever gcc uses so libunwind is no option. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FDo12ijCOnn/RHQRAuWvAKCdZrEmzZ60CqKNzMle3SKJkMsRZgCghyOV /FIm6SdTyr2Sgpl8bnsT+bg= =KQQD -----END PGP SIGNATURE----- From davidm@napali.hpl.hp.com Tue Jul 15 17:56:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 17:56:00 -0000 Subject: more cancellation work In-Reply-To: <3F143A35.5040906@redhat.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> Message-ID: <16148.16484.956221.152133@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 10:30:29 -0700, Ulrich Drepper said: Uli> We have to use whatever gcc uses so libunwind is no option. Well, gcc on ia64 _does_ use libunwind. There is no reason the same couldn't be true for x86 and all the other platforms (apart from a small matter of some implementation work...). --david From drepper@redhat.com Tue Jul 15 18:07:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 18:07:00 -0000 Subject: more cancellation work In-Reply-To: <16148.16484.956221.152133@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> Message-ID: <3F1442AE.4050009@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > Well, gcc on ia64 _does_ use libunwind. There is no reason the same > couldn't be true for x86 and all the other platforms (apart from a > small matter of some implementation work...). The current implementatin is just fine and does not have any legal problems attached to it. So I think we are much better off with the status quo. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FEKu2ijCOnn/RHQRAoWhAJ93rzMRmV4a4j2JTG0sYiipmcp6PwCfQFD2 dU3Oh3nZvPARd/kM3sybZb8= =OMMY -----END PGP SIGNATURE----- From davidm@napali.hpl.hp.com Tue Jul 15 18:44:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 18:44:00 -0000 Subject: more cancellation work In-Reply-To: <3F1442AE.4050009@redhat.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> Message-ID: <16148.19336.562854.643606@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 11:06:38 -0700, Ulrich Drepper said: Uli> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uli> David Mosberger wrote: >> Well, gcc on ia64 _does_ use libunwind. There is no reason the >> same couldn't be true for x86 and all the other platforms (apart >> from a small matter of some implementation work...). Uli> The current implementatin is just fine and does not have any Uli> legal problems attached to it. Huh? What "legal problems" does libunwind have? Care to elaborate? --david From drepper@redhat.com Tue Jul 15 18:49:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 18:49:00 -0000 Subject: more cancellation work In-Reply-To: <16148.19336.562854.643606@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> Message-ID: <3F144C92.9000809@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > Huh? What "legal problems" does libunwind have? Care to elaborate? gdb apparently still cannot use libunwind. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FEyS2ijCOnn/RHQRAleTAJ9z5j2T67KPmyg4eVinAcVMGydWZQCgmmGf ql+nONi3VJvDpZ4vgXra+9k= =pT2A -----END PGP SIGNATURE----- From davidm@napali.hpl.hp.com Tue Jul 15 20:12:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 20:12:00 -0000 Subject: more cancellation work In-Reply-To: <3F144C92.9000809@redhat.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> Message-ID: <16148.24644.302182.700037@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 11:48:50 -0700, Ulrich Drepper said: Uli> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uli> David Mosberger wrote: >> Huh? What "legal problems" does libunwind have? Care to >> elaborate? Uli> gdb apparently still cannot use libunwind. You're confusing different things here: - gdb never had any problems with libunwind itself (it was initially released under GPL, now it's even under the MIT license so that the *BSD folks can use it for their kernel) - there is a gdb-specific patch which I wrote which needed a copyright assignment; this took a long time to settle but it's in place now Summary: there are no legal issues in using libunwind. --david From drepper@redhat.com Tue Jul 15 21:28:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 21:28:00 -0000 Subject: more cancellation work In-Reply-To: <16148.24644.302182.700037@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> Message-ID: <3F1471C8.5010705@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > - gdb never had any problems with libunwind itself (it was initially > released under GPL, now it's even under the MIT license so that the > *BSD folks can use it for their kernel) That's not enough. The code has to be assigned to the FSF. But all this is pointless. If anything should change it's ia64. There was no reason to invent something new but still it was done. For no good reason. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FHHI2ijCOnn/RHQRAnrlAKCu1H4kUmEnSkeGjNTIrhx4ubi29gCfWLYR 1LXUNBWdMXMJbeuDfBXa8II= =Mdly -----END PGP SIGNATURE----- From rth@twiddle.net Tue Jul 15 22:13:00 2003 From: rth@twiddle.net (Richard Henderson) Date: Tue, 15 Jul 2003 22:13:00 -0000 Subject: more cancellation work In-Reply-To: <16148.16484.956221.152133@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> Message-ID: <20030715221330.GA27216@twiddle.net> On Tue, Jul 15, 2003 at 10:56:52AM -0700, David Mosberger wrote: > Well, gcc on ia64 _does_ use libunwind. Not by default. r~ From davidm@napali.hpl.hp.com Tue Jul 15 22:29:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 22:29:00 -0000 Subject: more cancellation work In-Reply-To: <3F1471C8.5010705@redhat.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> Message-ID: <16148.32851.244149.178575@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 14:27:36 -0700, Ulrich Drepper said: Uli> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uli> David Mosberger wrote: >> - gdb never had any problems with libunwind itself (it was >> initially released under GPL, now it's even under the MIT license >> so that the *BSD folks can use it for their kernel) Uli> That's not enough. The code has to be assigned to the FSF. libunwind is not part of gdb, so I don't see why it would need an assignment. Uli> But all this is pointless. If anything should change it's Uli> ia64. There was no reason to invent something new but still it Uli> was done. For no good reason. That sounds like a lot of sour grapes. I don't know the history behind the ABI work, but changing it now sure seems like a bit late... ;-) In any case, are you worried at all about dynamically generated code? If so, how are you planning to handle that? --david From schwab@suse.de Tue Jul 15 22:30:00 2003 From: schwab@suse.de (Andreas Schwab) Date: Tue, 15 Jul 2003 22:30:00 -0000 Subject: Fix futimes.c Message-ID: and are needed for NULL and memcpy. Andreas. 2003-07-16 Andreas Schwab * sysdeps/unix/sysv/linux/futimes.c: Include and . --- sysdeps/unix/sysv/linux/futimes.c.~1.4.~ 2003-07-13 14:02:41.000000000 +0200 +++ sysdeps/unix/sysv/linux/futimes.c 2003-07-16 00:25:07.000000000 +0200 @@ -18,6 +18,8 @@ 02111-1307 USA. */ #include +#include +#include #include #include #include From drepper@redhat.com Tue Jul 15 22:36:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 15 Jul 2003 22:36:00 -0000 Subject: more cancellation work In-Reply-To: <16148.32851.244149.178575@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> Message-ID: <3F1481DE.5090608@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > In any case, are you worried at all about dynamically generated code? > If so, how are you planning to handle that? Why should I do anything about this? This has nothing to do with the exception handling we do in libc. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FIHe2ijCOnn/RHQRAhciAJ9nD2AsJO9lEQFDijKXfNNE+2E/CwCfeHM6 DVIhYmxan1ixYpIdlcn392Q= =+cqE -----END PGP SIGNATURE----- From davidm@napali.hpl.hp.com Tue Jul 15 23:27:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 23:27:00 -0000 Subject: more cancellation work In-Reply-To: <20030715221330.GA27216@twiddle.net> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <20030715221330.GA27216@twiddle.net> Message-ID: <16148.36292.118465.908380@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 15:13:30 -0700, Richard Henderson said: Richard> On Tue, Jul 15, 2003 at 10:56:52AM -0700, David Mosberger Richard> wrote: >> Well, gcc on ia64 _does_ use libunwind. Richard> Not by default. You do know that the ia64 unwinder in gcc is broken, however. --david From davidm@napali.hpl.hp.com Tue Jul 15 23:37:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 15 Jul 2003 23:37:00 -0000 Subject: more cancellation work In-Reply-To: <3F1481DE.5090608@redhat.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> <3F1481DE.5090608@redhat.com> Message-ID: <16148.36904.443932.106633@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 15:36:14 -0700, Ulrich Drepper said: Uli> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uli> David Mosberger wrote: >> In any case, are you worried at all about dynamically generated >> code? If so, how are you planning to handle that? Uli> Why should I do anything about this? This has nothing to do Uli> with the exception handling we do in libc. That's why I was asking. I don't know whether the libc exception handling would ever have to unwind through dynamically generated code. If not, there is no issue, of course. BTW: is there a summary somewhere that libc will be doing? --david From drepper@redhat.com Wed Jul 16 00:10:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 16 Jul 2003 00:10:00 -0000 Subject: Fix futimes.c In-Reply-To: References: Message-ID: <3F1497CB.50605@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Schwab wrote: > and are needed for NULL and memcpy. Then we only need since it also defined NULL. I've made this change. Thanks, - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/FJfL2ijCOnn/RHQRApMlAJ0YD1qTmY8r4SR9L9mLNt7oLGo9AQCcD13g qTT1Lz1WY6oH3Gw6/RBbkyQ= =gGgs -----END PGP SIGNATURE----- From rth@twiddle.net Wed Jul 16 01:23:00 2003 From: rth@twiddle.net (Richard Henderson) Date: Wed, 16 Jul 2003 01:23:00 -0000 Subject: more cancellation work In-Reply-To: <16148.36292.118465.908380@napali.hpl.hp.com> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <20030715221330.GA27216@twiddle.net> <16148.36292.118465.908380@napali.hpl.hp.com> Message-ID: <20030716012323.GA27954@twiddle.net> On Tue, Jul 15, 2003 at 04:27:00PM -0700, David Mosberger wrote: > You do know that the ia64 unwinder in gcc is broken, however. No, I don't. r~ From davidm@napali.hpl.hp.com Wed Jul 16 01:47:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Wed, 16 Jul 2003 01:47:00 -0000 Subject: more cancellation work In-Reply-To: <20030716012323.GA27954@twiddle.net> References: <3F13AB99.9060305@redhat.com> <16148.9321.504185.96989@napali.hpl.hp.com> <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <20030715221330.GA27216@twiddle.net> <16148.36292.118465.908380@napali.hpl.hp.com> <20030716012323.GA27954@twiddle.net> Message-ID: <16148.44732.586305.189380@napali.hpl.hp.com> >>>>> On Tue, 15 Jul 2003 18:23:23 -0700, Richard Henderson said: Richard> On Tue, Jul 15, 2003 at 04:27:00PM -0700, David Mosberger Richard> wrote: >> You do know that the ia64 unwinder in gcc is broken, however. Richard> No, I don't. It is. The biggest issue is unwinding across alternate signal stacks. The changes needed to make this work are fairly extensive and I decided against trying to backport them to the gcc unwinder (since that would have likely introduced merging bugs). --david From rth@twiddle.net Thu Jul 17 04:11:00 2003 From: rth@twiddle.net (Richard Henderson) Date: Thu, 17 Jul 2003 04:11:00 -0000 Subject: more cancellation work In-Reply-To: <16148.36904.443932.106633@napali.hpl.hp.com> References: <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> <3F1481DE.5090608@redhat.com> <16148.36904.443932.106633@napali.hpl.hp.com> Message-ID: <20030717041149.GA621@twiddle.net> On Tue, Jul 15, 2003 at 04:37:12PM -0700, David Mosberger wrote: > BTW: is there a summary somewhere that libc will be doing? Relying on an external library for the actual unwinding. r~ From davidm@napali.hpl.hp.com Thu Jul 17 17:43:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 17 Jul 2003 17:43:00 -0000 Subject: more cancellation work In-Reply-To: <20030717041149.GA621@twiddle.net> References: <3F143A35.5040906@redhat.com> <16148.16484.956221.152133@napali.hpl.hp.com> <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> <3F1481DE.5090608@redhat.com> <16148.36904.443932.106633@napali.hpl.hp.com> <20030717041149.GA621@twiddle.net> Message-ID: <16150.57431.659956.319528@napali.hpl.hp.com> >>>>> On Wed, 16 Jul 2003 21:11:49 -0700, Richard Henderson said: Richard> On Tue, Jul 15, 2003 at 04:37:12PM -0700, David Mosberger Richard> wrote: >> BTW: is there a summary somewhere that libc will be doing? Richard> Relying on an external library for the actual unwinding. What I meant is: when will libc unwind? As a result of pthread_cancel()? If so, how does it work precisely? But since you brought it up: what API will this "external library" follow? The C++ exception handling API? (_Unwind_FOO)? --david From sjmunroe@us.ibm.com Thu Jul 17 18:07:00 2003 From: sjmunroe@us.ibm.com (Steven Munroe) Date: Thu, 17 Jul 2003 18:07:00 -0000 Subject: more cancellation work Message-ID: <3F16D085.25CBC3C@us.ibm.com> Found that glibc cvs will not build -enable-add-ons=linuxthreads any more because of cancelation changes made to misc/syslog.c syslog.c:238: warning: implicit declaration of function `__libc_cleanup_push' syslog.c:238: warning: implicit declaration of function `__libc_cleanup_push' syslog.c:238: warning: implicit declaration of function `__libc_cleanup_push' /home/sjmunroe/work/build-23/libc.so.6: undefined reference to `__libc_cleanup_push' /home/sjmunroe/work/build-23/libc.so.6: undefined reference to `__libc_cleanup_push' the __libc_cleanup_push and __libc_cleanup_pop macros are defined in: nptl/sysdeps/pthread/bits/libc-lock.h but not in: linuxthreads/sysdeps/pthread/bits/libc-lock.h What is the intent for this? Should linuxthreads just noop these macros or are there equalent cleanup function fo linuxthreads? -- Steven Munroe sjmunroe@us.ibm.com Linux on PowerPC-64 Development GLIBC for PowerPC-64 Development From rth@twiddle.net Thu Jul 17 18:42:00 2003 From: rth@twiddle.net (Richard Henderson) Date: Thu, 17 Jul 2003 18:42:00 -0000 Subject: more cancellation work In-Reply-To: <16150.57431.659956.319528@napali.hpl.hp.com> References: <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> <3F1481DE.5090608@redhat.com> <16148.36904.443932.106633@napali.hpl.hp.com> <20030717041149.GA621@twiddle.net> <16150.57431.659956.319528@napali.hpl.hp.com> Message-ID: <20030717184207.GA3612@twiddle.net> On Thu, Jul 17, 2003 at 10:43:51AM -0700, David Mosberger wrote: > What I meant is: when will libc unwind? As a result of > pthread_cancel()? If so, how does it work precisely? > > But since you brought it up: what API will this "external library" > follow? The C++ exception handling API? (_Unwind_FOO)? Yes, and by calling _Unwind_ForceUnwind. What else did you want to know? r~ From davidm@napali.hpl.hp.com Thu Jul 17 19:06:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 17 Jul 2003 19:06:00 -0000 Subject: more cancellation work In-Reply-To: <20030717184207.GA3612@twiddle.net> References: <3F1442AE.4050009@redhat.com> <16148.19336.562854.643606@napali.hpl.hp.com> <3F144C92.9000809@redhat.com> <16148.24644.302182.700037@napali.hpl.hp.com> <3F1471C8.5010705@redhat.com> <16148.32851.244149.178575@napali.hpl.hp.com> <3F1481DE.5090608@redhat.com> <16148.36904.443932.106633@napali.hpl.hp.com> <20030717041149.GA621@twiddle.net> <16150.57431.659956.319528@napali.hpl.hp.com> <20030717184207.GA3612@twiddle.net> Message-ID: <16150.62366.766754.509421@napali.hpl.hp.com> >>>>> On Thu, 17 Jul 2003 11:42:07 -0700, Richard Henderson said: Richard> On Thu, Jul 17, 2003 at 10:43:51AM -0700, David Mosberger wrote: >> What I meant is: when will libc unwind? As a result of >> pthread_cancel()? If so, how does it work precisely? >> But since you brought it up: what API will this "external library" >> follow? The C++ exception handling API? (_Unwind_FOO)? Richard> Yes, and by calling _Unwind_ForceUnwind. What else did you Richard> want to know? That explains it. Thanks, --david From jakub@redhat.com Fri Jul 18 12:20:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 18 Jul 2003 12:20:00 -0000 Subject: [PATCH] Binary compatibility fix for _res@GLIBC_2.0 Message-ID: <20030718122031.GV20507@sunsite.ms.mff.cuni.cz> Hi! We missed the fact that #define _res (*__res_state()) was introduced in glibc 2.2, not glibc 2.1, so there are symbol versioned properly built programs/libraries using _res@GLIBC_2.0. As, unlike errno, _res is not that performance sensitive, the following patch adds an indirection, so that _res in the initial thread is the _res@GLIBC_2.0 variable (doesn't matter if in libc.so or in program's .dynbss) and _res in the other threads is unique to those threads. Unfortunately, this patch is more complicated, because adding the huge struct __res_state into NPTL struct pthread made NPTL struct pthread larger than linuxthreads --without-__thread struct _pthread_descr_struct (it was on the other side removed from PT_TLS). When a single (linuxthreads --with-tls --without-__thread) ld.so is used for loading both linuxthreads --with-tls --without-__thread and NPTL libraries, things worked in the past because linuxthreads pthread structure was larger. This patch makes TLS_TCB_SIZE (resp. TLS_PRE_TCB_SIZE) in linuxthreads in ld.so as big to accomodate both linuxthreads and NPTL pthread structs. 2003-07-18 Jakub Jelinek * include/resolv.h (__resp): Declare. Define to __libc_resp if in libc.so. (_res): If USE___THREAD, define to (*__resp). * resolv/res_libc.c (_res): Normal .bss variable with compat_symbol even if USE___THREAD. (__resp): New __thread variable. (__libc_resp): New alias. * resolv/Versions (libc): Export _res@GLIBC_2.0 even if USE_TLS && HAVE___THREAD. Export __resp@@GLIBC_PRIVATE. * sysdeps/generic/res-state.c (__res_state): Return __resp if USE___THREAD. linuxthreads/ * descr.h (struct _pthread_descr_struct): Provide p_res member even if USE_TLS && HAVE___THREAD. * sysdeps/alpha/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Change to 0. (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Alignment of struct _pthread_descr_struct. (TLS_PRE_TCB_SIZE): Add sizeof (tcbhead_t) and pad to align. If in ld.so and NPTL struct pthread is bigger than struct _pthread_descr_struct, use NPTL struct pthread size. (TLS_TCB_OFFSET): Define. (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV, TLS_INIT_TP, THREAD_DTV, THREAD_SELF, INIT_THREAD_SELF): Changed to match NPTL tls.h definitions. * sysdeps/i386/tls.h (TLS_TCB_SIZE): If in ld.so and NPTL struct pthread is bigger than struct _pthread_descr_struct, use NPTL struct pthread size. * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Likewise. * sysdeps/powerpc/tls.h (TLS_PRE_TCB_SIZE): Likewise. * sysdeps/s390/tls.h (TLS_TCB_SIZE): Likewise. * sysdeps/sh/tls.h (TLS_PRE_TCB_SIZE): Likewise. * sysdeps/x86_64/tls.h (TLS_TCB_SIZE): Likewise. * sysdeps/pthread/res-state.c (__res_state): Return __resp if USE___THREAD. * sysdeps/pthread/Makefile (gen-as-const-headers): Add nptl-struct-pthread.sym if nptl tree is present. (before-compile): Add $(common-objpfx)nptl-struct-pthread.h if nptl tree is not present. (common-generated): Add nptl-struct-pthread.h. ($(common-objpfx)nptl-struct-pthread.h): New rule. * sysdeps/pthread/nptl-struct-pthread.sym: New file. * manager.c: Include resolv.h. (pthread_start_thread): Initialize __resp. * libc-tls-loc.c (__res_state): Return __resp. * Makefile (tests): Add tst-_res1. (modules-names, extra-objs, test-extras, test-modules): Add support for test modules. ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so. ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and -lpthread. * tst-_res1.c: New test. * tst-_res1mod1.c: New test. * tst-_res1mod2.c: New test. nptl/ * res.c (__res_state): Return __resp. * descr.h: Include resolv.h. Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h if __need_struct_pthread_size, instead define lll_lock_t. (struct pthread): Add res field. * pthread_create.c: Include resolv.h. (start_thread): Initialize __resp. * Makefile (tests): Add tst-_res1. (module-names): Add tst-_res1mod1, tst-_res1mod2. ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so. ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and * tst-_res1.c: New test. * tst-_res1mod1.c: New test. * tst-_res1mod2.c: New test. --- libc/nptl/res.c.jj 2002-11-26 17:50:04.000000000 -0500 +++ libc/nptl/res.c 2003-07-17 08:31:58.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 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 @@ -18,16 +18,10 @@ #include #include -#undef _res - #include -/* With __thread support, this per-thread variable is used in all cases. */ -extern __thread struct __res_state _res; - - struct __res_state * __res_state (void) { - return &_res; + return __resp; } --- libc/nptl/descr.h.jj 2003-07-08 09:54:08.000000000 -0400 +++ libc/nptl/descr.h 2003-07-17 13:58:42.000000000 -0400 @@ -27,15 +27,20 @@ #include #include #include +#ifdef __need_struct_pthread_size +#define lll_lock_t int +#else #include #include #include +#endif #include "../nptl_db/thread_db.h" #include #ifdef HAVE_FORCED_UNWIND # include #endif - +#define __need_res_state +#include #ifndef TCB_ALIGNMENT # define TCB_ALIGNMENT sizeof (double) @@ -235,6 +240,9 @@ struct pthread size_t stackblock_size; /* Size of the included guard area. */ size_t guardsize; + + /* Resolver state. */ + struct __res_state res; } __attribute ((aligned (TCB_ALIGNMENT))); --- libc/nptl/pthread_create.c.jj 2003-04-12 15:06:08.000000000 -0400 +++ libc/nptl/pthread_create.c 2003-07-17 08:31:58.000000000 -0400 @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -238,6 +239,9 @@ start_thread (void *arg) THREAD_SETMEM (pd, cpuclock_offset, now); #endif + /* Initialize resolver state pointer. */ + __resp = &pd->res; + /* This is where the try/finally block should be created. For compilers without that support we do use setjmp. */ struct pthread_unwind_buf unwind_buf; --- libc/nptl/tst-_res1.c.jj 2003-07-18 06:18:48.000000000 -0400 +++ libc/nptl/tst-_res1.c 2003-07-18 06:22:21.000000000 -0400 @@ -0,0 +1,69 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. + + 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. */ + +/* Test whether _res in glibc 2.1.x and earlier (before __res_state() + was introduced) works. Portable programs should never do the + dirty things below. */ + +#include +#include +#include +#include + +void *tf (void *resp) +{ + if (resp == &_res || resp == __res_state ()) + abort (); + _res.retry = 24; + return NULL; +} + +void do_test (struct __res_state *resp) +{ + if (resp != &_res || resp != __res_state ()) + abort (); + if (_res.retry != 12) + abort (); +} + +int main (void) +{ +#undef _res + extern struct __res_state _res; + pthread_t th; + + _res.retry = 12; + if (pthread_create (&th, NULL, tf, &_res) != 0) + { + puts ("create failed"); + exit (1); + } + + do_test (&_res); + + if (pthread_join (th, NULL) != 0) + { + puts ("join failed"); + exit (1); + } + + do_test (&_res); + + exit (0); +} --- libc/nptl/tst-_res1mod2.c.jj 2003-07-18 06:27:44.000000000 -0400 +++ libc/nptl/tst-_res1mod2.c 2003-07-18 06:27:40.000000000 -0400 @@ -0,0 +1 @@ +/* Nothing. */ --- libc/nptl/Makefile.jj 2003-07-15 14:05:05.000000000 -0400 +++ libc/nptl/Makefile 2003-07-18 06:30:53.000000000 -0400 @@ -249,10 +249,10 @@ tests += tst-cancelx2 tst-cancelx3 tst-c tst-oncex3 tst-oncex4 endif ifeq ($(build-shared),yes) -tests += tst-atfork2 tst-tls3 +tests += tst-atfork2 tst-tls3 tst-_res1 endif -modules-names = tst-atfork2mod tst-tls3mod +modules-names = tst-atfork2mod tst-tls3mod tst-_res1mod1 tst-_res1mod2 extra-objs += $(addsuffix .os,$(strip $(modules-names))) test-extras += $(modules-names) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) @@ -396,6 +396,8 @@ $(objpfx)tst-cancelx17: $(common-objpfx) $(objpfx)tst-cancel18: $(common-objpfx)rt/librt.so $(objpfx)tst-cancelx18: $(common-objpfx)rt/librt.so $(objpfx)tst-clock2: $(common-objpfx)rt/librt.so +$(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so +$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library) else $(objpfx)tst-cond11: $(common-objpfx)rt/librt.a $(objpfx)tst-cancel17: $(common-objpfx)rt/librt.a --- libc/nptl/tst-_res1mod1.c.jj 2003-07-18 06:22:35.000000000 -0400 +++ libc/nptl/tst-_res1mod1.c 2003-07-18 06:22:52.000000000 -0400 @@ -0,0 +1,23 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. + + 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. */ + +#include +#undef _res + +struct __res_state _res; --- libc/include/resolv.h.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/include/resolv.h 2003-07-17 08:31:58.000000000 -0400 @@ -17,9 +17,10 @@ # if USE___THREAD # undef _res # ifndef NOT_IN_libc -# define _res __libc_res +# define __resp __libc_resp # endif -extern __thread struct __res_state _res attribute_tls_model_ie; +# define _res (*__resp) +extern __thread struct __res_state *__resp attribute_tls_model_ie; # endif # else # ifndef __BIND_NOSTATIC --- libc/linuxthreads/descr.h.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/linuxthreads/descr.h 2003-07-17 08:31:58.000000000 -0400 @@ -163,8 +163,8 @@ struct _pthread_descr_struct int * p_h_errnop; /* pointer to used h_errno variable */ int p_h_errno; /* error returned by last netdb function */ struct __res_state *p_resp; /* Pointer to resolver state */ - struct __res_state p_res; /* per-thread resolver state */ #endif + struct __res_state p_res; /* per-thread resolver state */ int p_userstack; /* nonzero if the user provided the stack */ void *p_guardaddr; /* address of guard area or NULL */ size_t p_guardsize; /* size of guard area */ --- libc/linuxthreads/sysdeps/alpha/tls.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/alpha/tls.h 2003-07-18 05:43:09.000000000 -0400 @@ -53,54 +53,77 @@ typedef struct # include /* This is the size of the initial TCB. */ -# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) +# define TLS_INIT_TCB_SIZE 0 /* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_INIT_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (tcbhead_t) +# define TLS_TCB_SIZE 0 /* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) \ + + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# else +# include +# define TLS_PRE_TCB_SIZE \ + ((sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) \ + + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# endif /* The DTV is allocated at the TP; the TCB is placed elsewhere. */ # define TLS_DTV_AT_TP 1 +/* The following assumes that TP (R2 or R13) points to the end of the + TCB + 0x7000 (per the ABI). This implies that TCB address is + TP - 0x7000. As we define TLS_DTV_AT_TP we can + assume that the pthread struct is allocated immediately ahead of the + TCB. This implies that the pthread_descr address is + TP - (TLS_PRE_TCB_SIZE + 0x7000). */ +/* ??? PPC uses offset 0x7000; seems like a good idea for alpha too, + but binutils not yet changed to match. */ +# define TLS_TCB_OFFSET 0 + /* Install the dtv pointer. The pointer passed is to the element with index -1 which contain the length. */ # define INSTALL_DTV(TCBP, DTVP) \ - (((tcbhead_t *) (TCBP))->dtv = (DTVP) + 1) + (((tcbhead_t *) (TCBP))[-1].dtv = (DTVP) + 1) /* Install new dtv for current thread. */ # define INSTALL_NEW_DTV(DTV) \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv = (DTV)) + (THREAD_DTV() = (DTV)) /* Return dtv of given thread descriptor. */ # define GET_DTV(TCBP) \ - (((tcbhead_t *) (TCBP))->dtv) + (((tcbhead_t *) (TCBP))[-1].dtv) /* Code to initially initialize the thread pointer. This might need special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(TCBP, SECONDCALL) \ - (__builtin_set_thread_pointer (TCBP), 0) + (__builtin_set_thread_pointer ((void *) (tcbp) + TLS_TCB_OFFSET), NULL) /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv) + (((tcbhead_t *) (__builtin_thread_pointer () - TLS_TCB_OFFSET))[-1].dtv) /* Return the thread descriptor for the current thread. */ # undef THREAD_SELF # define THREAD_SELF \ + ((pthread_descr) (__builtin_thread_pointer () \ + - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)) ((pthread_descr)__builtin_thread_pointer () - 1) # undef INIT_THREAD_SELF # define INIT_THREAD_SELF(DESCR, NR) \ - __builtin_set_thread_pointer ((struct _pthread_descr_struct *)(DESCR) + 1) + __builtin_set_thread_pointer ((char *)(DESCR) \ + + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) /* Get the thread descriptor definition. */ # include --- libc/linuxthreads/sysdeps/i386/tls.h.jj 2003-05-06 01:43:42.000000000 -0400 +++ libc/linuxthreads/sysdeps/i386/tls.h 2003-07-18 05:29:09.000000000 -0400 @@ -81,7 +81,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- libc/linuxthreads/sysdeps/ia64/tls.h.jj 2003-03-02 06:44:20.000000000 -0500 +++ libc/linuxthreads/sysdeps/ia64/tls.h 2003-07-18 05:30:37.000000000 -0400 @@ -59,7 +59,14 @@ typedef struct # define TLS_TCB_SIZE sizeof (tcbhead_t) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- libc/linuxthreads/sysdeps/powerpc/tls.h.jj 2003-04-25 18:29:27.000000000 -0400 +++ libc/linuxthreads/sysdeps/powerpc/tls.h 2003-07-18 05:46:40.000000000 -0400 @@ -64,11 +64,19 @@ typedef struct # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE \ +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE \ (sizeof (struct _pthread_descr_struct) \ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# else +# include +# define TLS_PRE_TCB_SIZE \ + ((sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) \ + + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# endif -/* The following assumes that TP (R2 or R13) is points to the end of the +/* The following assumes that TP (R2 or R13) points to the end of the TCB + 0x7000 (per the ABI). This implies that TCB address is TP - 0x7000. As we define TLS_DTV_AT_TP we can assume that the pthread_descr is allocated immediately ahead of the --- libc/linuxthreads/sysdeps/pthread/res-state.c.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/linuxthreads/sysdeps/pthread/res-state.c 2003-07-17 08:31:58.000000000 -0400 @@ -39,7 +39,9 @@ __res_state (void) pthread_descr self = thread_self(); return LIBC_THREAD_GETMEM (self, p_resp); } -#endif return &_res; +#else + return __resp; +#endif } libc_hidden_def (__res_state) --- libc/linuxthreads/sysdeps/pthread/Makefile.jj 2003-03-19 12:57:45.000000000 -0500 +++ libc/linuxthreads/sysdeps/pthread/Makefile 2003-07-18 06:04:42.000000000 -0400 @@ -11,3 +11,15 @@ endif ifeq ($(subdir),posix) CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../linuxthreads/Banner)\"" endif + +ifeq ($(subdir),csu) +# Find out the size of NPTL struct pthread +ifneq (,$(wildcard $(..)nptl/descr.h)) +gen-as-const-headers += nptl-struct-pthread.sym +else +before-compile += $(common-objpfx)nptl-struct-pthread.h +common-generated += nptl-struct-pthread.h +$(common-objpfx)nptl-struct-pthread.h: + @echo '#define NPTL_STRUCT_PTHREAD_SIZE 0' > $@ +endif +endif --- libc/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym.jj 2003-07-17 13:12:30.000000000 -0400 +++ libc/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym 2003-07-18 05:16:42.000000000 -0400 @@ -0,0 +1,13 @@ +#ifdef HAVE_TLS_SUPPORT +# ifndef HAVE_FORCED_UNWIND +# define HAVE_FORCED_UNWIND 1 +# endif +# define __need_struct_pthread_size +# include +#endif + +-- + +#ifdef HAVE_TLS_SUPPORT +NPTL_STRUCT_PTHREAD_SIZE sizeof (struct pthread) +#endif --- libc/linuxthreads/sysdeps/s390/tls.h.jj 2003-01-30 13:34:11.000000000 -0500 +++ libc/linuxthreads/sysdeps/s390/tls.h 2003-07-18 05:48:00.000000000 -0400 @@ -72,7 +72,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- libc/linuxthreads/sysdeps/sh/tls.h.jj 2003-03-02 06:44:20.000000000 -0500 +++ libc/linuxthreads/sysdeps/sh/tls.h 2003-07-18 05:54:45.000000000 -0400 @@ -64,7 +64,14 @@ typedef struct # define TLS_TCB_SIZE sizeof (tcbhead_t) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- libc/linuxthreads/sysdeps/x86_64/tls.h.jj 2003-06-17 18:24:45.000000000 -0400 +++ libc/linuxthreads/sysdeps/x86_64/tls.h 2003-07-18 05:53:37.000000000 -0400 @@ -63,7 +63,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- libc/linuxthreads/manager.c.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/linuxthreads/manager.c 2003-07-17 08:31:58.000000000 -0400 @@ -28,6 +28,7 @@ #include #include /* for waitpid macros */ #include /* for __uselocale */ +#include /* for __resp */ #include #include "pthread.h" @@ -287,6 +288,9 @@ pthread_start_thread(void *arg) /* Initialize thread-locale current locale to point to the global one. With __thread support, the variable's initializer takes care of this. */ __uselocale (LC_GLOBAL_LOCALE); +#else + /* Initialize __resp. */ + __resp = &self->p_resp; #endif /* Make gdb aware of new thread */ if (__pthread_threads_debug && __pthread_sig_debug > 0) { --- libc/linuxthreads/libc-tls-loc.c.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/linuxthreads/libc-tls-loc.c 2003-07-17 08:31:58.000000000 -0400 @@ -43,7 +43,7 @@ __h_errno_location (void) struct __res_state * __res_state (void) { - return &_res; + return __resp; } #endif --- libc/linuxthreads/tst-_res1.c.jj 2003-07-18 06:18:48.000000000 -0400 +++ libc/linuxthreads/tst-_res1.c 2003-07-18 06:22:21.000000000 -0400 @@ -0,0 +1,69 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. + + 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. */ + +/* Test whether _res in glibc 2.1.x and earlier (before __res_state() + was introduced) works. Portable programs should never do the + dirty things below. */ + +#include +#include +#include +#include + +void *tf (void *resp) +{ + if (resp == &_res || resp == __res_state ()) + abort (); + _res.retry = 24; + return NULL; +} + +void do_test (struct __res_state *resp) +{ + if (resp != &_res || resp != __res_state ()) + abort (); + if (_res.retry != 12) + abort (); +} + +int main (void) +{ +#undef _res + extern struct __res_state _res; + pthread_t th; + + _res.retry = 12; + if (pthread_create (&th, NULL, tf, &_res) != 0) + { + puts ("create failed"); + exit (1); + } + + do_test (&_res); + + if (pthread_join (th, NULL) != 0) + { + puts ("join failed"); + exit (1); + } + + do_test (&_res); + + exit (0); +} --- libc/linuxthreads/tst-_res1mod1.c.jj 2003-07-18 06:22:35.000000000 -0400 +++ libc/linuxthreads/tst-_res1mod1.c 2003-07-18 06:22:52.000000000 -0400 @@ -0,0 +1,23 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. + + 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. */ + +#include +#undef _res + +struct __res_state _res; --- libc/linuxthreads/tst-_res1mod2.c.jj 2003-07-18 06:27:44.000000000 -0400 +++ libc/linuxthreads/tst-_res1mod2.c 2003-07-18 06:27:40.000000000 -0400 @@ -0,0 +1 @@ +/* Nothing. */ --- libc/linuxthreads/Makefile.jj 2003-06-09 22:19:43.000000000 -0400 +++ libc/linuxthreads/Makefile 2003-07-18 06:53:13.000000000 -0400 @@ -119,8 +119,17 @@ endif ifeq (yes,$(build-shared)) tests-nodelete-yes = unload +tests += tst-_res1 endif +modules-names = tst-_res1mod1 tst-_res1mod2 +extra-objs += $(addsuffix .os,$(strip $(modules-names))) +test-extras += $(modules-names) +test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) + +$(test-modules): $(objpfx)%.so: $(objpfx)%.os $(common-objpfx)shlib.lds + $(build-module) + all: # Make this the default target; it will be defined in Rules. # What we install as libpthread.so for programs to link against is in fact a @@ -288,6 +297,11 @@ otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libresolv.a endif +ifeq (yes,$(build-shared)) +$(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so +$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library) +endif + ifeq (no,$(cross-compiling)) ifeq (yes,$(build-shared)) tests: $(objpfx)tst-signal.out $(objpfx)tst-cancel-wrappers.out --- libc/resolv/res_libc.c.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/resolv/res_libc.c 2003-07-17 08:31:58.000000000 -0400 @@ -68,27 +68,26 @@ res_init(void) { /* This needs to be after the use of _res in res_init, above. */ #undef _res -#include - -#if USE___THREAD -/* With __thread support, this per-thread variable is used in all cases. */ -__thread struct __res_state _res; -extern __thread struct __res_state __libc_res __attribute__ ((alias ("_res"))) - attribute_hidden; -# define _res __libc_res -#else /* The resolver state for use by single-threaded programs. This differs from plain `struct __res_state _res;' in that it doesn't create a common definition, but a plain symbol that resides in .bss, which can have an alias. */ struct __res_state _res __attribute__((section (".bss"))); +#include + +#if USE___THREAD +#undef __resp +__thread struct __res_state *__resp = &_res; +extern __thread struct __res_state *__libc_resp + __attribute__ ((alias ("__resp"))) attribute_hidden; +#endif + /* We declare this with compat_symbol so that it's not visible at link time. Programs must use the accessor functions. */ -# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING -# include +#if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING +# include compat_symbol (libc, _res, _res, GLIBC_2_0); -# endif #endif #include --- libc/resolv/Versions.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/resolv/Versions 2003-07-17 08:31:58.000000000 -0400 @@ -4,9 +4,11 @@ libc { GLIBC_2.0 { %if !(USE_TLS && HAVE___THREAD) # global variables - _h_errno; _res; + _h_errno; %endif + _res; + # helper functions __h_errno_location; @@ -34,7 +36,7 @@ libc { %if USE_TLS && HAVE___THREAD # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol. - h_errno; _res; + h_errno; __resp; %endif } } --- libc/sysdeps/generic/res-state.c.jj 2003-07-17 07:42:15.000000000 -0400 +++ libc/sysdeps/generic/res-state.c 2003-07-17 08:31:58.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 97, 98, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996, 97, 98, 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 @@ -20,17 +20,26 @@ #include #if ! USE___THREAD + # undef _res extern struct __res_state _res; -#endif /* When threaded, _res may be a per-thread variable. */ struct __res_state * -#if ! USE___THREAD weak_const_function -#endif __res_state (void) { return &_res; } + +#else + +struct __res_state * +__res_state (void) +{ + return __resp; +} + +#endif + libc_hidden_def (__res_state) Jakub From aj@suse.de Sun Jul 20 12:11:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Sun, 20 Jul 2003 12:11:00 -0000 Subject: Fix cp932/euc-jp-ms Message-ID: These modules used a non-existant macro, I've followed Bruno's change from 2002-05-26 and committed the appended patch, Andreas 2003-07-20 Andreas Jaeger * iconvdata/cp932.c (BODY): STANDARD_ERR_HANDLER is now called STANDARD_TO_LOOP_ERR_HANDLER. * iconvdata/euc-jp-ms.c (BODY): Likewise. ============================================================ Index: iconvdata/cp932.c --- iconvdata/cp932.c 14 Jul 2003 23:17:31 -0000 1.1 +++ iconvdata/cp932.c 20 Jul 2003 12:08:58 -0000 @@ -1,5 +1,5 @@ /* Mapping tables for CP932 handling. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2000,2001,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by MORIYAMA Masayuki , 2003. @@ -4708,7 +4708,7 @@ static const char from_ucs4_extra[229][2 if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0) \ { \ /* Illegal character. */ \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ else \ { \ ============================================================ Index: iconvdata/euc-jp-ms.c --- iconvdata/euc-jp-ms.c 14 Jul 2003 23:27:00 -0000 1.1 +++ iconvdata/euc-jp-ms.c 20 Jul 2003 12:09:02 -0000 @@ -1,5 +1,5 @@ /* Mapping tables for EUCJP-MS handling. - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by MORIYAMA Masayuki , 2003. @@ -4857,7 +4857,7 @@ static const char from_ucs4_extra[229][2 if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0) \ { \ /* Illegal character. */ \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ else \ { \ -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N??rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 From jakub@redhat.com Mon Jul 21 11:38:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 21 Jul 2003 11:38:00 -0000 Subject: [PATCH] Fix amd64 ldconfig Message-ID: <20030721113852.GW20507@sunsite.ms.mff.cuni.cz> Hi! amd64 ldconfig does not handle IA-32 hwcaps and platforms, say if you have libraries in /lib/i686 and /lib, it will only record those in /lib and never those in /lib/i686. This is because amd64 uses generic dl-procinfo.[ch] while i386 linux uses its own. The following patch fixes this (by using the i386 dl-procinfo.[ch] in ldconfig and generic (dummy) dl-procinfo.[ch] in 64-bit ld.so, statically linked 64-bit apps etc.). 2003-07-21 Jakub Jelinek * elf/Makefile (CFLAGS-ldconfig.c): Define IS_IN_ldconfig. * elf/ldconfig.c: Include dl-procinfo.c. * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: New file. * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: New file. --- libc/elf/Makefile.jj 2003-06-02 18:43:44.000000000 -0400 +++ libc/elf/Makefile 2003-07-21 07:25:14.000000000 -0400 @@ -335,7 +335,7 @@ $(objpfx)sprof: $(libdl) $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' -CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' +CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) --- libc/elf/ldconfig.c.jj 2003-06-25 04:01:04.000000000 -0400 +++ libc/elf/ldconfig.c 2003-07-21 07:26:45.000000000 -0400 @@ -132,6 +132,8 @@ static const struct argp_option options[ { NULL, 0, NULL, 0, NULL, 0 } }; +#include + /* Short description of program. */ static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); --- libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c.jj 2003-07-21 07:25:36.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c 2003-07-21 07:24:36.000000000 -0400 @@ -0,0 +1,5 @@ +#ifdef IS_IN_ldconfig +#include +#else +#include +#endif --- libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h.jj 2003-07-21 07:25:36.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h 2003-07-21 07:24:14.000000000 -0400 @@ -0,0 +1,5 @@ +#ifdef IS_IN_ldconfig +#include +#else +#include +#endif Jakub From drepper@redhat.com Mon Jul 21 22:11:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 21 Jul 2003 22:11:00 -0000 Subject: [PATCH] Fix amd64 ldconfig In-Reply-To: <20030721113852.GW20507@sunsite.ms.mff.cuni.cz> References: <20030721113852.GW20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F1C64C2.2040901@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-21 Jakub Jelinek > > * elf/Makefile (CFLAGS-ldconfig.c): Define IS_IN_ldconfig. > * elf/ldconfig.c: Include dl-procinfo.c. > * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: New file. > * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: New file. This patch doesn't work in x86. You end up with duplicated definitions. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/HGTC2ijCOnn/RHQRAvPCAKCHKCP5EjSbh8laobKvxa5IkmpZawCgiud8 EXvHGr3wbxk6lFNCuzKUVFY= =Y0y9 -----END PGP SIGNATURE----- From drepper@redhat.com Tue Jul 22 00:06:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 22 Jul 2003 00:06:00 -0000 Subject: [PATCH] Binary compatibility fix for _res@GLIBC_2.0 In-Reply-To: <20030718122031.GV20507@sunsite.ms.mff.cuni.cz> References: <20030718122031.GV20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F1C7FA6.1020206@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > --- libc/nptl/descr.h.jj 2003-07-08 09:54:08.000000000 -0400 > +++ libc/nptl/descr.h 2003-07-17 13:58:42.000000000 -0400 > @@ -27,15 +27,20 @@ > #include > #include > #include > +#ifdef __need_struct_pthread_size > +#define lll_lock_t int > +#else > #include > #include > #include > +#endif Why is this necessary? - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/HH+m2ijCOnn/RHQRAqMYAKCUErxl1cLnKbjuySfvq35L8Rr+FACfcg36 cCh8LgDX7e1X7NuQ0tQDGd0= =sEFW -----END PGP SIGNATURE----- From jakub@redhat.com Tue Jul 22 06:47:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 22 Jul 2003 06:47:00 -0000 Subject: [PATCH] Binary compatibility fix for _res@GLIBC_2.0 In-Reply-To: <3F1C7FA6.1020206@redhat.com> References: <20030718122031.GV20507@sunsite.ms.mff.cuni.cz> <3F1C7FA6.1020206@redhat.com> Message-ID: <20030722064735.GZ20507@sunsite.ms.mff.cuni.cz> On Mon, Jul 21, 2003 at 05:04:54PM -0700, Ulrich Drepper wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jakub Jelinek wrote: > > > --- libc/nptl/descr.h.jj 2003-07-08 09:54:08.000000000 -0400 > > +++ libc/nptl/descr.h 2003-07-17 13:58:42.000000000 -0400 > > @@ -27,15 +27,20 @@ > > #include > > #include > > #include > > +#ifdef __need_struct_pthread_size > > +#define lll_lock_t int > > +#else > > #include > > #include > > #include > > +#endif > > Why is this necessary? linuxthreads ld.so needs to know the size of NPTL struct pthread. But when nptl-struct-pthread.sym is being compiled, it of course does not have all the nptl necessary sysdep dirs in -I options, it has linuxthreads instead. Alternative to the above would be to add dummy lowlevellock.h and pthreaddef.h headers to linuxthreads/sysdeps/pthread (where that dummy lowlevellock.h would typedef int lll_lock_t; and pthreadef.h would be empty). Jakub From aj@suse.de Tue Jul 22 11:12:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Tue, 22 Jul 2003 11:12:00 -0000 Subject: Check for ET_DYN in ldconfig Message-ID: Here's another sanity check: We check that a shared library is indeed a shared object. Ok to commit? Andreas 2003-07-22 Andreas Jaeger * elf/readlib.c (process_file): Check that file is a shared object. ============================================================ Index: elf/readlib.c --- elf/readlib.c 5 Sep 2002 18:51:48 -0000 1.13 +++ elf/readlib.c 22 Jul 2003 11:11:42 -0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -157,6 +157,13 @@ process_file (const char *real_file_name && memmem (file_contents, len, "GNU ld script", 13) == NULL) error (0, 0, _("%s is not an ELF file - it has the wrong magic bytes at the start.\n"), file_name); + ret = 1; + goto done; + } + + /* Libraries have to be shared object files. */ + if (!elf_header->e_type & ET_DYN) + { ret = 1; goto done; } -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N??rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 From jakub@redhat.com Tue Jul 22 17:40:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 22 Jul 2003 17:40:00 -0000 Subject: [PATCH] Fix amd64 ldconfig (take 2) In-Reply-To: <3F1C64C2.2040901@redhat.com> References: <20030721113852.GW20507@sunsite.ms.mff.cuni.cz> <3F1C64C2.2040901@redhat.com> Message-ID: <20030722174031.GF20507@sunsite.ms.mff.cuni.cz> Hi! On Mon, Jul 21, 2003 at 03:10:10PM -0700, Ulrich Drepper wrote: > This patch doesn't work in x86. You end up with duplicated definitions. What about this then? 2003-07-22 Jakub Jelinek * elf/Makefile (CFLAGS-ldconfig.c): Define IS_IN_ldconfig. * elf/ldconfig.c: Include dl-procinfo.c. (PROCINFO_CLASS): Define. * sysdeps/generic/ldsodefs.h (PROCINFO_CLASS): Define. * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: New file. * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: New file. * sysdeps/unix/sysv/linux/i386/dl-procinfo.c (PROCINFO_CLASS): Define if not yet defined. Use it instead of EXTERN. Undefine at the end of the file. * sysdeps/unix/sysv/linux/arm/dl-procinfo.c (PROCINFO_CLASS): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c (PROCINFO_CLASS): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c (PROCINFO_CLASS): Likewise. --- libc/elf/Makefile.jj 2003-06-02 18:43:44.000000000 -0400 +++ libc/elf/Makefile 2003-07-22 12:35:17.000000000 -0400 @@ -335,7 +335,7 @@ $(objpfx)sprof: $(libdl) $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' -CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' +CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) --- libc/elf/ldconfig.c.jj 2003-06-25 04:01:04.000000000 -0400 +++ libc/elf/ldconfig.c 2003-07-22 12:39:10.000000000 -0400 @@ -132,6 +132,9 @@ static const struct argp_option options[ { NULL, 0, NULL, 0, NULL, 0 } }; +#define PROCINFO_CLASS static +#include + /* Short description of program. */ static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); --- libc/sysdeps/generic/ldsodefs.h.jj 2003-06-11 18:24:33.000000000 -0400 +++ libc/sysdeps/generic/ldsodefs.h 2003-07-22 12:38:44.000000000 -0400 @@ -343,6 +343,7 @@ struct rtld_global /* Get architecture specific definitions. */ #define PROCINFO_DECL +#define PROCINFO_CLASS EXTERN #include /* Structure describing the dynamic linker itself. */ --- libc/sysdeps/unix/sysv/linux/arm/dl-procinfo.c.jj 2002-04-03 01:54:28.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/arm/dl-procinfo.c 2003-07-22 12:46:16.000000000 -0400 @@ -1,5 +1,5 @@ /* Data for Linux/ARM version of processor capability information. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 2001. @@ -40,13 +40,14 @@ needed. */ -#ifdef PROCINFO_DECL -EXTERN +#ifndef PROCINFO_CLASS +#define PROCINFO_CLASS #endif + #if !defined PROCINFO_DECL && defined SHARED ._dl_arm_cap_flags #else -const char _dl_arm_cap_flags[8][10] +PROCINFO_CLASS const char _dl_arm_cap_flags[8][10] #endif #ifndef PROCINFO_DECL = { @@ -60,3 +61,4 @@ const char _dl_arm_cap_flags[8][10] #endif #undef PROCINFO_DECL +#undef PROCINFO_CLASS --- libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.c.jj 2003-01-14 04:59:45.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.c 2003-07-22 12:42:00.000000000 -0400 @@ -40,13 +40,14 @@ needed. */ -#ifdef PROCINFO_DECL -EXTERN +#ifndef PROCINFO_CLASS +#define PROCINFO_CLASS #endif + #if !defined PROCINFO_DECL && defined SHARED ._dl_x86_cap_flags #else -const char _dl_x86_cap_flags[32][8] +PROCINFO_CLASS const char _dl_x86_cap_flags[32][8] #endif #ifndef PROCINFO_DECL = { @@ -62,13 +63,10 @@ const char _dl_x86_cap_flags[32][8] , #endif -#ifdef PROCINFO_DECL -EXTERN -#endif #if !defined PROCINFO_DECL && defined SHARED ._dl_x86_platforms #else -const char _dl_x86_platforms[4][5] +PROCINFO_CLASS const char _dl_x86_platforms[4][5] #endif #ifndef PROCINFO_DECL = { @@ -82,3 +80,4 @@ const char _dl_x86_platforms[4][5] #endif #undef PROCINFO_DECL +#undef PROCINFO_CLASS --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c.jj 2002-02-01 14:04:37.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c 2003-07-22 12:46:02.000000000 -0400 @@ -1,5 +1,5 @@ /* Data for Linux/sparc32 version of processor capability information. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2002. @@ -40,13 +40,14 @@ needed. */ -#ifdef PROCINFO_DECL -EXTERN +#ifndef PROCINFO_CLASS +#define PROCINFO_CLASS #endif + #if !defined PROCINFO_DECL && defined SHARED ._dl_sparc32_cap_flags #else -const char _dl_sparc32_cap_flags[6][7] +PROCINFO_CLASS const char _dl_sparc32_cap_flags[6][7] #endif #ifndef PROCINFO_DECL = { @@ -60,3 +61,4 @@ const char _dl_sparc32_cap_flags[6][7] #endif #undef PROCINFO_DECL +#undef PROCINFO_CLASS --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c.jj 2002-02-01 14:04:15.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c 2003-07-22 12:45:51.000000000 -0400 @@ -1,5 +1,5 @@ /* Data for Linux/sparc64 version of processor capability information. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2002. @@ -40,13 +40,14 @@ needed. */ -#ifdef PROCINFO_DECL -EXTERN +#ifndef PROCINFO_CLASS +#define PROCINFO_CLASS #endif + #if !defined PROCINFO_DECL && defined SHARED ._dl_sparc64_cap_flags #else -const char _dl_sparc64_cap_flags[6][7] +PROCINFO_CLASS const char _dl_sparc64_cap_flags[6][7] #endif #ifndef PROCINFO_DECL = { @@ -60,3 +61,4 @@ const char _dl_sparc64_cap_flags[6][7] #endif #undef PROCINFO_DECL +#undef PROCINFO_CLASS --- libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c.jj 2003-07-22 12:35:17.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c 2003-07-22 12:35:17.000000000 -0400 @@ -0,0 +1,5 @@ +#ifdef IS_IN_ldconfig +#include +#else +#include +#endif --- libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h.jj 2003-07-22 12:35:17.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h 2003-07-22 12:35:17.000000000 -0400 @@ -0,0 +1,5 @@ +#ifdef IS_IN_ldconfig +#include +#else +#include +#endif Jakub From roland@redhat.com Tue Jul 22 19:44:00 2003 From: roland@redhat.com (Roland McGrath) Date: Tue, 22 Jul 2003 19:44:00 -0000 Subject: Check for ET_DYN in ldconfig In-Reply-To: Andreas Jaeger's message of Tuesday, 22 July 2003 13:12:16 +0200 Message-ID: <200307221944.h6MJiJf24825@magilla.sf.frob.com> > + /* Libraries have to be shared object files. */ > + if (!elf_header->e_type & ET_DYN) This is plainly nutso. elf_header->e_type != ET_DYN is the only that makes sense. From aj@suse.de Tue Jul 22 19:45:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Tue, 22 Jul 2003 19:45:00 -0000 Subject: Check for ET_DYN in ldconfig In-Reply-To: <200307221944.h6MJiJf24825@magilla.sf.frob.com> (Roland McGrath's message of "Tue, 22 Jul 2003 12:44:19 -0700") References: <200307221944.h6MJiJf24825@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> + /* Libraries have to be shared object files. */ >> + if (!elf_header->e_type & ET_DYN) > > This is plainly nutso. elf_header->e_type != ET_DYN is the only that makes > sense. Ok with that change, then? Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N??rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 From drepper@redhat.com Tue Jul 22 19:53:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 22 Jul 2003 19:53:00 -0000 Subject: Check for ET_DYN in ldconfig In-Reply-To: References: Message-ID: <3F1D9609.6040304@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jaeger wrote: > Here's another sanity check: We check that a shared library is indeed > a shared object. > > Ok to commit? Yes. But also change the last gotos in an "else if" cascade. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/HZYJ2ijCOnn/RHQRAvkoAKCx270uAS+xftFXDcKI1e/wy5r+mgCfYgo1 HjekqviZ0y5/kIFvZEU79Qs= =AqgM -----END PGP SIGNATURE----- From drepper@redhat.com Tue Jul 22 22:08:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 22 Jul 2003 22:08:00 -0000 Subject: [PATCH] Fix amd64 ldconfig (take 2) In-Reply-To: <20030722174031.GF20507@sunsite.ms.mff.cuni.cz> References: <20030721113852.GW20507@sunsite.ms.mff.cuni.cz> <3F1C64C2.2040901@redhat.com> <20030722174031.GF20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F1DB57B.8000705@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > What about this then? Looks OK, I've applied it. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/HbV72ijCOnn/RHQRAmRBAJ9YzEtyAXibJ4EXo2LZQLlpRPDTuwCeOcE8 akqU4EOrvcVG8p2EvOS0Ezo= =bGuy -----END PGP SIGNATURE----- From jakub@redhat.com Fri Jul 25 08:26:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 25 Jul 2003 08:26:00 -0000 Subject: [PATCH] Avoid using in Message-ID: <20030725082542.GL20507@sunsite.ms.mff.cuni.cz> Hi! asm/a.out.h kernel header's role seems to be primarily to make binfmt_elf work in the kernel. Better if glibc avoids it. 2003-07-25 Jakub Jelinek * sysdeps/unix/sysv/linux/a.out.h: Replace with i386 version. Include bits/a.out.h. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add bits/a.out.h. * sysdeps/unix/sysv/linux/bits/a.out.h: New file. * sysdeps/unix/sysv/linux/i386/bits/a.out.h: New file. * sysdeps/unix/sysv/linux/m68k/bits/a.out.h: New file. * sysdeps/unix/sysv/linux/x86_64/bits/a.out.h: New file. * sysdeps/unix/sysv/linux/alpha/a.out.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/a.out.h: New file. * sysdeps/unix/sysv/linux/sparc/a.out.h: New file. * sysdeps/unix/sysv/linux/sparc/bits/a.out.h: New file. --- libc/sysdeps/unix/sysv/linux/alpha/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/alpha/bits/a.out.h 2003-07-25 03:47:22.000000000 -0400 @@ -0,0 +1,3 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif --- libc/sysdeps/unix/sysv/linux/alpha/a.out.h.jj 2003-07-25 03:48:19.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/alpha/a.out.h 2003-07-25 04:18:16.000000000 -0400 @@ -1,5 +1,197 @@ -#ifdef _LIBC -# include_next -#else -# include -#endif +#ifndef __A_OUT_GNU_H__ +#define __A_OUT_GNU_H__ + +#include + +#define __GNU_EXEC_MACROS__ + +/* + * OSF/1 ECOFF header structs. ECOFF files consist of: + * - a file header (struct filehdr), + * - an a.out header (struct aouthdr), + * - one or more section headers (struct scnhdr). + * The filhdr's "f_nscns" field contains the + * number of section headers. + */ + +struct filehdr +{ + /* OSF/1 "file" header */ + unsigned short f_magic, f_nscns; + unsigned int f_timdat; + unsigned long f_symptr; + unsigned int f_nsyms; + unsigned short f_opthdr, f_flags; +}; + +struct aouthdr +{ + unsigned long info; /* After that it looks quite normal.. */ + unsigned long tsize; + unsigned long dsize; + unsigned long bsize; + unsigned long entry; + unsigned long text_start; /* With a few additions that actually make sense. */ + unsigned long data_start; + unsigned long bss_start; + unsigned int gprmask, fprmask; /* Bitmask of general & floating point regs used in binary. */ + unsigned long gpvalue; +}; + +struct scnhdr +{ + char s_name[8]; + unsigned long s_paddr; + unsigned long s_vaddr; + unsigned long s_size; + unsigned long s_scnptr; + unsigned long s_relptr; + unsigned long s_lnnoptr; + unsigned short s_nreloc; + unsigned short s_nlnno; + unsigned int s_flags; +}; + +struct exec +{ + /* OSF/1 "file" header */ + struct filehdr fh; + struct aouthdr ah; +}; + +#define a_info ah.info +#define a_text ah.tsize +#define a_data ah.dsize +#define a_bss ah.bsize +#define a_entry ah.entry +#define a_textstart ah.text_start +#define a_datastart ah.data_start +#define a_bssstart ah.bss_start +#define a_gprmask ah.gprmask +#define a_fprmask ah.fprmask +#define a_gpvalue ah.gpvalue + + +#define AOUTHSZ sizeof(struct aouthdr) +#define SCNHSZ sizeof(struct scnhdr) +#define SCNROUND 16 + +enum machine_type +{ + M_OLDSUN2 = 0, + M_68010 = 1, + M_68020 = 2, + M_SPARC = 3, + M_386 = 100, + M_MIPS1 = 151, + M_MIPS2 = 152 +}; + +#define N_MAGIC(exec) ((exec).a_info & 0xffff) +#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) +#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) +#define N_SET_INFO(exec, magic, type, flags) \ + ((exec).a_info = ((magic) & 0xffff) \ + | (((int)(type) & 0xff) << 16) \ + | (((flags) & 0xff) << 24)) +#define N_SET_MAGIC(exec, magic) \ + ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) +#define N_SET_MACHTYPE(exec, machtype) \ + ((exec).a_info = \ + ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) +#define N_SET_FLAGS(exec, flags) \ + ((exec).a_info = \ + ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) + +/* Code indicating object file or impure executable. */ +#define OMAGIC 0407 +/* Code indicating pure executable. */ +#define NMAGIC 0410 +/* Code indicating demand-paged executable. */ +#define ZMAGIC 0413 +/* This indicates a demand-paged executable with the header in the text. + The first page is unmapped to help trap NULL pointer references. */ +#define QMAGIC 0314 +/* Code indicating core file. */ +#define CMAGIC 0421 + +#define N_TRSIZE(x) 0 +#define N_DRSIZE(x) 0 +#define N_SYMSIZE(x) 0 +#define N_BADMAG(x) \ + (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ + && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) +#define _N_HDROFF(x) (1024 - sizeof (struct exec)) +#define N_TXTOFF(x) \ + ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ + (sizeof (struct exec) + (x).fh.f_nscns * SCNHSZ + SCNROUND - 1) \ + & ~(SCNROUND - 1)) + +#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) +#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) +#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) +#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) +#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) + +/* Address of text segment in memory after it is loaded. */ +#define N_TXTADDR(x) ((x).a_textstart) + +/* Address of data segment in memory after it is loaded. */ +#define SEGMENT_SIZE 1024 + +#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) +#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) + +#define N_DATADDR(x) ((x).a_datastart) +#define N_BSSADDR(x) ((x).a_bssstart) + +#if !defined (N_NLIST_DECLARED) +struct nlist +{ + union + { + char *n_name; + struct nlist *n_next; + long n_strx; + } n_un; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; +}; +#endif /* no N_NLIST_DECLARED. */ + +#define N_UNDF 0 +#define N_ABS 2 +#define N_TEXT 4 +#define N_DATA 6 +#define N_BSS 8 +#define N_FN 15 +#define N_EXT 1 +#define N_TYPE 036 +#define N_STAB 0340 +#define N_INDR 0xa +#define N_SETA 0x14 /* Absolute set element symbol. */ +#define N_SETT 0x16 /* Text set element symbol. */ +#define N_SETD 0x18 /* Data set element symbol. */ +#define N_SETB 0x1A /* Bss set element symbol. */ +#define N_SETV 0x1C /* Pointer to set vector in data area. */ + +#if !defined (N_RELOCATION_INFO_DECLARED) +/* This structure describes a single relocation to be performed. + The text-relocation section of the file is a vector of these structures, + all of which apply to the text section. + Likewise, the data-relocation section applies to the data section. */ + +struct relocation_info +{ + int r_address; + unsigned int r_symbolnum:24; + unsigned int r_pcrel:1; + unsigned int r_length:2; + unsigned int r_extern:1; + unsigned int r_pad:4; +}; +#endif /* no N_RELOCATION_INFO_DECLARED. */ + +#endif /* __A_OUT_GNU_H__ */ --- libc/sysdeps/unix/sysv/linux/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/bits/a.out.h 2003-07-25 03:46:41.000000000 -0400 @@ -0,0 +1,7 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif + +/* Signal to users of this header that this architecture really doesn't + support a.out binary format. */ +#define __NO_A_OUT_SUPPORT 1 --- libc/sysdeps/unix/sysv/linux/i386/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/i386/bits/a.out.h 2003-07-25 03:47:22.000000000 -0400 @@ -0,0 +1,3 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif --- libc/sysdeps/unix/sysv/linux/m68k/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/m68k/bits/a.out.h 2003-07-25 03:47:22.000000000 -0400 @@ -0,0 +1,3 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif --- libc/sysdeps/unix/sysv/linux/sparc/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sparc/bits/a.out.h 2003-07-25 03:47:54.000000000 -0400 @@ -0,0 +1,13 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 64 + +/* Signal to users of this header that this architecture really doesn't + support a.out binary format. */ +#define __NO_A_OUT_SUPPORT 1 + +#endif --- libc/sysdeps/unix/sysv/linux/sparc/a.out.h.jj 2003-07-25 03:52:23.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sparc/a.out.h 2003-07-25 04:02:14.000000000 -0400 @@ -0,0 +1,174 @@ +#ifndef __A_OUT_GNU_H__ +#define __A_OUT_GNU_H__ + +#include + +#define __GNU_EXEC_MACROS__ + +struct exec +{ + unsigned char a_dynamic:1; /* A __DYNAMIC is in this image. */ + unsigned char a_toolversion:7; + unsigned char a_machtype; + unsigned short a_info; + unsigned int a_text; /* Length of text, in bytes. */ + unsigned int a_data; /* Length of data, in bytes. */ + unsigned int a_bss; /* Length of bss, in bytes. */ + unsigned int a_syms; /* Length of symbol table, in bytes. */ + unsigned int a_entry; /* Where program begins. */ + unsigned int a_trsize; + unsigned int a_drsize; +}; + +enum machine_type +{ + M_OLDSUN2 = 0, + M_68010 = 1, + M_68020 = 2, + M_SPARC = 3, + M_386 = 100, + M_MIPS1 = 151, + M_MIPS2 = 152 +}; + +#define N_MAGIC(exec) ((exec).a_info & 0xffff) +#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) +#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) +#define N_SET_INFO(exec, magic, type, flags) \ + ((exec).a_info = ((magic) & 0xffff) \ + | (((int)(type) & 0xff) << 16) \ + | (((flags) & 0xff) << 24)) +#define N_SET_MAGIC(exec, magic) \ + ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) +#define N_SET_MACHTYPE(exec, machtype) \ + ((exec).a_info = \ + ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) +#define N_SET_FLAGS(exec, flags) \ + ((exec).a_info = \ + ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) + +/* Code indicating object file or impure executable. */ +#define OMAGIC 0407 +/* Code indicating pure executable. */ +#define NMAGIC 0410 +/* Code indicating demand-paged executable. */ +#define ZMAGIC 0413 +/* This indicates a demand-paged executable with the header in the text. + The first page is unmapped to help trap NULL pointer references. */ +#define QMAGIC 0314 +/* Code indicating core file. */ +#define CMAGIC 0421 + +#define N_TRSIZE(a) ((a).a_trsize) +#define N_DRSIZE(a) ((a).a_drsize) +#define N_SYMSIZE(a) ((a).a_syms) +#define N_BADMAG(x) \ + (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ + && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) +#define _N_HDROFF(x) (1024 - sizeof (struct exec)) +#define N_TXTOFF(x) \ + (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) +#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) +#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) +#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) +#define N_SYMOFF(x) \ + (N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize) +#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) + +#define SPARC_PGSIZE 0x2000 + +/* Address of text segment in memory after it is loaded. */ +#define N_TXTADDR(x) \ + (unsigned long)(((N_MAGIC(x) == ZMAGIC) && ((x).a_entry < SPARC_PGSIZE)) \ + ? 0 : SPARC_PGSIZE) + +/* Address of data segment in memory after it is loaded. */ +#define SEGMENT_SIZE SPARC_PGSIZE + +#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) +#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) + +#define N_DATADDR(x) \ + (N_MAGIC(x)==OMAGIC \ + ? (N_TXTADDR(x) + (x).a_text) \ + : (unsigned long)(_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) +#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) + +#if !defined (N_NLIST_DECLARED) +struct nlist +{ + union + { + char *n_name; + struct nlist *n_next; + long n_strx; + } n_un; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; +}; +#endif /* no N_NLIST_DECLARED. */ + +#define N_UNDF 0 +#define N_ABS 2 +#define N_TEXT 4 +#define N_DATA 6 +#define N_BSS 8 +#define N_FN 15 +#define N_EXT 1 +#define N_TYPE 036 +#define N_STAB 0340 +#define N_INDR 0xa +#define N_SETA 0x14 /* Absolute set element symbol. */ +#define N_SETT 0x16 /* Text set element symbol. */ +#define N_SETD 0x18 /* Data set element symbol. */ +#define N_SETB 0x1A /* Bss set element symbol. */ +#define N_SETV 0x1C /* Pointer to set vector in data area. */ + +#if !defined (N_RELOCATION_INFO_DECLARED) +enum reloc_type +{ + RELOC_8, + RELOC_16, + RELOC_32, + RELOC_DISP8, + RELOC_DISP16, + RELOC_DISP32, + RELOC_WDISP30, + RELOC_WDISP22, + RELOC_HI22, + RELOC_22, + RELOC_13, + RELOC_LO10, + RELOC_SFA_BASE, + RELOC_SFA_OFF13, + RELOC_BASE10, + RELOC_BASE13, + RELOC_BASE22, + RELOC_PC10, + RELOC_PC22, + RELOC_JMP_TBL, + RELOC_SEGOFF16, + RELOC_GLOB_DAT, + RELOC_JMP_SLOT, + RELOC_RELATIVE +}; + +/* This structure describes a single relocation to be performed. + The text-relocation section of the file is a vector of these structures, + all of which apply to the text section. + Likewise, the data-relocation section applies to the data section. */ + +struct relocation_info +{ + unsigned int r_address; + unsigned int r_index:24; + unsigned int r_extern:1; + int r_pad:2; + enum reloc_type r_type:5; + int r_addend; +}; +#endif /* no N_RELOCATION_INFO_DECLARED. */ + +#endif /* __A_OUT_GNU_H__ */ --- libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h.jj 2003-07-25 03:46:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h 2003-07-25 03:47:54.000000000 -0400 @@ -0,0 +1,13 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 64 + +/* Signal to users of this header that this architecture really doesn't + support a.out binary format. */ +#define __NO_A_OUT_SUPPORT 1 + +#endif --- libc/sysdeps/unix/sysv/linux/a.out.h.jj 2003-07-25 03:48:19.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/a.out.h 2003-07-25 04:04:47.000000000 -0400 @@ -1,5 +1,138 @@ -#ifdef _LIBC -# include_next -#else -# include -#endif +#ifndef __A_OUT_GNU_H__ +#define __A_OUT_GNU_H__ + +#include + +#define __GNU_EXEC_MACROS__ + +struct exec +{ + unsigned long a_info; /* Use macros N_MAGIC, etc for access. */ + unsigned int a_text; /* Length of text, in bytes. */ + unsigned int a_data; /* Length of data, in bytes. */ + unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */ + unsigned int a_syms; /* Length of symbol table data in file, in bytes. */ + unsigned int a_entry; /* Start address. */ + unsigned int a_trsize;/* Length of relocation info for text, in bytes. */ + unsigned int a_drsize;/* Length of relocation info for data, in bytes. */ +}; + +enum machine_type +{ + M_OLDSUN2 = 0, + M_68010 = 1, + M_68020 = 2, + M_SPARC = 3, + M_386 = 100, + M_MIPS1 = 151, + M_MIPS2 = 152 +}; + +#define N_MAGIC(exec) ((exec).a_info & 0xffff) +#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) +#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) +#define N_SET_INFO(exec, magic, type, flags) \ + ((exec).a_info = ((magic) & 0xffff) \ + | (((int)(type) & 0xff) << 16) \ + | (((flags) & 0xff) << 24)) +#define N_SET_MAGIC(exec, magic) \ + ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) +#define N_SET_MACHTYPE(exec, machtype) \ + ((exec).a_info = \ + ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) +#define N_SET_FLAGS(exec, flags) \ + ((exec).a_info = \ + ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) + +/* Code indicating object file or impure executable. */ +#define OMAGIC 0407 +/* Code indicating pure executable. */ +#define NMAGIC 0410 +/* Code indicating demand-paged executable. */ +#define ZMAGIC 0413 +/* This indicates a demand-paged executable with the header in the text. + The first page is unmapped to help trap NULL pointer references. */ +#define QMAGIC 0314 +/* Code indicating core file. */ +#define CMAGIC 0421 + +#define N_TRSIZE(a) ((a).a_trsize) +#define N_DRSIZE(a) ((a).a_drsize) +#define N_SYMSIZE(a) ((a).a_syms) +#define N_BADMAG(x) \ + (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ + && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) +#define _N_HDROFF(x) (1024 - sizeof (struct exec)) +#define N_TXTOFF(x) \ + (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \ + (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) +#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) +#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) +#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) +#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) +#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) + +/* Address of text segment in memory after it is loaded. */ +#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? 4096 : 0) + +/* Address of data segment in memory after it is loaded. */ +#define SEGMENT_SIZE 1024 + +#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) +#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) + +#define N_DATADDR(x) \ + (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \ + : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) +#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) + +#if !defined (N_NLIST_DECLARED) +struct nlist +{ + union + { + char *n_name; + struct nlist *n_next; + long n_strx; + } n_un; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; +}; +#endif /* no N_NLIST_DECLARED. */ + +#define N_UNDF 0 +#define N_ABS 2 +#define N_TEXT 4 +#define N_DATA 6 +#define N_BSS 8 +#define N_FN 15 +#define N_EXT 1 +#define N_TYPE 036 +#define N_STAB 0340 +#define N_INDR 0xa +#define N_SETA 0x14 /* Absolute set element symbol. */ +#define N_SETT 0x16 /* Text set element symbol. */ +#define N_SETD 0x18 /* Data set element symbol. */ +#define N_SETB 0x1A /* Bss set element symbol. */ +#define N_SETV 0x1C /* Pointer to set vector in data area. */ + +#if !defined (N_RELOCATION_INFO_DECLARED) +/* This structure describes a single relocation to be performed. + The text-relocation section of the file is a vector of these structures, + all of which apply to the text section. + Likewise, the data-relocation section applies to the data section. */ + +struct relocation_info +{ + int r_address; + unsigned int r_symbolnum:24; + unsigned int r_pcrel:1; + unsigned int r_length:2; + unsigned int r_extern:1; + unsigned int r_pad:4; +}; +#endif /* no N_RELOCATION_INFO_DECLARED. */ + +#endif /* __A_OUT_GNU_H__ */ --- libc/sysdeps/unix/sysv/linux/Makefile.jj 2003-06-11 18:31:09.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/Makefile 2003-07-25 04:21:22.000000000 -0400 @@ -21,7 +21,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/kd.h sys/soundcard.h sys/vt.h \ sys/quota.h sys/fsuid.h \ scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \ - sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h + sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \ + bits/a.out.h install-others += $(inst_includedir)/bits/syscall.h Jakub From aj@suse.de Fri Jul 25 08:41:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Fri, 25 Jul 2003 08:41:00 -0000 Subject: glibc does not build on i686-linux-gnu Message-ID: Building current glibc with GCC 3.4 I get: make[3]: Leaving directory `/usr/src/cvs/libc/elf' /opt/gcc/3.4-devel/bin/gcc -nostdlib -nostartfiles -r -o /builds/glibc/gcc-3.4/elf/librtld.os '-Wl,-(' /builds/glibc/gcc-3.4/elf/dl-allobjs.os /builds/glibc/gcc-3.4/elf/rtld-libc.a -lgcc '-Wl,-)' /opt/gcc/3.4-devel/bin/gcc -nostdlib -nostartfiles -shared \ -Wl,-z,combreloc -Wl,-z,defs -Wl,--verbose 2>&1 | \ sed -e '/^=========/,/^=========/!d;/^=========/d' \ -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ > /builds/glibc/gcc-3.4/elf/ld.so.lds /opt/gcc/3.4-devel/bin/gcc -nostdlib -nostartfiles -shared -o /builds/glibc/gcc-3.4/elf/ld.so \ -Wl,-z,combreloc -Wl,-z,defs \ /builds/glibc/gcc-3.4/elf/librtld.os -Wl,--version-script=/builds/glibc/gcc-3.4/ld.map \ -Wl,-soname=ld-linux.so.2 -T /builds/glibc/gcc-3.4/elf/ld.so.lds /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbdbc): In function `_dl_runtime_resolve': /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `fixup' /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbde0): In function `_dl_runtime_profile': /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `profile_fixup' collect2: ld returned 1 exit status make[2]: *** [/builds/glibc/gcc-3.4/elf/ld.so] Error 1 $ nm elf/dl-runtime.os 00000000 r .LC0 0000000d r .LC1 U _GLOBAL_OFFSET_TABLE_ U __GI___assert_fail 00000000 r __PRETTY_FUNCTION__.2 00000006 r __PRETTY_FUNCTION__.3 00000014 r __PRETTY_FUNCTION__.4 00000000 T __i686.get_pc_thunk.bx U _dl_lookup_symbol_internal U _dl_lookup_versioned_symbol_internal U _dl_mcount_internal 000002f0 T _dl_runtime_profile 000002d0 T _dl_runtime_resolve U _rtld_local U fixup 00000000 t fixup.0 U profile_fixup 00000150 t profile_fixup.1 Is this working for others? Any ideas? Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From jakub@redhat.com Fri Jul 25 08:51:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 25 Jul 2003 08:51:00 -0000 Subject: glibc does not build on i686-linux-gnu In-Reply-To: References: Message-ID: <20030725085154.GM20507@sunsite.ms.mff.cuni.cz> On Fri, Jul 25, 2003 at 10:39:14AM +0200, Andreas Jaeger wrote: > /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbdbc): In function `_dl_runtime_resolve': > /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `fixup' > /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbde0): In function `_dl_runtime_profile': > /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `profile_fixup' > collect2: ld returned 1 exit status > make[2]: *** [/builds/glibc/gcc-3.4/elf/ld.so] Error 1 This seems to be caused by Geoff's intermodule changes. Jakub From aj@suse.de Fri Jul 25 08:56:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Fri, 25 Jul 2003 08:56:00 -0000 Subject: glibc does not build on i686-linux-gnu In-Reply-To: <20030725085154.GM20507@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Fri, 25 Jul 2003 10:51:54 +0200") References: <20030725085154.GM20507@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Fri, Jul 25, 2003 at 10:39:14AM +0200, Andreas Jaeger wrote: >> /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbdbc): In function `_dl_runtime_resolve': >> /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `fixup' >> /builds/glibc/gcc-3.4/elf/librtld.os(.text+0xbde0): In function `_dl_runtime_profile': >> /usr/src/cvs/libc/elf/dl-runtime.c:170: undefined reference to `profile_fixup' >> collect2: ld returned 1 exit status >> make[2]: *** [/builds/glibc/gcc-3.4/elf/ld.so] Error 1 > > This seems to be caused by Geoff's intermodule changes. Argh :-( Ok, I'll write a bugreport later, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N??rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 From drepper@redhat.com Fri Jul 25 09:08:00 2003 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 25 Jul 2003 09:08:00 -0000 Subject: [PATCH] Avoid using in In-Reply-To: <20030725082542.GL20507@sunsite.ms.mff.cuni.cz> References: <20030725082542.GL20507@sunsite.ms.mff.cuni.cz> Message-ID: <3F20F328.6090805@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > 2003-07-25 Jakub Jelinek > > * sysdeps/unix/sysv/linux/a.out.h: Replace with i386 version. > Include bits/a.out.h. > * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add > bits/a.out.h. > * sysdeps/unix/sysv/linux/bits/a.out.h: New file. > * sysdeps/unix/sysv/linux/i386/bits/a.out.h: New file. > * sysdeps/unix/sysv/linux/m68k/bits/a.out.h: New file. > * sysdeps/unix/sysv/linux/x86_64/bits/a.out.h: New file. > * sysdeps/unix/sysv/linux/alpha/a.out.h: New file. > * sysdeps/unix/sysv/linux/alpha/bits/a.out.h: New file. > * sysdeps/unix/sysv/linux/sparc/a.out.h: New file. > * sysdeps/unix/sysv/linux/sparc/bits/a.out.h: New file. Applied, thanks. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/IPMo2ijCOnn/RHQRArxeAJ0dR9vYKa+d4x/ZVUERdWPZuL9fpQCgn60p sMLXyjfKgs1ZIUadewLavfs= =6QJs -----END PGP SIGNATURE----- From kukuk@suse.de Fri Jul 25 11:07:00 2003 From: kukuk@suse.de (Thorsten Kukuk) Date: Fri, 25 Jul 2003 11:07:00 -0000 Subject: glibc cvs on sparc32 (_dl_hwcap error) Message-ID: <20030725110730.GA15662@suse.de> Hi, On sparc32 I now get the following error with current glibc cvs: gcc -m32 dl-support.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -fcall-used-g6 -g -m32 -mtune=ultrasparc -I../include -I. +-I/usr/src/packages/BUILD/glibc-2.3/cc/elf -I.. -I../libio -I/usr/src/packages/BUILD/glibc-2.3/cc -I../sysdeps/sparc/sparc32/elf -I../linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32 +-I../linuxthreads/sysdeps/unix/sysv/linux/sparc -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv +-I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/sparc/sparc32 -I../linuxthreads/sysdeps/sparc -I../sysdeps/unix/sysv/linux/sparc/sparc32 -I../sysdeps/unix/sysv/linux/sparc +-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/sparc -I../sysdeps/unix +-I../sysdeps/posix -I../sysdeps/sparc/sparc32/fpu -I../sysdeps/sparc/sparc32 -I../sysdeps/wordsize-32 -I.. /sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/sparc/sparc32/soft-fp -I../sysdeps/sparc/fpu -I../sysdeps/sparc -I../sysdeps/ieee754 -I../sysdeps/generic/elf +-I../sysdeps/generic -nostdinc -isystem /usr/lib/gcc-lib/sparc-suse-linux/3.3/include -isystem /usr/src/packages/BUILD/kernel-headers -D_LIBC_REENTRANT -include ../include/libc-symbols.h +-o /usr/src/packages/BUILD/glibc-2.3/cc/elf/dl-support.o -MD -MP -MF /usr/src/packages/BUILD/glibc-2.3/cc/elf/dl-support.o.dt ../sysdeps/sparc/sparc32/dl-machine.h:365: warning: inlining failed in call to `sparc_fixup_plt' ../sysdeps/sparc/sparc32/dl-machine.h:417: warning: called from here /tmp/ccCHIq7h.s: Assembler messages: /tmp/ccCHIq7h.s:6139: Error: symbol `_dl_hwcap' can not be both weak and common make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc/elf/dl-support.o] Error 1 make[2]: Leaving directory `/usr/src/packages/BUILD/glibc-2.3/elf' make[1]: *** [elf/subdir_lib] Error 2 make[1]: Leaving directory `/usr/src/packages/BUILD/glibc-2.3' make: *** [all] Error 2 Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From jakub@redhat.com Fri Jul 25 11:12:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 25 Jul 2003 11:12:00 -0000 Subject: [PATCH] Fix glibc cvs on sparc32 (_dl_hwcap error) In-Reply-To: <20030725110730.GA15662@suse.de> References: <20030725110730.GA15662@suse.de> Message-ID: <20030725111220.GN20507@sunsite.ms.mff.cuni.cz> On Fri, Jul 25, 2003 at 01:07:30PM +0200, Thorsten Kukuk wrote: > On sparc32 I now get the following error with current glibc cvs: > /tmp/ccCHIq7h.s:6139: Error: symbol `_dl_hwcap' can not be both weak and common Does the following fix it? 2003-07-25 Jakub Jelinek * elf/dl-support.c (_dl_hwcap): Add nocommon attribute. --- libc/elf/dl-support.c.jj 2003-07-23 03:56:17.000000000 -0400 +++ libc/elf/dl-support.c 2003-07-25 07:10:48.000000000 -0400 @@ -123,7 +123,7 @@ int _dl_correct_cache_id = _DL_CACHE_DEF struct ElfW(Phdr) *_dl_phdr; size_t _dl_phnum; -unsigned long int _dl_hwcap; +unsigned long int _dl_hwcap __attribute__((nocommon)); #ifdef NEED_DL_SYSINFO /* Needed for improved syscall handling on at least x86/Linux. */ Jakub From kukuk@suse.de Fri Jul 25 12:25:00 2003 From: kukuk@suse.de (Thorsten Kukuk) Date: Fri, 25 Jul 2003 12:25:00 -0000 Subject: [PATCH] Fix glibc cvs on sparc32 (_dl_hwcap error) In-Reply-To: <20030725111220.GN20507@sunsite.ms.mff.cuni.cz> References: <20030725110730.GA15662@suse.de> <20030725111220.GN20507@sunsite.ms.mff.cuni.cz> Message-ID: <20030725122536.GA13383@suse.de> On Fri, Jul 25, Jakub Jelinek wrote: > On Fri, Jul 25, 2003 at 01:07:30PM +0200, Thorsten Kukuk wrote: > > On sparc32 I now get the following error with current glibc cvs: > > /tmp/ccCHIq7h.s:6139: Error: symbol `_dl_hwcap' can not be both weak and common > > Does the following fix it? Yes, thanks, but now "make check" fails with: tst-tlsmod14a.c:11: error: thread-local storage not supported for this target -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From aj@suse.de Sun Jul 27 14:23:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Sun, 27 Jul 2003 14:23:00 -0000 Subject: Fix 2 warnings in localedata testsuite Message-ID: I fixed warnings about missing error prototypes with the appended patch that I've just committed, Andreas 2003-07-27 Andreas Jaeger * collate-test.c: Include error.h for error prototype. * xfrm-test.c: Likewise. ============================================================ Index: localedata/xfrm-test.c --- localedata/xfrm-test.c 15 Jul 2003 08:58:42 -0000 1.6 +++ localedata/xfrm-test.c 27 Jul 2003 14:21:10 -0000 @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include #include #include #include ============================================================ Index: localedata/collate-test.c --- localedata/collate-test.c 15 Jul 2003 08:58:42 -0000 1.6 +++ localedata/collate-test.c 27 Jul 2003 14:21:10 -0000 @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include #include #include #include -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From aj@suse.de Sun Jul 27 15:11:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Sun, 27 Jul 2003 15:11:00 -0000 Subject: One more unused->used change Message-ID: I just noticed the following place where we should use used. I've committed the patch, Andreas 2003-07-27 Andreas Jaeger * sysdeps/unix/sysv/linux/init-first.c: Mark init as used. ============================================================ Index: sysdeps/unix/sysv/linux/init-first.c --- sysdeps/unix/sysv/linux/init-first.c 1 Dec 2002 22:14:40 -0000 1.48 +++ sysdeps/unix/sysv/linux/init-first.c 27 Jul 2003 15:10:40 -0000 @@ -1,5 +1,5 @@ /* Initialization code run first thing by the ELF startup code. Linux version. - Copyright (C) 1995-1999,2000,01,02 Free Software Foundation, Inc. + Copyright (C) 1995-1999,2000,01,02,03 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 @@ -30,7 +30,7 @@ #include /* The function is called from assembly stubs the compiler can't see. */ -static void init (int, char **, char **) __attribute__ ((unused)); +static void init (int, char **, char **) __attribute__ ((used)); /* Set nonzero if we have to be prepared for more then one libc being used in the process. Safe assumption if initializer never runs. */ -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From aj@suse.de Mon Jul 28 14:09:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Mon, 28 Jul 2003 14:09:00 -0000 Subject: tst-tls3 fails on x86_64 Message-ID: With current CVS tst-tls3 fails if I configure using --with-tls --without-__thread: $ cat elf/tst-tls3.out set baz to 3 (LE) set variables foo and bar (IE) get sum of foo, bar (GD) and baz (LD) = 6 get sum of foo and bar (IE) = 3 get sum of foo and bar and baz (GD) = 3 baz = 0 Any ideas? Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From roland@redhat.com Mon Jul 28 20:18:00 2003 From: roland@redhat.com (Roland McGrath) Date: Mon, 28 Jul 2003 20:18:00 -0000 Subject: tst-tls3 fails on x86_64 In-Reply-To: Andreas Jaeger's message of Monday, 28 July 2003 16:09:10 +0200 Message-ID: <200307282018.h6SKIas11237@magilla.sf.frob.com> > With current CVS tst-tls3 fails if I configure using --with-tls > --without-__thread: > > $ cat elf/tst-tls3.out > set baz to 3 (LE) > set variables foo and bar (IE) > get sum of foo, bar (GD) and baz (LD) = 6 > get sum of foo and bar (IE) = 3 > get sum of foo and bar and baz (GD) = 3 > baz = 0 > > Any ideas? I am not already aware of the problem, if that's what you mean. Have you looked into it at all? Please always post your complete configure line and your compiler details. From aj@suse.de Tue Jul 29 13:09:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Tue, 29 Jul 2003 13:09:00 -0000 Subject: dl-execstack? Message-ID: Roland, you committed changes to elf/Makefile: cvs annotate elf/Makefile |grep execstack Annotations for elf/Makefile *************** 1.267 (roland 29-Jul-03): execstack) 1.267 (roland 29-Jul-03): tst-execstack-mod.c \ 1.267 (roland 29-Jul-03): tst-execstack 1.267 (roland 29-Jul-03): tst-execstack-mod 1.267 (roland 29-Jul-03): $(objpfx)tst-execstack: $(libdl) 1.267 (roland 29-Jul-03): $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so 1.267 (roland 29-Jul-03): LDFLAGS-tst-execstack = -Wl,-z,noexecstack 1.267 (roland 29-Jul-03): LDFLAGS-tst-execstack-mod = -Wl,-z,execstack But did not commit any of the execstack files: $ ls elf/*execstack* ls: elf/*execstack*: No such file or directory Please commit them so that building of glibc works again. Thanks, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From aj@suse.de Tue Jul 29 13:19:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Tue, 29 Jul 2003 13:19:00 -0000 Subject: tst-tls3 fails on x86_64 In-Reply-To: <200307282018.h6SKIas11237@magilla.sf.frob.com> (Roland McGrath's message of "Mon, 28 Jul 2003 13:18:36 -0700") References: <200307282018.h6SKIas11237@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> With current CVS tst-tls3 fails if I configure using --with-tls >> --without-__thread: >> >> $ cat elf/tst-tls3.out >> set baz to 3 (LE) >> set variables foo and bar (IE) >> get sum of foo, bar (GD) and baz (LD) = 6 >> get sum of foo and bar (IE) = 3 >> get sum of foo and bar and baz (GD) = 3 >> baz = 0 >> >> Any ideas? > > I am not already aware of the problem, if that's what you mean. Have you > looked into it at all? Please always post your complete configure line and > your compiler details. This is with GCC 3.3-hammer-branch from yesterday. I configured glibc with: /cvs/libc/configure --enable-add-ons --disable-profile --with-tls --without-__thread --prefix=/usr/src/aj/install/libc CC=/opt/gcc/hammer-3_3-branch/bin/gcc I'll try again when glibc builds again... Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From jakub@redhat.com Tue Jul 29 17:17:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 29 Jul 2003 17:17:00 -0000 Subject: [PATCH] Shut up gcc on include/ctype.h Message-ID: <20030729171729.GX20507@sunsite.ms.mff.cuni.cz> Hi! I remember we were discussing this, but don't remember the results. Anyway, this patch seems to make zero difference on generated code while shutting up the warning. 2003-07-29 Jakub Jelinek * include/ctype.h (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Avoid "dereferencing type-punned pointer will break strict-aliasing rules" warnings. --- libc/include/ctype.h.jj 2003-03-17 19:37:46.000000000 -0500 +++ libc/include/ctype.h 2003-07-29 13:12:30.000000000 -0400 @@ -25,31 +25,43 @@ __libc_tsd_define (extern, CTYPE_TOLOWER CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const)) __ctype_b_loc (void) { - const uint16_t **tablep = - (const uint16_t **) __libc_tsd_address (CTYPE_B); - if (__builtin_expect (*tablep == NULL, 0)) - *tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128; - return tablep; + union + { + void **ptr; + const uint16_t **tablep; + } u; + u.ptr = __libc_tsd_address (CTYPE_B); + if (__builtin_expect (*u.tablep == NULL, 0)) + *u.tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128; + return u.tablep; } CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const)) __ctype_toupper_loc (void) { - const int32_t **tablep = - (const int32_t **) __libc_tsd_address (CTYPE_TOUPPER); - if (__builtin_expect (*tablep == NULL, 0)) - *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128); - return tablep; + union + { + void **ptr; + const int32_t **tablep; + } u; + u.ptr = __libc_tsd_address (CTYPE_TOUPPER); + if (__builtin_expect (*u.tablep == NULL, 0)) + *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128); + return u.tablep; } CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const)) __ctype_tolower_loc (void) { - const int32_t **tablep = - (const int32_t **) __libc_tsd_address (CTYPE_TOLOWER); - if (__builtin_expect (*tablep == NULL, 0)) - *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128); - return tablep; + union + { + void **ptr; + const int32_t **tablep; + } u; + u.ptr = __libc_tsd_address (CTYPE_TOLOWER); + if (__builtin_expect (*u.tablep == NULL, 0)) + *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128); + return u.tablep; } # endif /* Not NOT_IN_libc. */ Jakub From pb@nexus.co.uk Tue Jul 29 19:59:00 2003 From: pb@nexus.co.uk (Philip Blundell) Date: Tue, 29 Jul 2003 19:59:00 -0000 Subject: alpha pwrite patch Message-ID: <1059508757.650.40.camel@kc.cam.armlinux.org> I needed this patch to compile on Alpha, otherwise I was seeing undefined references to __GI___pwrite64. Alpha doesn't declare __NR_pread64 or __NR_pwrite64, so these lines in syscalls.list were previously ignored and the generic sysdeps/unix/sysv/linux/pwrite.c was used instead. p. -------------- next part -------------- 2003-07-29 Philip Blundell * sysdeps/unix/sysv/linux/alpha/syscalls.list (pread): Syscall name is pread, not pread64. (pwrite): Likewise vs pwrite64. --- sysdeps/unix/sysv/linux/alpha/syscalls.list 24 Jun 2003 16:26:34 -0000 1.59 +++ sysdeps/unix/sysv/linux/alpha/syscalls.list 29 Jul 2003 19:23:02 -0000 @@ -22,8 +22,8 @@ llseek EXTRA lseek C:3 __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64 lseek llseek - posix_fadvise64 - fadvise64 4 posix_fadvise64 posix_fadvise -pread - pread64 C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 -pwrite - pwrite64 C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 +pread - pread C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 +pwrite - pwrite C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 fstatfs - fstatfs i:ip __fstatfs fstatfs __fstatfs64 fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64 From jakub@redhat.com Tue Jul 29 20:05:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 29 Jul 2003 20:05:00 -0000 Subject: alpha pwrite patch In-Reply-To: <1059508757.650.40.camel@kc.cam.armlinux.org> References: <1059508757.650.40.camel@kc.cam.armlinux.org> Message-ID: <20030729200535.GZ20507@sunsite.ms.mff.cuni.cz> On Tue, Jul 29, 2003 at 08:59:18PM +0100, Philip Blundell wrote: > I needed this patch to compile on Alpha, otherwise I was seeing > undefined references to __GI___pwrite64. Alpha doesn't declare > __NR_pread64 or __NR_pwrite64, so these lines in syscalls.list were > previously ignored and the generic sysdeps/unix/sysv/linux/pwrite.c was > used instead. Alpha does declare them (e.g. 2.6.0-test2): #define __NR_pread64 349 #define __NR_pwrite64 350 This means you should do something similar to e.g. sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (either exactly what ppc64 does plus your patch below, or replace pread64/pwrite64 with pread/pwrite and vice versa and you don't need syscalls.list change). > 2003-07-29 Philip Blundell > > * sysdeps/unix/sysv/linux/alpha/syscalls.list (pread): Syscall > name is pread, not pread64. > (pwrite): Likewise vs pwrite64. > > --- sysdeps/unix/sysv/linux/alpha/syscalls.list 24 Jun 2003 16:26:34 -0000 1.59 > +++ sysdeps/unix/sysv/linux/alpha/syscalls.list 29 Jul 2003 19:23:02 -0000 > @@ -22,8 +22,8 @@ > llseek EXTRA lseek C:3 __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64 > lseek llseek - > posix_fadvise64 - fadvise64 4 posix_fadvise64 posix_fadvise > -pread - pread64 C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 > -pwrite - pwrite64 C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 > +pread - pread C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 > +pwrite - pwrite C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 > fstatfs - fstatfs i:ip __fstatfs fstatfs __fstatfs64 fstatfs64 > statfs - statfs i:sp __statfs statfs statfs64 > getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64 Jakub From roland@redhat.com Tue Jul 29 21:15:00 2003 From: roland@redhat.com (Roland McGrath) Date: Tue, 29 Jul 2003 21:15:00 -0000 Subject: dl-execstack? In-Reply-To: Andreas Jaeger's message of Tuesday, 29 July 2003 14:42:43 +0200 Message-ID: <200307292115.h6TLF1e24127@magilla.sf.frob.com> > you committed changes to elf/Makefile: Oops! Sorry about that. Committing those changes was accidental. The related code is not ready for prime time yet. I've fixed the makefile. From roland@redhat.com Tue Jul 29 22:31:00 2003 From: roland@redhat.com (Roland McGrath) Date: Tue, 29 Jul 2003 22:31:00 -0000 Subject: [PATCH] Shut up gcc on include/ctype.h In-Reply-To: Jakub Jelinek's message of Tuesday, 29 July 2003 19:17:29 +0200 <20030729171729.GX20507@sunsite.ms.mff.cuni.cz> Message-ID: <200307292231.h6TMVnv32711@magilla.sf.frob.com> > I remember we were discussing this, but don't remember the results. > Anyway, this patch seems to make zero difference on generated code > while shutting up the warning. Hmm. We went a few rounds on this at the beginning, and my recollection was that I couldn't find a formulation that didn't produce some warning or other. Did the compiler change? Or did I just overlook the obvious fix? Thanks, Roland From jakub@redhat.com Tue Jul 29 23:34:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 29 Jul 2003 23:34:00 -0000 Subject: [PATCH] Shut up gcc on include/ctype.h In-Reply-To: <200307292231.h6TMVnv32711@magilla.sf.frob.com> References: <20030729171729.GX20507@sunsite.ms.mff.cuni.cz> <200307292231.h6TMVnv32711@magilla.sf.frob.com> Message-ID: <20030729233414.GB20507@sunsite.ms.mff.cuni.cz> On Tue, Jul 29, 2003 at 03:31:49PM -0700, Roland McGrath wrote: > > I remember we were discussing this, but don't remember the results. > > Anyway, this patch seems to make zero difference on generated code > > while shutting up the warning. > > Hmm. We went a few rounds on this at the beginning, and my recollection > was that I couldn't find a formulation that didn't produce some warning or > other. Did the compiler change? Or did I just overlook the obvious fix? I don't think it did. But certainly I don't get a single warning about ctype.h with the posted patch in gcc-3.3-16 (and gcc-3.2.x did not even had that warning). Jakub From aj@suse.de Wed Jul 30 05:52:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Wed, 30 Jul 2003 05:52:00 -0000 Subject: dl-execstack? In-Reply-To: <200307292115.h6TLF1e24127@magilla.sf.frob.com> (Roland McGrath's message of "Tue, 29 Jul 2003 14:15:01 -0700") References: <200307292115.h6TLF1e24127@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> you committed changes to elf/Makefile: > > Oops! Sorry about that. Committing those changes was accidental. > The related code is not ready for prime time yet. I've fixed the makefile. Not completly: byrd:/cvs/libc:[0]$ cvs status elf/Makefile =================================================================== File: Makefile Status: Up-to-date Working revision: 1.269 Repository revision: 1.269 /cvs/glibc/libc/elf/Makefile,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) byrd:/cvs/libc:[0]$ grep execstack elf/Makefile execstack) tst-execstack-mod.c \ tst-execstack tst-execstack-mod $(objpfx)tst-execstack: $(libdl) $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so LDFLAGS-tst-execstack = -Wl,-z,noexecstack LDFLAGS-tst-execstack-mod = -Wl,-z,execstack Please double check this, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From aj@suse.de Wed Jul 30 06:37:00 2003 From: aj@suse.de (Andreas Jaeger) Date: Wed, 30 Jul 2003 06:37:00 -0000 Subject: tst-tls3 fails on x86_64 In-Reply-To: (Andreas Jaeger's message of "Tue, 29 Jul 2003 15:18:26 +0200") References: <200307282018.h6SKIas11237@magilla.sf.frob.com> Message-ID: After working around the execstack breakage, x86_64 works again with Ulrich's latest patch in it. Thanks, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Deutschherrnstr. 15-19, 90429 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From jakub@redhat.com Thu Jul 31 13:20:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 13:20:00 -0000 Subject: [PATCH] Warning patrol Message-ID: <20030731132019.GE20507@sunsite.ms.mff.cuni.cz> Hi! Kills lots of warnings I saw during last build. There is still a bunch of warnings on s390, because typedef long unsigned int size_t; __extension__ typedef int __ssize_t; 2003-07-31 Jakub Jelinek * dlfcn/eval.c (funcall): Add noinline attribute to shut up warnings. * elf/rtld.c (dl_main): Cast ElfW(Addr) arguments with %Zx/%Zd formats to size_t. * elf/dl-lookup.c (_dl_debug_bindings): Likewise. * elf/tst-tls6.c (do_test): Use %zd format for l_tls_modid. * elf/tst-tls8.c (do_test): Use %zd format for modid1 and modid2. * gmon/tst-sprofil.c (main): Add parens to shut up warning. * iconv/tst-iconv3.c (main): Use %td instead of %zd for pointer difference argument. * stdio-common/tst-wc-printf.c (main): Cast arguments with %C format to wint_t. * stdlib/tst-limits.c (main): For WORD_BIT and LONG_BIT, use %d format and cast expected value to int. * sysdeps/generic/libc-start.c (STATIC): Add __attribute__((always_inline) if LIBC_START_MAIN is already defined. * sysdeps/powerpc/fpu/w_sqrt.c (a_nan, a_inf): Change from uint32_t to ieee_float_shape_type. (__sqrt): Avoid type punning. * sysdeps/powerpc/fpu/w_sqrtf.c (a_nan, a_inf): Change from uint32_t to ieee_float_shape_type. (__sqrtf): Avoid type punning. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Don't define refsym if in dl-conflict.c. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/i386/semctl.c (union semun): Add __old_buf. (__new_semctl): Shut up warning. * sysdeps/unix/sysv/linux/semctl.c (union semun): Add __old_buf. (__new_semctl): Shut up warning. * sysdeps/unix/sysv/linux/shmctl.c (__new_shmctl): Wrap long lines. Change old into union of __old_shmid_ds and __old_shminfo structs. Adjust all users. * wcsmbs/wcsmbs-tst1.c (main): Cast arguments with %C format to wint_t. nptl/ * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait): Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first argument. * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise. * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise. * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h. (__pthread_cleanup_upto): Fix prototype. (_longjmp_unwind): Adjust caller. * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock): Change second argument to const struct pointer. * tst-sem8.c (main): Remove unused s2 and s3 variables. * tst-sem9.c (main): Likewise. * unwind.c: Include string.h for strlen prototype. linuxthreads/ * sysdeps/alpha/pt-machine.h (PT_EI): Add __attribute__((always_inline)). * sysdeps/arm/pt-machine.h (PT_EI): Likewise. * sysdeps/cris/pt-machine.h (PT_EI): Likewise. * sysdeps/hppa/pt-machine.h (PT_EI): Likewise. * sysdeps/i386/i686/pt-machine.h (PT_EI): Likewise. * sysdeps/i386/pt-machine.h (PT_EI): Likewise. * sysdeps/ia64/pt-machine.h (PT_EI): Likewise. * sysdeps/m68k/pt-machine.h (PT_EI): Likewise. * sysdeps/mips/pt-machine.h (PT_EI): Likewise. * sysdeps/powerpc/powerpc32/pt-machine.h (PT_EI): Likewise. * sysdeps/powerpc/powerpc64/pt-machine.h (PT_EI): Likewise. * sysdeps/s390/s390-32/pt-machine.h (PT_EI): Likewise. * sysdeps/s390/s390-64/pt-machine.h (PT_EI): Likewise. * sysdeps/sh/pt-machine.h (PT_EI): Likewise. * sysdeps/sparc/sparc32/pt-machine.h (PT_EI): Likewise. * sysdeps/sparc/sparc64/pt-machine.h (PT_EI): Likewise. * sysdeps/x86_64/pt-machine.h (PT_EI): Likewise. * spinlock.h (__pthread_set_own_extricate_if): Likewise. * sysdeps/ia64/tls.h (TLS_INIT_TP): Cast tcbp to __typeof (__thread_self). * Examples/ex13.c (main): Change res type to void * to avoid warnings. * tst-cancel.c (cleanup, inner, tf1, tf2, tf3): Comment out. --- libc/nptl/sysdeps/pthread/pthread_cond_timedwait.c.jj 2003-06-23 18:36:31.000000000 -0400 +++ libc/nptl/sysdeps/pthread/pthread_cond_timedwait.c 2003-07-31 06:58:49.000000000 -0400 @@ -100,8 +100,9 @@ __pthread_cond_timedwait (cond, mutex, a { #ifdef __NR_clock_gettime INTERNAL_SYSCALL_DECL (err); - int val = INTERNAL_SYSCALL (clock_gettime, err, 2, - cond->__data.__clock, &rt); + int val; + val = INTERNAL_SYSCALL (clock_gettime, err, 2, + cond->__data.__clock, &rt); # ifndef __ASSUME_POSIX_TIMERS if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (val, err), 0)) { --- libc/nptl/sysdeps/unix/sysv/linux/s390/jmp-unwind.c.jj 2003-02-14 03:02:46.000000000 -0500 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/jmp-unwind.c 2003-07-31 08:02:20.000000000 -0400 @@ -9,7 +9,7 @@ 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 + 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 @@ -20,8 +20,9 @@ #include #include #include +#include -extern void __pthread_cleanup_upto (jmp_buf env, char *targetframe); +extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe); #pragma weak __pthread_cleanup_upto @@ -37,5 +38,5 @@ _longjmp_unwind (jmp_buf env, int val) unsigned char local_var; if (fptr != NULL) - fptr (env, &local_var); + fptr (env->__jmpbuf, &local_var); } --- libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h.jj 2003-06-05 03:55:34.000000000 -0400 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2003-07-31 08:04:53.000000000 -0400 @@ -162,7 +162,7 @@ extern int ___lll_mutex_timedlock (int * static inline int __attribute__ ((always_inline)) -__lll_mutex_timedlock (int *futex, struct timespec *abstime) +__lll_mutex_timedlock (int *futex, const struct timespec *abstime) { int oldval; int newval; --- libc/nptl/sysdeps/unix/sysv/linux/timer_create.c.jj 2003-06-16 16:05:06.000000000 -0400 +++ libc/nptl/sysdeps/unix/sysv/linux/timer_create.c 2003-07-31 07:01:56.000000000 -0400 @@ -133,7 +133,8 @@ timer_create (clock_id, evp, timerid) { INTERNAL_SYSCALL_DECL (err); struct timespec ts; - int res = INTERNAL_SYSCALL (clock_getres, err, 1, &ts); + int res; + res = INTERNAL_SYSCALL (clock_getres, err, 1, &ts); __no_posix_timers = (INTERNAL_SYSCALL_ERROR_P (res, err) ? -1 : 1); } @@ -193,8 +194,9 @@ timer_create (clock_id, evp, timerid) /* Create the timer. */ INTERNAL_SYSCALL_DECL (err); - int res = INTERNAL_SYSCALL (timer_create, err, 3, clock_id, &sev, - &newp->ktimerid); + int res; + res = INTERNAL_SYSCALL (timer_create, err, 3, clock_id, &sev, + &newp->ktimerid); if (! INTERNAL_SYSCALL_ERROR_P (res, err)) { *timerid = (timer_t) newp; --- libc/nptl/tst-sem8.c.jj 2003-05-31 15:55:33.000000000 -0400 +++ libc/nptl/tst-sem8.c 2003-07-31 06:28:11.000000000 -0400 @@ -36,8 +36,6 @@ int main (void) { sem_t *s; - sem_t *s2; - sem_t *s3; int i; on_exit (remove_sem, (void *) "/glibc-tst-sem8"); --- libc/nptl/tst-sem9.c.jj 2003-05-31 15:55:33.000000000 -0400 +++ libc/nptl/tst-sem9.c 2003-07-31 06:28:21.000000000 -0400 @@ -36,8 +36,6 @@ int main (void) { sem_t *s; - sem_t *s2; - sem_t *s3; int i; on_exit (remove_sem, (void *) "/glibc-tst-sem9"); --- libc/nptl/pthread_condattr_setclock.c.jj 2003-03-18 06:06:43.000000000 -0500 +++ libc/nptl/pthread_condattr_setclock.c 2003-07-31 06:59:37.000000000 -0400 @@ -44,8 +44,9 @@ pthread_condattr_setclock (attr, clock_i struct timespec ts; INTERNAL_SYSCALL_DECL (err); - int val = INTERNAL_SYSCALL (clock_getres, err, 2, CLOCK_MONOTONIC, - &ts); + int val; + val = INTERNAL_SYSCALL (clock_getres, err, 2, CLOCK_MONOTONIC, + &ts); avail = INTERNAL_SYSCALL_ERROR_P (val, err) ? -1 : 1; } --- libc/nptl/unwind.c.jj 2003-07-09 10:06:10.000000000 -0400 +++ libc/nptl/unwind.c 2003-07-31 07:00:14.000000000 -0400 @@ -20,6 +20,7 @@ #include #include +#include #include #include "pthreadP.h" --- libc/dlfcn/eval.c.jj 2001-07-06 00:54:45.000000000 -0400 +++ libc/dlfcn/eval.c 2003-07-31 05:32:02.000000000 -0400 @@ -27,7 +27,7 @@ #include #include -static void *funcall (char **stringp); +static void *funcall (char **stringp) __attribute_noinline__; static void *eval (char **stringp); --- libc/elf/tst-tls6.c.jj 2002-12-04 07:27:46.000000000 -0500 +++ libc/elf/tst-tls6.c 2003-07-31 07:36:16.000000000 -0400 @@ -36,7 +36,7 @@ do_test (void) modid = ((struct link_map *) h)->l_tls_modid; else if (((struct link_map *) h)->l_tls_modid != modid) { - printf ("round %d: modid now %d, initially %d\n", + printf ("round %d: modid now %zd, initially %d\n", i, ((struct link_map *) h)->l_tls_modid, modid); result = 1; } --- libc/elf/rtld.c.jj 2003-07-31 04:35:44.000000000 -0400 +++ libc/elf/rtld.c 2003-07-31 07:55:56.000000000 -0400 @@ -1307,13 +1307,15 @@ cannot allocate TLS data structures for : rtld_progname ?: "
", l->l_name[0] ? l->l_name : rtld_progname ?: "
", - (int) sizeof l->l_map_start * 2, l->l_map_start, - (int) sizeof l->l_addr * 2, l->l_addr); + (int) sizeof l->l_map_start * 2, + (size_t) l->l_map_start, + (int) sizeof l->l_addr * 2, + (size_t) l->l_addr); #ifdef USE_TLS if (l->l_tls_modid) _dl_printf (" TLS(0x%Zx, 0x%0*Zx)\n", l->l_tls_modid, (int) sizeof l->l_tls_offset * 2, - l->l_tls_offset); + (size_t) l->l_tls_offset); else #endif _dl_printf ("\n"); @@ -1330,7 +1332,7 @@ cannot allocate TLS data structures for else _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name, l->l_name, (int) sizeof l->l_map_start * 2, - l->l_map_start); + (size_t) l->l_map_start); } if (__builtin_expect (mode, trace) != trace) @@ -1349,8 +1351,9 @@ cannot allocate TLS data structures for _dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n", INTUSE(_dl_argv)[i], - (int) sizeof ref->st_value * 2, ref->st_value, - (int) sizeof loadbase * 2, loadbase); + (int) sizeof ref->st_value * 2, + (size_t) ref->st_value, + (int) sizeof loadbase * 2, (size_t) loadbase); } else { --- libc/elf/tst-tls8.c.jj 2003-04-27 02:16:55.000000000 -0400 +++ libc/elf/tst-tls8.c 2003-07-31 07:37:38.000000000 -0400 @@ -39,7 +39,7 @@ do_test (void) modid1 = ((struct link_map *) h1)->l_tls_modid; else if (((struct link_map *) h1)->l_tls_modid != modid1) { - printf ("round %d: modid now %zd, initially %d\n", + printf ("round %d: modid now %zd, initially %zd\n", i, ((struct link_map *) h1)->l_tls_modid, modid1); result = 1; } @@ -69,7 +69,7 @@ do_test (void) modid2 = ((struct link_map *) h1)->l_tls_modid; else if (((struct link_map *) h1)->l_tls_modid != modid2) { - printf ("round %d: modid now %zd, initially %d\n", + printf ("round %d: modid now %zd, initially %zd\n", i, ((struct link_map *) h1)->l_tls_modid, modid2); result = 1; } @@ -108,7 +108,7 @@ do_test (void) time. The value of the first round is used. */ if (((struct link_map *) h1)->l_tls_modid != modid1) { - printf ("round %d: modid now %zd, initially %d\n", + printf ("round %d: modid now %zd, initially %zd\n", i, ((struct link_map *) h1)->l_tls_modid, modid1); result = 1; } @@ -136,7 +136,7 @@ do_test (void) time. The value of the first round is used. */ if (((struct link_map *) h1)->l_tls_modid != modid2) { - printf ("round %d: modid now %zd, initially %d\n", + printf ("round %d: modid now %zd, initially %zd\n", i, ((struct link_map *) h1)->l_tls_modid, modid2); result = 1; } --- libc/elf/dl-lookup.c.jj 2003-07-31 07:50:11.000000000 -0400 +++ libc/elf/dl-lookup.c 2003-07-31 07:52:02.000000000 -0400 @@ -704,20 +704,21 @@ _dl_debug_bindings (const char *undef_na { _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ", conflict ? "conflict" : "lookup", - (int) sizeof (ElfW(Addr)) * 2, undef_map->l_map_start, (int) sizeof (ElfW(Addr)) * 2, - ((ElfW(Addr)) *ref) - undef_map->l_map_start, + (size_t) undef_map->l_map_start, (int) sizeof (ElfW(Addr)) * 2, - (ElfW(Addr)) (value->s ? value->m->l_map_start : 0), + (size_t) (((ElfW(Addr)) *ref) - undef_map->l_map_start), (int) sizeof (ElfW(Addr)) * 2, - (ElfW(Addr)) (value->s ? value->s->st_value : 0)); + (size_t) (value->s ? value->m->l_map_start : 0), + (int) sizeof (ElfW(Addr)) * 2, + (size_t) (value->s ? value->s->st_value : 0)); if (conflict) _dl_printf ("x 0x%0*Zx 0x%0*Zx ", (int) sizeof (ElfW(Addr)) * 2, - (ElfW(Addr)) (val.s ? val.m->l_map_start : 0), + (size_t) (val.s ? val.m->l_map_start : 0), (int) sizeof (ElfW(Addr)) * 2, - (ElfW(Addr)) (val.s ? val.s->st_value : 0)); + (size_t) (val.s ? val.s->st_value : 0)); _dl_printf ("/%x %s\n", type_class, undef_name); } --- libc/gmon/tst-sprofil.c.jj 2001-07-06 00:54:46.000000000 -0400 +++ libc/gmon/tst-sprofil.c 2003-07-31 08:18:08.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger-Tang . @@ -165,7 +165,7 @@ main (int argc, char **argv) if (buf[i][j] != 0) printf ("%0*Zx\t%u\t(buffer %d)\n", (int) (sizeof (size_t) * 2), - (taddr[i] + (char *) &buf[i][j] - (char *) &buf[i][0]), + (taddr[i] + ((char *) &buf[i][j] - (char *) &buf[i][0])), buf[i][j], i); return 0; --- libc/iconv/tst-iconv3.c.jj 2002-03-24 08:00:08.000000000 -0500 +++ libc/iconv/tst-iconv3.c 2003-07-31 08:06:34.000000000 -0400 @@ -42,7 +42,7 @@ main (int argc, char *argv[]) printf ("inptr change: %td\n", inptr - inbuf); printf ("inlen change: %zd\n", BUFSIZE - inbytes_left); - printf ("outptr change: %zd\n", outptr - (char *) outbuf); + printf ("outptr change: %td\n", outptr - (char *) outbuf); printf ("outlen change: %zd\n", BUFSIZE * 4 - outbytes_left); result = 1; } --- libc/linuxthreads/Examples/ex13.c.jj 2002-09-24 21:58:29.000000000 -0400 +++ libc/linuxthreads/Examples/ex13.c 2003-07-31 06:11:15.000000000 -0400 @@ -1,5 +1,5 @@ /* Test for Pthreads/mutexes. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kurt Garloff , 2000. @@ -80,7 +80,7 @@ main (void) struct thr_ctrl threadctrl; pthread_t thread; int err; - int *res = &threadctrl.retval; + void *res = &threadctrl.retval; pthread_mutexattr_t mutattr; pthread_mutexattr_init (&mutattr); pthread_mutex_init (&threadctrl.mutex, &mutattr); @@ -106,7 +106,7 @@ main (void) abort (); }; dump_mut (&threadctrl.mutex); - pthread_join (thread, (void **) &res); + pthread_join (thread, &res); printf ("OK\n"); return 0; } --- libc/linuxthreads/tst-cancel.c.jj 2001-04-12 19:08:50.000000000 -0400 +++ libc/linuxthreads/tst-cancel.c 2003-07-31 06:17:53.000000000 -0400 @@ -12,6 +12,7 @@ int fd; pthread_barrier_t bar; +#ifdef NOT_YET static void cleanup (void *arg) { @@ -52,7 +53,7 @@ t2 (void *arg) return NULL; pthread_cleanup_pop (0); } - +#endif /* This does not work yet. */ volatile int cleanupokcnt; @@ -63,7 +64,7 @@ cleanupok (void *arg) ++cleanupokcnt; } - +#ifdef NOT_YET static void * t3 (void *arg) { @@ -72,7 +73,7 @@ t3 (void *arg) pthread_exit (NULL); pthread_cleanup_pop (0); } - +#endif static void innerok (int a) @@ -170,7 +171,7 @@ main (int argc, char *argv[]) err = pthread_create (&td, NULL, t4, (void *) 7); if (err != 0) { - printf ("cannot create thread t3: %s\n", strerror (err)); + printf ("cannot create thread t4: %s\n", strerror (err)); exit (1); } --- libc/linuxthreads/sysdeps/alpha/pt-machine.h.jj 2002-09-06 15:31:37.000000000 -0400 +++ libc/linuxthreads/sysdeps/alpha/pt-machine.h 2003-07-31 06:00:54.000000000 -0400 @@ -1,6 +1,7 @@ /* Machine-dependent pthreads configuration and inline functions. Alpha version. - Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -23,7 +24,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif #ifdef __linux__ --- libc/linuxthreads/sysdeps/arm/pt-machine.h.jj 2002-08-26 18:39:52.000000000 -0400 +++ libc/linuxthreads/sysdeps/arm/pt-machine.h 2003-07-31 06:01:08.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. ARM version. - Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell . @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/cris/pt-machine.h.jj 2002-08-26 18:39:53.000000000 -0400 +++ libc/linuxthreads/sysdeps/cris/pt-machine.h 2003-07-31 06:01:15.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. CRIS version. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + 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 @@ -22,7 +22,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/hppa/pt-machine.h.jj 2002-08-26 18:39:51.000000000 -0400 +++ libc/linuxthreads/sysdeps/hppa/pt-machine.h 2003-07-31 06:01:23.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. hppa version. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -25,7 +25,7 @@ #include #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/i386/i686/pt-machine.h.jj 2003-02-25 19:01:14.000000000 -0500 +++ libc/linuxthreads/sysdeps/i386/i686/pt-machine.h 2003-07-31 06:02:02.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. i686 version. - Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif #include "kernel-features.h" --- libc/linuxthreads/sysdeps/i386/pt-machine.h.jj 2003-02-25 19:01:14.000000000 -0500 +++ libc/linuxthreads/sysdeps/i386/pt-machine.h 2003-07-31 06:02:07.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. i386 version. - Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -24,7 +24,7 @@ #ifndef __ASSEMBLER__ #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/ia64/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/ia64/pt-machine.h 2003-07-31 06:02:10.000000000 -0400 @@ -24,7 +24,7 @@ #include #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/ia64/tls.h.jj 2003-07-21 07:41:09.000000000 -0400 +++ libc/linuxthreads/sysdeps/ia64/tls.h 2003-07-31 06:37:51.000000000 -0400 @@ -84,7 +84,7 @@ typedef struct special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(tcbp, secondcall) \ - (__thread_self = (tcbp), NULL) + (__thread_self = (__typeof (__thread_self)) (tcbp), NULL) /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ --- libc/linuxthreads/sysdeps/m68k/pt-machine.h.jj 2002-08-26 18:39:46.000000000 -0400 +++ libc/linuxthreads/sysdeps/m68k/pt-machine.h 2003-07-31 06:02:13.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. m68k version. - Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/mips/pt-machine.h.jj 2003-03-13 23:22:05.000000000 -0500 +++ libc/linuxthreads/sysdeps/mips/pt-machine.h 2003-07-31 06:02:17.000000000 -0400 @@ -27,7 +27,7 @@ #include #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h.jj 2003-02-17 15:33:35.000000000 -0500 +++ libc/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h 2003-07-31 06:02:21.000000000 -0400 @@ -1,6 +1,7 @@ /* Machine-dependent pthreads configuration and inline functions. powerpc version. - Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2000, 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 @@ -25,7 +26,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h.jj 2003-03-02 06:44:12.000000000 -0500 +++ libc/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h 2003-07-31 06:02:25.000000000 -0400 @@ -25,7 +25,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/s390/s390-32/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/s390/s390-32/pt-machine.h 2003-07-31 06:03:28.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. S390 version. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/s390/s390-64/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/s390/s390-64/pt-machine.h 2003-07-31 06:03:38.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. 64 bit S/390 version. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/sh/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/sh/pt-machine.h 2003-07-31 06:03:45.000000000 -0400 @@ -24,7 +24,7 @@ #ifndef __ASSEMBLER__ #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h 2003-07-31 06:03:49.000000000 -0400 @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h.jj 2003-01-30 16:03:40.000000000 -0500 +++ libc/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h 2003-07-31 06:03:54.000000000 -0400 @@ -23,7 +23,7 @@ #define _PT_MACHINE_H 1 #ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) #endif extern long int testandset (int *spinlock); --- libc/linuxthreads/sysdeps/x86_64/pt-machine.h.jj 2002-12-17 20:26:44.000000000 -0500 +++ libc/linuxthreads/sysdeps/x86_64/pt-machine.h 2003-07-31 06:04:04.000000000 -0400 @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. x86-64 version. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + 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 @@ -28,7 +28,7 @@ # ifndef PT_EI -# define PT_EI extern inline +# define PT_EI extern inline __attribute__ ((always_inline)) # endif extern long int testandset (int *spinlock); --- libc/linuxthreads/spinlock.h.jj 2001-05-24 19:36:35.000000000 -0400 +++ libc/linuxthreads/spinlock.h 2003-07-31 06:21:03.000000000 -0400 @@ -196,7 +196,7 @@ static inline long atomic_decrement(stru } -static inline void +static inline __attribute__((always_inline)) void __pthread_set_own_extricate_if (pthread_descr self, pthread_extricate_if *peif) { /* Only store a non-null peif if the thread has cancellation enabled. --- libc/stdio-common/tst-wc-printf.c.jj 1998-04-28 10:15:18.000000000 -0400 +++ libc/stdio-common/tst-wc-printf.c 2003-07-31 06:07:58.000000000 -0400 @@ -16,7 +16,7 @@ main (void) printf ("with %%S: %S\n", tmp); - printf ("with %%C: %C\n", tmp[0]); + printf ("with %%C: %C\n", (wint_t) tmp[0]); return 0; } --- libc/stdlib/tst-limits.c.jj 2000-11-24 20:26:20.000000000 -0500 +++ libc/stdlib/tst-limits.c 2003-07-31 07:34:53.000000000 -0400 @@ -62,8 +62,8 @@ main (void) TEST (PAGE_SIZE, "d", getpagesize ()); #endif - TEST (WORD_BIT, "zd", sizeof (int) * CHAR_BIT); - TEST (LONG_BIT, "zd", sizeof (long int) * CHAR_BIT); + TEST (WORD_BIT, "d", (int) sizeof (int) * CHAR_BIT); + TEST (LONG_BIT, "d", (int) sizeof (long int) * CHAR_BIT); return result; } --- libc/sysdeps/generic/libc-start.c.jj 2003-05-06 01:54:18.000000000 -0400 +++ libc/sysdeps/generic/libc-start.c 2003-07-31 06:42:07.000000000 -0400 @@ -45,7 +45,7 @@ extern void __pthread_initialize_minimal #ifdef LIBC_START_MAIN -# define STATIC static inline +# define STATIC static inline __attribute__ ((always_inline)) #else # define STATIC # define LIBC_START_MAIN BP_SYM (__libc_start_main) --- libc/sysdeps/powerpc/fpu/w_sqrt.c.jj 2003-03-07 16:18:23.000000000 -0500 +++ libc/sysdeps/powerpc/fpu/w_sqrt.c 2003-07-31 06:55:31.000000000 -0400 @@ -23,8 +23,8 @@ #include static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */ -static const uint32_t a_nan = 0x7fc00000; -static const uint32_t a_inf = 0x7f800000; +static const ieee_float_shape_type a_nan = { .word = 0x7fc00000 }; +static const ieee_float_shape_type a_inf = { .word = 0x7f800000 }; static const float two108 = 3.245185536584267269e+32; static const float twom54 = 5.551115123125782702e-17; extern const float __t_sqrt[1024]; @@ -45,7 +45,7 @@ extern const float __t_sqrt[1024]; double __sqrt(double x) { - const float inf = *(const float *)&a_inf; + const float inf = a_inf.value; /* x = f_wash(x); *//* This ensures only one exception for SNaN. */ if (x > 0) { @@ -130,7 +130,7 @@ __sqrt(double x) x = __kernel_standard(x,x,26); else #endif - x = *(const float*)&a_nan; + x = a_nan.value; } return f_wash(x); } --- libc/sysdeps/powerpc/fpu/w_sqrtf.c.jj 2001-07-06 00:56:02.000000000 -0400 +++ libc/sysdeps/powerpc/fpu/w_sqrtf.c 2003-07-31 06:57:09.000000000 -0400 @@ -1,5 +1,5 @@ /* Single-precision floating point square root. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 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 @@ -23,8 +23,8 @@ #include static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */ -static const uint32_t a_nan = 0x7fc00000; -static const uint32_t a_inf = 0x7f800000; +static const ieee_float_shape_type a_nan = { .word = 0x7fc00000 }; +static const ieee_float_shape_type a_inf = { .word = 0x7f800000 }; static const float two48 = 281474976710656.0; static const float twom24 = 5.9604644775390625e-8; extern const float __t_sqrt[1024]; @@ -45,7 +45,7 @@ extern const float __t_sqrt[1024]; float __sqrtf(float x) { - const float inf = *(const float *)&a_inf; + const float inf = a_inf.value; /* x = f_washf(x); *//* This ensures only one exception for SNaN. */ if (x > 0) { @@ -125,7 +125,7 @@ __sqrtf(float x) x = __kernel_standard(x,x,126); else #endif - x = *(const float*)&a_nan; + x = a_nan.value; } return f_washf(x); } --- libc/sysdeps/s390/s390-32/dl-machine.h.jj 2003-07-31 04:36:01.000000000 -0400 +++ libc/sysdeps/s390/s390-32/dl-machine.h 2003-07-31 07:45:22.000000000 -0400 @@ -405,7 +405,9 @@ elf_machine_rela (struct link_map *map, return; else { +#ifndef RESOLVE_CONFLICT_FIND_MAP const Elf32_Sym *const refsym = sym; +#endif #if defined USE_TLS && !defined RTLD_BOOTSTRAP struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; --- libc/sysdeps/s390/s390-64/dl-machine.h.jj 2003-07-31 04:36:01.000000000 -0400 +++ libc/sysdeps/s390/s390-64/dl-machine.h 2003-07-31 08:19:52.000000000 -0400 @@ -373,7 +373,9 @@ elf_machine_rela (struct link_map *map, return; else { +#ifndef RESOLVE_CONFLICT_FIND_MAP const Elf64_Sym *const refsym = sym; +#endif #if defined USE_TLS && !defined RTLD_BOOTSTRAP struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); Elf64_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; --- libc/sysdeps/unix/sysv/linux/i386/semctl.c.jj 2001-07-06 00:56:16.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/i386/semctl.c 2003-07-31 05:13:47.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -48,6 +48,7 @@ union semun struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ unsigned short int *array; /* array for GETALL & SETALL */ struct seminfo *__buf; /* buffer for IPC_INFO */ + struct __old_semid_ds *__old_buf; }; #include @@ -145,7 +146,7 @@ __new_semctl (int semid, int semnum, int #endif buf = arg.buf; - arg.buf = (struct semid_ds *)&old; + arg.__old_buf = &old; if (cmd == IPC_SET) { old.sem_perm.uid = buf->sem_perm.uid; --- libc/sysdeps/unix/sysv/linux/semctl.c.jj 2002-05-14 23:51:38.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/semctl.c 2003-07-31 06:43:26.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -48,6 +48,7 @@ union semun struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ unsigned short int *array; /* array for GETALL & SETALL */ struct seminfo *__buf; /* buffer for IPC_INFO */ + struct __old_semid_ds *__old_buf; }; #include @@ -152,7 +153,7 @@ __new_semctl (int semid, int semnum, int __set_errno(save_errno); buf = arg.buf; - arg.buf = (struct semid_ds *)&old; + arg.__old_buf = &old; if (cmd == IPC_SET) { old.sem_perm.uid = buf->sem_perm.uid; --- libc/sysdeps/unix/sysv/linux/shmctl.c.jj 2001-07-06 00:56:13.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/shmctl.c 2003-07-31 06:47:41.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -74,7 +74,8 @@ int __new_shmctl (int shmid, int cmd, struct shmid_ds *buf) { #if __ASSUME_IPC64 > 0 - return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0, CHECK_1 (buf)); + return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0, + CHECK_1 (buf)); #else switch (cmd) { case SHM_STAT: @@ -85,63 +86,69 @@ __new_shmctl (int shmid, int cmd, struct #endif break; default: - return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, CHECK_1 (buf)); + return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, + CHECK_1 (buf)); } { int save_errno = errno, result; - struct __old_shmid_ds old; + union + { + struct __old_shmid_ds ds; + struct __old_shminfo info; + } old; /* Unfortunately there is no way how to find out for sure whether we should use old or new shmctl. */ - result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0, CHECK_1 (buf)); + result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0, + CHECK_1 (buf)); if (result != -1 || errno != EINVAL) return result; __set_errno(save_errno); if (cmd == IPC_SET) { - old.shm_perm.uid = buf->shm_perm.uid; - old.shm_perm.gid = buf->shm_perm.gid; - old.shm_perm.mode = buf->shm_perm.mode; - if (old.shm_perm.uid != buf->shm_perm.uid || - old.shm_perm.gid != buf->shm_perm.gid) + old.ds.shm_perm.uid = buf->shm_perm.uid; + old.ds.shm_perm.gid = buf->shm_perm.gid; + old.ds.shm_perm.mode = buf->shm_perm.mode; + if (old.ds.shm_perm.uid != buf->shm_perm.uid || + old.ds.shm_perm.gid != buf->shm_perm.gid) { __set_errno (EINVAL); return -1; } } - result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, __ptrvalue (&old)); + result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, + __ptrvalue (&old.ds)); if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT)) { memset(buf, 0, sizeof(*buf)); - buf->shm_perm.__key = old.shm_perm.__key; - buf->shm_perm.uid = old.shm_perm.uid; - buf->shm_perm.gid = old.shm_perm.gid; - buf->shm_perm.cuid = old.shm_perm.cuid; - buf->shm_perm.cgid = old.shm_perm.cgid; - buf->shm_perm.mode = old.shm_perm.mode; - buf->shm_perm.__seq = old.shm_perm.__seq; - buf->shm_atime = old.shm_atime; - buf->shm_dtime = old.shm_dtime; - buf->shm_ctime = old.shm_ctime; - buf->shm_segsz = old.shm_segsz; - buf->shm_nattch = old.shm_nattch; - buf->shm_cpid = old.shm_cpid; - buf->shm_lpid = old.shm_lpid; + buf->shm_perm.__key = old.ds.shm_perm.__key; + buf->shm_perm.uid = old.ds.shm_perm.uid; + buf->shm_perm.gid = old.ds.shm_perm.gid; + buf->shm_perm.cuid = old.ds.shm_perm.cuid; + buf->shm_perm.cgid = old.ds.shm_perm.cgid; + buf->shm_perm.mode = old.ds.shm_perm.mode; + buf->shm_perm.__seq = old.ds.shm_perm.__seq; + buf->shm_atime = old.ds.shm_atime; + buf->shm_dtime = old.ds.shm_dtime; + buf->shm_ctime = old.ds.shm_ctime; + buf->shm_segsz = old.ds.shm_segsz; + buf->shm_nattch = old.ds.shm_nattch; + buf->shm_cpid = old.ds.shm_cpid; + buf->shm_lpid = old.ds.shm_lpid; } #if __WORDSIZE != 32 else if (result != -1 && cmd == IPC_INFO) { - struct __old_shminfo *oldi = (struct __old_shminfo *)&old; struct shminfo *i = (struct shminfo *)buf; memset(i, 0, sizeof(*i)); - i->shmmax = oldi->shmmax; - i->shmmin = oldi->shmmin; - i->shmmni = oldi->shmmni; - i->shmseg = oldi->shmseg; - i->shmall = oldi->shmall; + i->shmmax = old.info.shmmax; + i->shmmin = old.info.shmmin; + i->shmmni = old.info.shmmni; + i->shmseg = old.info.shmseg; + i->shmall = old.info.shmall; } #endif return result; --- libc/wcsmbs/wcsmbs-tst1.c.jj 2001-08-06 22:44:12.000000000 -0400 +++ libc/wcsmbs/wcsmbs-tst1.c 2003-07-31 06:09:10.000000000 -0400 @@ -32,10 +32,10 @@ main (void) buf[idx] = 0; printf ("orig string %s\n", str); printf ("string by wctomb %s\n", buf); - printf ("string by %%C %C", tmp[0]); + printf ("string by %%C %C", (wint_t) tmp[0]); if (tmp[0] != L'H') result = 1; - printf ("%C\n", tmp[1]); + printf ("%C\n", (wint_t) tmp[1]); if (tmp[1] != L'e') result = 1; printf ("string by %%S %S\n", tmp); @@ -43,7 +43,7 @@ main (void) result = 1; puts ("---- test 2 ------"); printf ("wchar string %S\n", tmp1); - printf ("wchar %C\n", tmp1[0]); + printf ("wchar %C\n", (wint_t) tmp1[0]); test = wcstombs (buf, tmp1, (wcslen (tmp1) + 1) * sizeof (wchar_t)); printf ("size of string by wcstombs %d\n", test); if (test != wcslen (tmp1)) Jakub From jakub@redhat.com Thu Jul 31 13:52:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 13:52:00 -0000 Subject: [PATCH] Fix ssize_t definition on s390 32-bit In-Reply-To: <20030731132019.GE20507@sunsite.ms.mff.cuni.cz> References: <20030731132019.GE20507@sunsite.ms.mff.cuni.cz> Message-ID: <20030731135246.GF20507@sunsite.ms.mff.cuni.cz> Hi! On Thu, Jul 31, 2003 at 03:20:19PM +0200, Jakub Jelinek wrote: > Kills lots of warnings I saw during last build. > There is still a bunch of warnings on s390, because > typedef long unsigned int size_t; > __extension__ typedef int __ssize_t; Here is a patch which should fix it. sysdeps/unix/sysv/linux/s390/bits/types.h had typedef long __ssize_t; before 2002-10-23 bits/typesizes.h changes and it matches GCC size_t definition. 2003-07-31 Jakub Jelinek * sysdeps/generic/bits/types.h (__ssize_t): Use __SSIZE_T_TYPE instead of __SWORD_TYPE. * sysdeps/generic/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/mach/hurd/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/unix/sysv/linux/alpha/bits/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/unix/sysv/linux/sparc/bits/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/unix/sysv/linux/s390/bits/typesizes.h: New file. --- libc/sysdeps/generic/bits/typesizes.h.jj 2003-03-25 15:33:05.000000000 -0500 +++ libc/sysdeps/generic/bits/typesizes.h 2003-07-31 09:22:38.000000000 -0400 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/sysdeps/generic/bits/types.h.jj 2003-07-30 06:00:33.000000000 -0400 +++ libc/sysdeps/generic/bits/types.h 2003-07-31 09:38:38.000000000 -0400 @@ -1,5 +1,5 @@ /* bits/types.h -- definitions of __*_t types underlying *_t types. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 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 @@ -178,10 +178,10 @@ __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcn __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; +__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* These few don't really vary by system, they always correspond to one of the other defined types. */ -__STD_TYPE __SWORD_TYPE __ssize_t; /* Type of a byte count, or error. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef __quad_t *__qaddr_t; typedef char *__caddr_t; --- libc/sysdeps/mach/hurd/bits/typesizes.h.jj 2003-02-21 03:19:41.000000000 -0500 +++ libc/sysdeps/mach/hurd/bits/typesizes.h 2003-07-31 09:40:08.000000000 -0400 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE __S32_TYPE #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE __UQUAD_TYPE +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 256 --- libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h.jj 2002-11-02 20:21:17.000000000 -0500 +++ libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h 2003-07-31 09:40:18.000000000 -0400 @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. FreeBSD version. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 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 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE __S32_TYPE #define __BLKSIZE_T_TYPE __U32_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h.jj 2003-03-25 16:59:17.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h 2003-07-31 09:40:27.000000000 -0400 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __U32_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h.jj 2003-07-31 09:43:23.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h 2003-07-31 09:43:59.000000000 -0400 @@ -0,0 +1,66 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/s390 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. */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __SWBLK_T_TYPE __SLONGWORD_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SLONGWORD_TYPE + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ --- libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h.jj 2003-03-25 17:00:07.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h 2003-07-31 09:40:34.000000000 -0400 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 Jakub From jakub@redhat.com Thu Jul 31 14:04:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 14:04:00 -0000 Subject: [PATCH] Fix futimes (was Re: utimes()) In-Reply-To: <20030731134306.GA19853@tigers-lfs.nsw.bigpond.net.au> References: <20030731122612.GA620@tigers-lfs.nsw.bigpond.net.au> <20030731124735.GD20507@sunsite.ms.mff.cuni.cz> <20030731134306.GA19853@tigers-lfs.nsw.bigpond.net.au> Message-ID: <20030731140430.GG20507@sunsite.ms.mff.cuni.cz> On Thu, Jul 31, 2003 at 11:43:06PM +1000, Greg Schafer wrote: > Thanks, that fixed it. > > There is similar code in sysdeps/unix/sysv/linux/futimes.c and > sysdeps/posix/utimes.c that may also be affected. futimes.c seems to be indeed broken the same way (sorry, missed it). But sysdeps/posix/utimes.c is not: times->actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000; times->modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000; The question is what is utimes/futimes supposed to do if tv_usec > 999999. I couldn't find anything in POSIX about it, so I don't know which one of: tvp[0].tv_sec + (tvp[0].tv_usec >= 500000) tvp[0].tv_sec + tvp[0].tv_usec / 1000000 tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000 is needed (but then, it should probably used everywhere, not one way in some *utimes.c implementations and differently in others. 2003-07-31 Jakub Jelinek * sysdeps/unix/sysv/linux/futimes.c (__utimes): Add parens so that actime and modtime are computed properly. --- libc/sysdeps/unix/sysv/linux/futimes.c.jj 2003-07-16 06:10:01.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/futimes.c 2003-07-31 09:54:53.000000000 -0400 @@ -1,4 +1,4 @@ -/* futimes -- change access and modification times of open file. Stub version. +/* futimes -- change access and modification times of open file. Linux version. Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -58,8 +58,8 @@ __futimes (int fd, const struct timeval if (tvp != NULL) { times = &buf; - buf.actime = tvp[0].tv_sec + tvp[0].tv_usec >= 500000; - buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec >= 500000; + buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec >= 500000); + buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec >= 500000); } else times = NULL; Jakub From schwab@suse.de Thu Jul 31 14:27:00 2003 From: schwab@suse.de (Andreas Schwab) Date: Thu, 31 Jul 2003 14:27:00 -0000 Subject: [PATCH] Fix futimes (was Re: utimes()) In-Reply-To: <20030731140430.GG20507@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Thu, 31 Jul 2003 16:04:31 +0200") References: <20030731122612.GA620@tigers-lfs.nsw.bigpond.net.au> <20030731124735.GD20507@sunsite.ms.mff.cuni.cz> <20030731134306.GA19853@tigers-lfs.nsw.bigpond.net.au> <20030731140430.GG20507@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: |> The question is what is utimes/futimes supposed to do if |> tv_usec > 999999. I can't find any requirement that the argument must be normalized, so IMHO utimes should cope. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From kukuk@suse.de Thu Jul 31 14:28:00 2003 From: kukuk@suse.de (Thorsten Kukuk) Date: Thu, 31 Jul 2003 14:28:00 -0000 Subject: C++/dlerror/pthread problem Message-ID: <20030731142801.GA9594@suse.de> Hi, The appended example program works fine, if not linked against libpthread or if it is compiled as C program. But as C++ program linked against libpthread, it will seg.fault in dlerror(). Does somebody know why? I know it is a bad idea to call dlerror() without any other dl* call before, but people are doing so ... -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B -------------- next part -------------- /* Compile with g++ dlerror.cc -ldl -lpthread */ #include #include int main () { std::cerr << "vor dlerror" << std::endl; dlerror(); return 0; } From jakub@redhat.com Thu Jul 31 14:38:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 14:38:00 -0000 Subject: [PATCH] Fix utimes and futimes (take 2) In-Reply-To: References: <20030731122612.GA620@tigers-lfs.nsw.bigpond.net.au> <20030731124735.GD20507@sunsite.ms.mff.cuni.cz> <20030731134306.GA19853@tigers-lfs.nsw.bigpond.net.au> <20030731140430.GG20507@sunsite.ms.mff.cuni.cz> Message-ID: <20030731143815.GH20507@sunsite.ms.mff.cuni.cz> On Thu, Jul 31, 2003 at 04:27:12PM +0200, Andreas Schwab wrote: > Jakub Jelinek writes: > > |> The question is what is utimes/futimes supposed to do if > |> tv_usec > 999999. > > I can't find any requirement that the argument must be normalized, so > IMHO utimes should cope. 2003-07-31 Jakub Jelinek * sysdeps/unix/sysv/linux/utimes.c (__utimes): Fix actime and modtime computation. * sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise. * sysdeps/posix/utimes.c (__utimes): Likewise. --- libc/sysdeps/unix/sysv/linux/utimes.c.jj 2003-07-14 17:15:43.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/utimes.c 2003-07-31 08:43:08.000000000 -0400 @@ -47,8 +47,8 @@ __utimes (const char *file, const struct if (tvp != NULL) { times = &buf; - buf.actime = tvp[0].tv_sec + tvp[0].tv_usec >= 500000; - buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec >= 500000; + buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000; + buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec + 500000) / 1000000; } else times = NULL; --- libc/sysdeps/unix/sysv/linux/futimes.c.jj 2003-07-16 06:10:01.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/futimes.c 2003-07-31 09:54:53.000000000 -0400 @@ -1,4 +1,4 @@ -/* futimes -- change access and modification times of open file. Stub version. +/* futimes -- change access and modification times of open file. Linux version. Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -58,8 +58,8 @@ __futimes (int fd, const struct timeval if (tvp != NULL) { times = &buf; - buf.actime = tvp[0].tv_sec + tvp[0].tv_usec >= 500000; - buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec >= 500000; + buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000; + buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec + 500000) / 1000000; } else times = NULL; --- libc/sysdeps/posix/utimes.c.jj 2001-07-06 00:56:01.000000000 -0400 +++ libc/sysdeps/posix/utimes.c 2003-07-31 10:32:18.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 2000, 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 @@ -31,8 +31,8 @@ __utimes (const char *file, const struct if (tvp) { times = &buf; - times->actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000; - times->modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000; + buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000; + buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec + 500000) / 1000000; } else times = NULL; Jakub From jakub@redhat.com Thu Jul 31 14:39:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 14:39:00 -0000 Subject: [PATCH] Fix pthread.h comments Message-ID: <20030731143952.GI20507@sunsite.ms.mff.cuni.cz> Hi! PTHREAD_STACK_SIZE does not exist and some people are confused. 2003-07-31 Jakub Jelinek nptl/ * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr, pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to PTHREAD_STACK_MIN in comments. linuxthreads/ * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr, pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to PTHREAD_STACK_MIN in comments. --- libc/nptl/sysdeps/pthread/pthread.h.jj 2003-07-21 07:44:22.000000000 -0400 +++ libc/nptl/sysdeps/pthread/pthread.h 2003-07-31 10:20:27.000000000 -0400 @@ -291,7 +291,7 @@ extern int pthread_attr_getstackaddr (__ /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The - minimal size of the block must be PTHREAD_STACK_SIZE. */ + minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __THROW __attribute_deprecated__; @@ -302,7 +302,7 @@ extern int pthread_attr_getstacksize (__ __THROW; /* Add information about the minimum stack size needed for the thread - to be started. This size must never be less than PTHREAD_STACK_SIZE + to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __THROW; --- libc/linuxthreads/sysdeps/pthread/pthread.h.jj 2003-01-02 19:34:10.000000000 -0500 +++ libc/linuxthreads/sysdeps/pthread/pthread.h 2003-07-31 10:18:08.000000000 -0400 @@ -256,7 +256,7 @@ extern int pthread_attr_getguardsize (__ /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The - minimal size of the block must be PTHREAD_STACK_SIZE. */ + minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __THROW; @@ -279,7 +279,7 @@ extern int pthread_attr_getstack (__cons #endif /* Add information about the minimum stack size needed for the thread - to be started. This size must never be less than PTHREAD_STACK_SIZE + to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __THROW; Jakub From jakub@redhat.com Thu Jul 31 15:17:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 15:17:00 -0000 Subject: [PATCH] Sync ia64 bits/sigcontext.h with current kernels Message-ID: <20030731151636.GJ20507@sunsite.ms.mff.cuni.cz> Hi! 2.5.7 kernel introduced sc_ar25/sc_ar26, 2.5.73 changed ar25's comment and actually started to use it from what I can see. 2003-07-31 Jakub Jelinek * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h (struct sigcontext): Sync with 2.5.7 and 2.5.73 kernel changes. --- libc/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h.jj 2002-02-14 03:27:06.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h 2003-07-31 11:10:35.000000000 -0400 @@ -50,7 +50,9 @@ struct sigcontext struct ia64_fpreg sc_fr[128]; /* floating-point registers */ unsigned long int sc_rbs_base;/* NULL or new base of sighandler's rbs */ unsigned long int sc_loadrs; /* see description above */ - unsigned long int sc_rsvd[14];/* reserved for future use */ + unsigned long int sc_ar25; /* cmp8xchg16 uses this */ + unsigned long int sc_ar26; /* rsvd for scratch use */ + unsigned long int sc_rsvd[12];/* reserved for future use */ /* sc_mask is actually an sigset_t but we don't want to * include the kernel headers here. */ Jakub From davidm@napali.hpl.hp.com Thu Jul 31 16:28:00 2003 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 31 Jul 2003 16:28:00 -0000 Subject: C++/dlerror/pthread problem In-Reply-To: <20030731142801.GA9594@suse.de> References: <20030731142801.GA9594@suse.de> Message-ID: <16169.17330.754300.891351@napali.hpl.hp.com> >>>>> On Thu, 31 Jul 2003 16:28:01 +0200, Thorsten Kukuk said: Thorsten> The appended example program works fine, if not linked Thorsten> against libpthread or if it is compiled as C program. But Thorsten> as C++ program linked against libpthread, it will Thorsten> seg.fault in dlerror(). Thorsten> Does somebody know why? I know it is a bad idea to call Thorsten> dlerror() without any other dl* call before, but people Thorsten> are doing so ... Here is a possibility: depending on platform and exact version of libpthread, here is what happens: you link (and build) against libpthread, which will give you an "errno" that references a field in the thread descriptor. But since you never actually do any pthread calls, the thread descriptor for the main thread never gets set up. Thus, any attempt to use errno will cause a segfault. This is known to happen on ia64 with LinuxThreads. NPTL is fine, as far as I know. --david From jakub@redhat.com Thu Jul 31 17:16:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 17:16:00 -0000 Subject: [PATCH] Fix dlerror (was Re: C++/dlerror/pthread problem) In-Reply-To: <20030731142801.GA9594@suse.de> References: <20030731142801.GA9594@suse.de> Message-ID: <20030731171631.GK20507@sunsite.ms.mff.cuni.cz> On Thu, Jul 31, 2003 at 04:28:01PM +0200, Thorsten Kukuk wrote: > > Hi, > > The appended example program works fine, if not linked against > libpthread or if it is compiled as C program. But as C++ program > linked against libpthread, it will seg.fault in dlerror(). > > Does somebody know why? I know it is a bad idea to call dlerror() > without any other dl* call before, but people are doing so ... The problem is that key is only initialized if _dlerror_run is called. The following patch should fix it: 2003-07-31 Jakub Jelinek * dlfcn/dlerror.c (once): New. (dlerror): Call __libc_once. (_dlerror_run): Remove once. --- libc/dlfcn/dlerror.c.jj 2003-03-15 15:06:37.000000000 -0500 +++ libc/dlfcn/dlerror.c 2003-07-31 13:09:44.000000000 -0400 @@ -1,5 +1,5 @@ /* Return error detail for failing functions. - Copyright (C) 1995,1996,1997,1998,1999,2000,2002, 2003 + Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -38,6 +38,7 @@ static struct dl_action_result *static_b /* This is the key for the thread specific memory. */ static __libc_key_t key; +__libc_once_define (static, once); /* Destructor for the thread-specific data. */ static void init (void); @@ -50,6 +51,9 @@ dlerror (void) char *buf = NULL; struct dl_action_result *result; + /* If we have not yet initialized the buffer do it now. */ + __libc_once (once, init); + /* Get error string. */ result = (struct dl_action_result *) __libc_getspecific (key); if (result == NULL) @@ -100,7 +104,6 @@ int internal_function _dlerror_run (void (*operate) (void *), void *args) { - __libc_once_define (static, once); struct dl_action_result *result; /* If we have not yet initialized the buffer do it now. */ Jakub From jakub@redhat.com Thu Jul 31 23:52:00 2003 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 31 Jul 2003 23:52:00 -0000 Subject: [PATCH] Fix ssize_t definition on s390 32-bit (followup) In-Reply-To: <20030731135246.GF20507@sunsite.ms.mff.cuni.cz> References: <20030731132019.GE20507@sunsite.ms.mff.cuni.cz> <20030731135246.GF20507@sunsite.ms.mff.cuni.cz> Message-ID: <20030731235205.GL20507@sunsite.ms.mff.cuni.cz> On Thu, Jul 31, 2003 at 03:52:46PM +0200, Jakub Jelinek wrote: > Hi! > > On Thu, Jul 31, 2003 at 03:20:19PM +0200, Jakub Jelinek wrote: > > Kills lots of warnings I saw during last build. > > There is still a bunch of warnings on s390, because > > typedef long unsigned int size_t; > > __extension__ typedef int __ssize_t; > > Here is a patch which should fix it. Oops, I've missed typesizes.h in linuxthreads. Here is the rest of the patch. 2003-08-01 Jakub Jelinek * sysdeps/pthread/bits/typesizes.h (__SSIZE_T_TYPE): Define. * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__SSIZE_T_TYPE): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__SSIZE_T_TYPE): Likewise. * sysdeps/unix/sysv/linux/s390/bits/typesizes.h: New file. --- libc/linuxthreads/sysdeps/pthread/bits/typesizes.h.jj 2003-03-25 15:39:24.000000000 -0500 +++ libc/linuxthreads/sysdeps/pthread/bits/typesizes.h 2003-07-31 19:37:54.000000000 -0400 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE __S32_TYPE #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h.jj 2003-03-25 17:03:21.000000000 -0500 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h 2003-07-31 19:39:03.000000000 -0400 @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 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 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE __S32_TYPE #define __BLKSIZE_T_TYPE __U32_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h.jj 2003-03-25 17:02:20.000000000 -0500 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h 2003-07-31 19:39:21.000000000 -0400 @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 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 @@ -57,6 +57,7 @@ #define __TIMER_T_TYPE __S32_TYPE #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 --- libc/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h.jj 2003-07-31 09:43:23.000000000 -0400 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h 2003-07-31 19:40:40.000000000 -0400 @@ -0,0 +1,66 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/s390 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. */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __SWBLK_T_TYPE __SLONGWORD_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE __S32_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SLONGWORD_TYPE + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ Jakub