This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
mips/sysdep-cancel.h and librt
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 24 Aug 2004 19:11:12 +0100
- Subject: mips/sysdep-cancel.h and librt
I can't build the dynamic loader on MIPS because CENABLE, CDISABLE and
__local_multiple_threads are picking the wrong routines. The patch
below is based on what the i386 port does and seems to work for me.
Tested on mips64-linux-gnu (all three ABIs). Plesae install if OK.
Richard
linuxthreads/
* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (CENABLE, CDISABLE)
(__local_multiple_threads): Fix definitions for IS_IN_librt.
* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise.
Index: linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h,v
retrieving revision 1.2
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 sysdep-cancel.h
*** linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 28 Jul 2003 18:45:37 -0000 1.2
--- linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 24 Aug 2004 18:06:10 -0000
***************
*** 118,135 ****
# define CENABLE la t9, __pthread_enable_asynccancel; jalr t9;
# define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9;
# define __local_multiple_threads __pthread_multiple_threads
# else
# define CENABLE la t9, __libc_enable_asynccancel; jalr t9;
# define CDISABLE la t9, __libc_disable_asynccancel; jalr t9;
# define __local_multiple_threads __libc_multiple_threads
# endif
- # if !defined NOT_IN_libc
- # define __local_multiple_threads __libc_multiple_threads
- # else
- # define __local_multiple_threads __pthread_multiple_threads
- # endif
-
# ifndef __ASSEMBLER__
extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
--- 118,133 ----
# define CENABLE la t9, __pthread_enable_asynccancel; jalr t9;
# define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9;
# define __local_multiple_threads __pthread_multiple_threads
+ # elif defined IS_IN_librt
+ # define CENABLE la t9, __librt_enable_asynccancel; jalr t9;
+ # define CDISABLE la t9, __librt_disable_asynccancel; jalr t9;
+ # define __local_multiple_threads __librt_multiple_threads
# else
# define CENABLE la t9, __libc_enable_asynccancel; jalr t9;
# define CDISABLE la t9, __libc_disable_asynccancel; jalr t9;
# define __local_multiple_threads __libc_multiple_threads
# endif
# ifndef __ASSEMBLER__
extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
Index: linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h,v
retrieving revision 1.1
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 sysdep-cancel.h
*** linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 1 Oct 2003 06:59:32 -0000 1.1
--- linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 24 Aug 2004 18:06:10 -0000
***************
*** 119,136 ****
# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9;
# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9;
# define __local_multiple_threads __pthread_multiple_threads
# else
# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9;
# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9;
# define __local_multiple_threads __libc_multiple_threads
# endif
- # if !defined NOT_IN_libc
- # define __local_multiple_threads __libc_multiple_threads
- # else
- # define __local_multiple_threads __pthread_multiple_threads
- # endif
-
# ifndef __ASSEMBLER__
extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
--- 119,134 ----
# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9;
# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9;
# define __local_multiple_threads __pthread_multiple_threads
+ # elif defined IS_IN_librt
+ # define CENABLE PTR_LA t9, __librt_enable_asynccancel; jalr t9;
+ # define CDISABLE PTR_LA t9, __librt_disable_asynccancel; jalr t9;
+ # define __local_multiple_threads __librt_multiple_threads
# else
# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9;
# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9;
# define __local_multiple_threads __libc_multiple_threads
# endif
# ifndef __ASSEMBLER__
extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)