This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PowerPC fixes for compilation with gcc-4.0


gcc-4.0 doesn't optimize expressions of the form &(const_int)->field
early enough to satisfy an asm %i constraint, except for const_int == 0.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19708

nptl/ChangeLog
2005-02-14  Alan Modra  <amodra@bigpond.net.au>

	* sysdeps/powerpc/tcb-offsets.sym: Redefine to suit gcc4.


gcc-4.0 complains when a) inline functions in a nested scope are
declared static inline, and b) when a nested function is declared but
not defined (since 2005-02-03).  gcc-4.0 also does not define
__uint128_t on 32-bit targets.

2005-02-14  Alan Modra  <amodra@bigpond.net.au>

	* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Define
	with auto inline, and attribute always_inline.
	(elf_machine_rela_relative, elf_machine_lazy_rel): Likewise.
	(elf_machine_rel, elf_machine_rel_relative): Likewise.
	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
	(elf_machine_rela_relative, elf_machine_lazy_rel): Likewise.
	(elf_machine_rel, elf_machine_rel_relative): Likewise.
	(elf_machine_tprel): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h (elf_vrreg_t): Don't
	use __uint128_t.


Index: nptl/sysdeps/powerpc/tcb-offsets.sym
===================================================================
RCS file: /cvs/glibc/libc/nptl/sysdeps/powerpc/tcb-offsets.sym,v
retrieving revision 1.5
diff -u -p -r1.5 tcb-offsets.sym
--- nptl/sysdeps/powerpc/tcb-offsets.sym	15 Dec 2004 06:07:00 -0000	1.5
+++ nptl/sysdeps/powerpc/tcb-offsets.sym	10 Feb 2005 07:23:58 -0000
@@ -6,7 +6,8 @@
 -- Abuse tls.h macros to derive offsets relative to the thread register.
 # undef __thread_register
 # define __thread_register	((void *) 0)
-# define thread_offsetof(mem)	((void *) &THREAD_SELF->mem - (void *) 0)
+# define thread_offsetof(mem)	((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))
+
 
 #if TLS_MULTIPLE_THREADS_IN_TCB
 MULTIPLE_THREADS_OFFSET		thread_offsetof (header.multiple_threads)
Index: sysdeps/powerpc/powerpc32/dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc32/dl-machine.h,v
retrieving revision 1.11
diff -u -p -r1.11 dl-machine.h
--- sysdeps/powerpc/powerpc32/dl-machine.h	25 Jan 2005 10:42:04 -0000	1.11
+++ sysdeps/powerpc/powerpc32/dl-machine.h	10 Feb 2005 07:24:03 -0000
@@ -204,7 +204,7 @@ extern void _dl_reloc_overflow (struct l
    LOADADDR is the load address of the object; INFO is an array indexed
    by DT_* of the .dynamic section info.  */
 
-inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 		  const Elf32_Sym *sym, const struct r_found_version *version,
 		  void *const reloc_addr_arg)
@@ -298,7 +298,7 @@ elf_machine_rela (struct link_map *map, 
     }
 }
 
-static inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
 			   void *const reloc_addr_arg)
 {
@@ -306,13 +306,26 @@ elf_machine_rela_relative (Elf32_Addr l_
   *reloc_addr = l_addr + reloc->r_addend;
 }
 
-static inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_lazy_rel (struct link_map *map,
 		      Elf32_Addr l_addr, const Elf32_Rela *reloc)
 {
   /* elf_machine_runtime_setup handles this. */
 }
 
+auto inline void __attribute__ ((always_inline))
+elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+		 const ElfW(Sym) *sym, const struct r_found_version *version,
+		 void *const reloc_addr)
+{
+}
+
+auto inline void __attribute__ ((always_inline))
+elf_machine_rel_relative (ElfW(Addr) l_addr, const Elf32_Rel *reloc,
+			  void *const reloc_addr)
+{
+}
+
 /* The SVR4 ABI specifies that the JMPREL relocs must be inside the
    DT_RELA table.  */
 #define ELF_MACHINE_PLTREL_OVERLAP 1
Index: sysdeps/powerpc/powerpc64/dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/dl-machine.h,v
retrieving revision 1.21
diff -u -p -r1.21 dl-machine.h
--- sysdeps/powerpc/powerpc64/dl-machine.h	8 Jan 2005 07:07:01 -0000	1.21
+++ sysdeps/powerpc/powerpc64/dl-machine.h	10 Feb 2005 07:24:03 -0000
@@ -487,7 +487,7 @@ extern void _dl_reloc_overflow (struct l
                                 const Elf64_Sym *refsym)
                                 attribute_hidden;
 
-static inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
 			   void *const reloc_addr_arg)
 {
@@ -497,7 +497,7 @@ elf_machine_rela_relative (Elf64_Addr l_
 
 #if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
 /* This computes the value used by TPREL* relocs.  */
-static Elf64_Addr __attribute__ ((const))
+auto inline Elf64_Addr __attribute__ ((always_inline, const))
 elf_machine_tprel (struct link_map *map,
 		   struct link_map *sym_map,
 		   const Elf64_Sym *sym,
@@ -518,7 +518,7 @@ elf_machine_tprel (struct link_map *map,
 
 /* Perform the relocation specified by RELOC and SYM (which is fully
    resolved).  MAP is the object containing the reloc.  */
-static inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_rela (struct link_map *map,
 		  const Elf64_Rela *reloc,
 		  const Elf64_Sym *sym,
@@ -803,11 +803,24 @@ elf_machine_rela (struct link_map *map,
   MODIFIED_CODE_NOQUEUE (reloc_addr);
 }
 
-static inline void
+auto inline void __attribute__ ((always_inline))
 elf_machine_lazy_rel (struct link_map *map,
 		      Elf64_Addr l_addr, const Elf64_Rela *reloc)
 {
   /* elf_machine_runtime_setup handles this.  */
 }
 
+auto inline void __attribute__ ((always_inline))
+elf_machine_rel (struct link_map *map, const Elf64_Rel *reloc,
+		 const ElfW(Sym) *sym, const struct r_found_version *version,
+		 void *const reloc_addr)
+{
+}
+
+auto inline void __attribute__ ((always_inline))
+elf_machine_rel_relative (ElfW(Addr) l_addr, const Elf64_Rel *reloc,
+			  void *const reloc_addr)
+{
+}
+
 #endif /* RESOLVE */
Index: sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h,v
retrieving revision 1.11
diff -u -p -r1.11 procfs.h
--- sysdeps/unix/sysv/linux/powerpc/sys/procfs.h	17 Dec 2003 23:09:34 -0000	1.11
+++ sysdeps/unix/sysv/linux/powerpc/sys/procfs.h	10 Feb 2005 07:24:04 -0000
@@ -46,15 +46,10 @@ typedef elf_greg_t elf_gregset_t[ELF_NGR
 typedef double elf_fpreg_t;
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
-/* gcc 3.1 and newer support __uint128_t.  */
-#if !__GNUC_PREREQ(3,1)
-typedef struct {
-  unsigned long u[4];
-} __attribute((aligned(16))) __uint128_t;
-#endif
-
 /* Altivec registers */
-typedef __uint128_t elf_vrreg_t;
+typedef struct {
+  unsigned int u[4];
+} __attribute__ ((aligned (16))) elf_vrreg_t;
 typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
 #endif
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]