public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix locale/weight.h with GCC 3.5
@ 2004-09-06 18:52 Andreas Jaeger
  2004-09-06 19:22 ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-06 18:52 UTC (permalink / raw)
  To: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 4143 bytes --]

Compiling glibc with GCC 3.5 I got the following failure:

In file included from strcoll_l.c:87:
../locale/weight.h: In function `__strcoll_l':
../locale/weight.h:24: error: invalid storage class for function `findidx'
make[2]: *** [/builds/glibc/3.5/string/strcoll_l.o] Error 1
make[2]: Leaving directory `/cvs/libc/string'

Since we include weight.h in block scope, we have to remove the static to make 
it work with GCC 3.5 (see 
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02641.html).  There are some 
more places that fail similiar.

Ok to commit the appended patch?

There're some more places like this - expect a followup-email tomorrow,

Andreas

2004-09-06  Andreas Jaeger  <aj@suse.de>

 * locale/weight.h (findidx): Remove static, it's not supported
 anymore with GCC 3.5 in a block scope.
 * locale/weightwc.h (findidx): Likewise.
 * posix/regcomp.c (seek_collating_symbol_entry): Likewise.
 (lookup_collation_sequence_value): Likewise.
 (build_range_exp): Likewise.
 (build_collating_symbol): Likewise.

============================================================
Index: posix/regcomp.c
--- posix/regcomp.c 5 Mar 2004 10:43:54 -0000 1.80
+++ posix/regcomp.c 6 Sep 2004 18:51:04 -0000
@@ -2682,7 +2682,7 @@ parse_bracket_exp (regexp, dfa, token, s
      Seek the collating symbol entry correspondings to NAME.
      Return the index of the symbol in the SYMB_TABLE.  */
 
-  static inline int32_t
+  inline int32_t
   __attribute ((always_inline))
   seek_collating_symbol_entry (name, name_len)
   const unsigned char *name;
@@ -2715,7 +2715,7 @@ parse_bracket_exp (regexp, dfa, token, s
      Look up the collation sequence value of BR_ELEM.
      Return the value if succeeded, UINT_MAX otherwise.  */
 
-  static inline unsigned int
+  inline unsigned int
   __attribute ((always_inline))
   lookup_collation_sequence_value (br_elem)
   bracket_elem_t *br_elem;
@@ -2783,7 +2783,7 @@ parse_bracket_exp (regexp, dfa, token, s
      mbcset->range_ends, is a pointer argument sinse we may
      update it.  */
 
-  static inline reg_errcode_t
+  inline reg_errcode_t
   __attribute ((always_inline))
   build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
   re_charset_t *mbcset;
@@ -2866,7 +2866,7 @@ parse_bracket_exp (regexp, dfa, token, s
      COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
      pointer argument sinse we may update it.  */
 
-  static inline reg_errcode_t
+  inline reg_errcode_t
   __attribute ((always_inline))
   build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
   re_charset_t *mbcset;
============================================================
Index: locale/weight.h
--- locale/weight.h 11 Jun 2003 21:52:12 -0000 1.19
+++ locale/weight.h 6 Sep 2004 18:51:04 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2003,2004 Free Software Foundation, 
Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -18,7 +18,7 @@
    02111-1307 USA.  */
 
 /* Find index of weight.  */
-static inline int32_t
+inline int32_t
 __attribute ((always_inline))
 findidx (const unsigned char **cpp)
 {
============================================================
Index: locale/weightwc.h
--- locale/weightwc.h 13 Jun 2003 20:44:58 -0000 1.9
+++ locale/weightwc.h 6 Sep 2004 18:51:04 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2001,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -18,7 +18,7 @@
    02111-1307 USA.  */
 
 /* Find index of weight.  */
-static inline int32_t
+inline int32_t
 __attribute ((always_inline))
 findidx (const wint_t **cpp)
 {

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-06 18:52 Fix locale/weight.h with GCC 3.5 Andreas Jaeger
@ 2004-09-06 19:22 ` Andreas Jaeger
  2004-09-06 21:21   ` Roland McGrath
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-06 19:22 UTC (permalink / raw)
  To: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 1873 bytes --]

On Monday 06 September 2004 20:51, Andreas Jaeger wrote:
> Compiling glibc with GCC 3.5 I got the following failure:
>
> In file included from strcoll_l.c:87:
> ../locale/weight.h: In function `__strcoll_l':
> ../locale/weight.h:24: error: invalid storage class for function `findidx'
> make[2]: *** [/builds/glibc/3.5/string/strcoll_l.o] Error 1
> make[2]: Leaving directory `/cvs/libc/string'
>
> Since we include weight.h in block scope, we have to remove the static to
> make it work with GCC 3.5 (see
> http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02641.html).  There are some
> more places that fail similiar.
>
> Ok to commit the appended patch?
>
> There're some more places like this - expect a followup-email tomorrow,

This is a mess - if I change elf/dynamic-link.h in a similar way  (see below) 
I finally get:

/builds/glibc/3.5/elf/dl-load.os(.text+0x0): In function 
`elf_get_dynamic_info':
/cvs/libc/elf/dynamic-link.h:70: multiple definition of `elf_get_dynamic_info'
/builds/glibc/3.5/elf/rtld.os(.text+0x40):/cvs/libc/elf/dynamic-link.h:70: 
firstdefined here

Any ideas?

Andreas

============================================================
Index: elf/dynamic-link.h
--- elf/dynamic-link.h 6 Mar 2004 09:47:17 -0000 1.50
+++ elf/dynamic-link.h 6 Sep 2004 19:22:03 -0000
@@ -65,7 +65,7 @@ elf_machine_lazy_rel (struct link_map *m
 
 /* Read the dynamic section at DYN and fill in INFO with indices DT_*.  */
 
-static inline void __attribute__ ((unused, always_inline))
+inline void __attribute__ ((unused, always_inline))
 elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 {
   ElfW(Dyn) *dyn = l->l_ld;


-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-06 19:22 ` Andreas Jaeger
@ 2004-09-06 21:21   ` Roland McGrath
  2004-09-07  5:06     ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Roland McGrath @ 2004-09-06 21:21 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

> This is a mess - if I change elf/dynamic-link.h in a similar way (see
> below) I finally get:

dynamic-link.h is used at different scopes in different places.
You can just make the use of static conditional on #ifndef RTLD_BOOTSTRAP.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-06 21:21   ` Roland McGrath
@ 2004-09-07  5:06     ` Andreas Jaeger
  2004-09-07  8:02       ` Roland McGrath
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-07  5:06 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

On Monday 06 September 2004 23:21, Roland McGrath wrote:
> > This is a mess - if I change elf/dynamic-link.h in a similar way (see
> > below) I finally get:
>
> dynamic-link.h is used at different scopes in different places.
> You can just make the use of static conditional on #ifndef RTLD_BOOTSTRAP.

Does not seem to help - we include it twice in local scope:
Once in rtld.c where this helps and once in dl-load.c where it won't help :-(

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-07  5:06     ` Andreas Jaeger
@ 2004-09-07  8:02       ` Roland McGrath
  2004-09-07 11:26         ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Roland McGrath @ 2004-09-07  8:02 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

> On Monday 06 September 2004 23:21, Roland McGrath wrote:
> > > This is a mess - if I change elf/dynamic-link.h in a similar way (see
> > > below) I finally get:
> >
> > dynamic-link.h is used at different scopes in different places.
> > You can just make the use of static conditional on #ifndef RTLD_BOOTSTRAP.
> 
> Does not seem to help - we include it twice in local scope:
> Once in rtld.c where this helps and once in dl-load.c where it won't help :-(

In dl-load.c, dynamic-link.h is used only at global scope.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-07  8:02       ` Roland McGrath
@ 2004-09-07 11:26         ` Andreas Jaeger
  2004-09-07 18:09           ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-07 11:26 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

Roland McGrath <roland@redhat.com> writes:

>> On Monday 06 September 2004 23:21, Roland McGrath wrote:
>> > > This is a mess - if I change elf/dynamic-link.h in a similar way (see
>> > > below) I finally get:
>> >
>> > dynamic-link.h is used at different scopes in different places.
>> > You can just make the use of static conditional on #ifndef RTLD_BOOTSTRAP.
>> 
>> Does not seem to help - we include it twice in local scope:
>> Once in rtld.c where this helps and once in dl-load.c where it won't help :-(
>
> In dl-load.c, dynamic-link.h is used only at global scope.

dl-reloc is the other culprit -  I'm looking into it now,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-07 11:26         ` Andreas Jaeger
@ 2004-09-07 18:09           ` Andreas Jaeger
  2004-09-07 21:26             ` Roland McGrath
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-07 18:09 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 3079 bytes --]

On Tuesday 07 September 2004 13:25, Andreas Jaeger wrote:
> Roland McGrath <roland@redhat.com> writes:
> >> On Monday 06 September 2004 23:21, Roland McGrath wrote:
> >> > > This is a mess - if I change elf/dynamic-link.h in a similar way
> >> > > (see below) I finally get:
> >> >
> >> > dynamic-link.h is used at different scopes in different places.
> >> > You can just make the use of static conditional on #ifndef
> >> > RTLD_BOOTSTRAP.
> >>
> >> Does not seem to help - we include it twice in local scope:
> >> Once in rtld.c where this helps and once in dl-load.c where it won't
> >> help :-(
> >
> > In dl-load.c, dynamic-link.h is used only at global scope.
>
> dl-reloc is the other culprit -  I'm looking into it now,

I'm testing currently the appended patch - with GCC 3.3 and 3.5.

What do you think of it?
Andreas

============================================================
Index: elf/dynamic-link.h
--- elf/dynamic-link.h 6 Mar 2004 09:47:17 -0000 1.50
+++ elf/dynamic-link.h 7 Sep 2004 17:31:45 -0000
@@ -64,8 +64,10 @@ elf_machine_lazy_rel (struct link_map *m
 
 
 /* Read the dynamic section at DYN and fill in INFO with indices DT_*.  */
-
-static inline void __attribute__ ((unused, always_inline))
+#if (!defined RTLD_BOOTSTRAP && !defined LOCAL_SCOPE)
+static
+#endif
+inline void __attribute__ ((unused, always_inline))
 elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 {
   ElfW(Dyn) *dyn = l->l_ld;
============================================================
Index: elf/do-rel.h
--- elf/do-rel.h 30 Jan 2003 17:36:34 -0000 1.32
+++ elf/do-rel.h 7 Sep 2004 17:31:45 -0000
@@ -49,7 +49,7 @@
    relocations; they should be set up to call _dl_runtime_resolve, rather
    than fully resolved now.  */
 
-static inline void __attribute__ ((always_inline))
+inline void __attribute__ ((always_inline))
 elf_dynamic_do_rel (struct link_map *map,
       ElfW(Addr) reladdr, ElfW(Addr) relsize,
       int lazy)
============================================================
Index: elf/dl-reloc.c
--- elf/dl-reloc.c 7 Mar 2004 05:21:01 -0000 1.96
+++ elf/dl-reloc.c 7 Sep 2004 17:31:45 -0000
@@ -27,6 +27,8 @@
 #include <sys/types.h>
 #include "dynamic-link.h"
 
+#define LOCAL_SCOPE
+
 /* Statistics function.  */
 #ifdef SHARED
 # define bump_num_cache_relocations() ++GL(dl_num_cache_relocations)
============================================================
Index: elf/dl-conflict.c
--- elf/dl-conflict.c 5 Mar 2004 10:14:50 -0000 1.11
+++ elf/dl-conflict.c 7 Sep 2004 17:31:45 -0000
@@ -57,7 +57,9 @@ _dl_resolve_conflicts (struct link_map *
     struct link_map *resolve_conflict_map __attribute__ ((__unused__))
       = GL(dl_loaded);
 
+#define LOCAL_SCOPE
 #include "dynamic-link.h"
+#undef LOCAL_SCOPE
 
     GL(dl_num_cache_relocations) += conflictend - conflict;
 


-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-07 18:09           ` Andreas Jaeger
@ 2004-09-07 21:26             ` Roland McGrath
  2004-09-08  4:57               ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Roland McGrath @ 2004-09-07 21:26 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

Can't you just make that #ifndef RESOLVE?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-07 21:26             ` Roland McGrath
@ 2004-09-08  4:57               ` Andreas Jaeger
  2004-09-08  5:40                 ` Andreas Jaeger
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-08  4:57 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Tuesday 07 September 2004 23:26, Roland McGrath wrote:
> Can't you just make that #ifndef RESOLVE?

Yeah!  That seems to work.  I'll do now some more tests and send a proper 
patch.

Thanks,
Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08  4:57               ` Andreas Jaeger
@ 2004-09-08  5:40                 ` Andreas Jaeger
  2004-09-08 17:01                   ` Roland McGrath
  2004-09-21  7:19                   ` Andreas Jaeger
  0 siblings, 2 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-08  5:40 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath


[-- Attachment #1.1: Type: text/plain, Size: 671 bytes --]

On Wednesday 08 September 2004 06:57, Andreas Jaeger wrote:
> On Tuesday 07 September 2004 23:26, Roland McGrath wrote:
> > Can't you just make that #ifndef RESOLVE?
>
> Yeah!  That seems to work.  I'll do now some more tests and send a proper
> patch.

Here's a patch - it has been tested with GCC 3.3.  Testing with 3.4 is still 
in progress - and it works with 3.5 as far as I get (I run into an ICE in 
gcc).  All tests were done on AMD64.

Ok to commit?

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #1.2: libc-diff --]
[-- Type: text/x-diff, Size: 5979 bytes --]

2004-09-07  Andreas Jaeger  <aj@suse.de>


	* sysdeps/x86_64/dl-machine.h (elf_machine_rela_relative): Remove
	static, add always_inline attribute.
	(elf_machine_rela): Likewise.
	(elf_machine_lazy_rel): Likewise.

	* elf/dynamic-link.h (elf_get_dynamic_info): Make static
	dependend on !RESOLVE so that it's not defined in local
	scope.

	* locale/weight.h (findidx): Remove static, it's not supported
	anymore with GCC 3.5 in a block scope.
	* locale/weightwc.h (findidx): Likewise.
	* posix/regcomp.c (seek_collating_symbol_entry): Likewise.
	(lookup_collation_sequence_value): Likewise.
	(build_range_exp): Likewise.
	(build_collating_symbol): Likewise.
	* iconv/iconvconfig.c (write_output): Likewise.
	* elf/do-rel.h (elf_dynamic_do_rel): Likewise.

============================================================
Index: sysdeps/x86_64/dl-machine.h
--- sysdeps/x86_64/dl-machine.h	5 Mar 2004 10:14:47 -0000	1.25
+++ sysdeps/x86_64/dl-machine.h	8 Sep 2004 05:35:58 -0000
@@ -355,7 +386,8 @@ elf_machine_plt_value (struct link_map *
 /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
    MAP is the object containing the reloc.  */
 
-static inline void
+inline void
+__attribute ((always_inline))
 elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 		  const Elf64_Sym *sym, const struct r_found_version *version,
 		  void *const reloc_addr_arg)
@@ -520,7 +552,8 @@ elf_machine_rela (struct link_map *map, 
     }
 }
 
-static inline void
+inline void
+__attribute ((always_inline))
 elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
 			   void *const reloc_addr_arg)
 {
@@ -529,7 +562,8 @@ elf_machine_rela_relative (Elf64_Addr l_
   *reloc_addr = l_addr + reloc->r_addend;
 }
 
-static inline void
+inline void
+__attribute ((always_inline))
 elf_machine_lazy_rel (struct link_map *map,
 		      Elf64_Addr l_addr, const Elf64_Rela *reloc)
 {
============================================================
Index: locale/weightwc.h
--- locale/weightwc.h	13 Jun 2003 20:44:58 -0000	1.9
+++ locale/weightwc.h	8 Sep 2004 05:35:58 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2001,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -18,7 +18,7 @@
    02111-1307 USA.  */
 
 /* Find index of weight.  */
-static inline int32_t
+inline int32_t
 __attribute ((always_inline))
 findidx (const wint_t **cpp)
 {
============================================================
Index: locale/weight.h
--- locale/weight.h	11 Jun 2003 21:52:12 -0000	1.19
+++ locale/weight.h	8 Sep 2004 05:35:58 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -18,7 +18,7 @@
    02111-1307 USA.  */
 
 /* Find index of weight.  */
-static inline int32_t
+inline int32_t
 __attribute ((always_inline))
 findidx (const unsigned char **cpp)
 {
============================================================
Index: elf/dynamic-link.h
--- elf/dynamic-link.h	6 Mar 2004 09:47:17 -0000	1.50
+++ elf/dynamic-link.h	8 Sep 2004 05:35:58 -0000
@@ -64,8 +64,10 @@ elf_machine_lazy_rel (struct link_map *m
 
 
 /* Read the dynamic section at DYN and fill in INFO with indices DT_*.  */
-
-static inline void __attribute__ ((unused, always_inline))
+#ifndef RESOLVE
+static
+#endif
+inline void __attribute__ ((unused, always_inline))
 elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 {
   ElfW(Dyn) *dyn = l->l_ld;
============================================================
Index: elf/do-rel.h
--- elf/do-rel.h	30 Jan 2003 17:36:34 -0000	1.32
+++ elf/do-rel.h	8 Sep 2004 05:35:59 -0000
@@ -49,7 +49,7 @@
    relocations; they should be set up to call _dl_runtime_resolve, rather
    than fully resolved now.  */
 
-static inline void __attribute__ ((always_inline))
+inline void __attribute__ ((always_inline))
 elf_dynamic_do_rel (struct link_map *map,
 		    ElfW(Addr) reladdr, ElfW(Addr) relsize,
 		    int lazy)
============================================================
Index: posix/regcomp.c
--- posix/regcomp.c	5 Mar 2004 10:43:54 -0000	1.80
+++ posix/regcomp.c	8 Sep 2004 05:36:00 -0000
@@ -2682,7 +2682,7 @@ parse_bracket_exp (regexp, dfa, token, s
      Seek the collating symbol entry correspondings to NAME.
      Return the index of the symbol in the SYMB_TABLE.  */
 
-  static inline int32_t
+  inline int32_t
   __attribute ((always_inline))
   seek_collating_symbol_entry (name, name_len)
 	 const unsigned char *name;
@@ -2715,7 +2715,7 @@ parse_bracket_exp (regexp, dfa, token, s
      Look up the collation sequence value of BR_ELEM.
      Return the value if succeeded, UINT_MAX otherwise.  */
 
-  static inline unsigned int
+  inline unsigned int
   __attribute ((always_inline))
   lookup_collation_sequence_value (br_elem)
 	 bracket_elem_t *br_elem;
@@ -2783,7 +2783,7 @@ parse_bracket_exp (regexp, dfa, token, s
      mbcset->range_ends, is a pointer argument sinse we may
      update it.  */
 
-  static inline reg_errcode_t
+  inline reg_errcode_t
   __attribute ((always_inline))
   build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
 	 re_charset_t *mbcset;
@@ -2866,7 +2866,7 @@ parse_bracket_exp (regexp, dfa, token, s
      COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
      pointer argument sinse we may update it.  */
 
-  static inline reg_errcode_t
+  inline reg_errcode_t
   __attribute ((always_inline))
   build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
 	 re_charset_t *mbcset;

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08  5:40                 ` Andreas Jaeger
@ 2004-09-08 17:01                   ` Roland McGrath
  2004-09-08 17:24                     ` Andreas Jaeger
  2004-09-21  7:19                   ` Andreas Jaeger
  1 sibling, 1 reply; 19+ messages in thread
From: Roland McGrath @ 2004-09-08 17:01 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

> -static inline void
> +inline void
> +__attribute ((always_inline))
>  elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
>  		  const Elf64_Sym *sym, const struct r_found_version *version,
>  		  void *const reloc_addr_arg)

Does this really do the right thing in all of 3.[345]?
I would think this would generate an external entry point too.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 17:01                   ` Roland McGrath
@ 2004-09-08 17:24                     ` Andreas Jaeger
  2004-09-08 17:46                       ` Roland McGrath
  2004-09-08 19:44                       ` Andreas Jaeger
  0 siblings, 2 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-08 17:24 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

Roland McGrath <roland@redhat.com> writes:

>> -static inline void
>> +inline void
>> +__attribute ((always_inline))
>>  elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
>>  		  const Elf64_Sym *sym, const struct r_found_version *version,
>>  		  void *const reloc_addr_arg)
>
> Does this really do the right thing in all of 3.[345]?
> I would think this would generate an external entry point too.

It seems so :-(

$ nm dl-conflict.os
                 U _dl_argv_internal
                 U _dl_dprintf
                 U _dl_reloc_bad_type
00000000000000a0 T _dl_resolve_conflicts
0000000000000000 t elf_machine_rela.0
                 U _GLOBAL_OFFSET_TABLE_
0000000000000017 r .LC0
0000000000000000 r .LC1
0000000000000000 r .LC2
                 U _rtld_local
                 U _rtld_local_ro

So, should I add #ifndef RESOLVE here also?

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 17:24                     ` Andreas Jaeger
@ 2004-09-08 17:46                       ` Roland McGrath
  2004-09-08 19:33                         ` Andreas Jaeger
  2004-09-08 19:44                       ` Andreas Jaeger
  1 sibling, 1 reply; 19+ messages in thread
From: Roland McGrath @ 2004-09-08 17:46 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

> So, should I add #ifndef RESOLVE here also?

Humph.  I don't think we want to have to tweak every dl-machine.h that way.
But I don't see a better plan off hand.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 17:46                       ` Roland McGrath
@ 2004-09-08 19:33                         ` Andreas Jaeger
  0 siblings, 0 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-08 19:33 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On Wednesday 08 September 2004 19:46, Roland McGrath wrote:
> > So, should I add #ifndef RESOLVE here also?
>
> Humph.  I don't think we want to have to tweak every dl-machine.h that way.
> But I don't see a better plan off hand.

Those parts are already surrounded by #ifdef RESOLVE.

This is really a mess.  I'll ask the compiler folks what goes wrong here,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 17:24                     ` Andreas Jaeger
  2004-09-08 17:46                       ` Roland McGrath
@ 2004-09-08 19:44                       ` Andreas Jaeger
  2004-09-08 20:02                         ` Roland McGrath
  2004-09-09  8:19                         ` Jakub Jelinek
  1 sibling, 2 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-08 19:44 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 2252 bytes --]

On Wednesday 08 September 2004 19:24, Andreas Jaeger wrote:
> Roland McGrath <roland@redhat.com> writes:
> >> -static inline void
> >> +inline void
> >> +__attribute ((always_inline))
> >>  elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
> >>      const Elf64_Sym *sym, const struct r_found_version *version,
> >>      void *const reloc_addr_arg)
> >
> > Does this really do the right thing in all of 3.[345]?
> > I would think this would generate an external entry point too.
>
> It seems so :-(
>
> $ nm dl-conflict.os
>                  U _dl_argv_internal
>                  U _dl_dprintf
>                  U _dl_reloc_bad_type
> 00000000000000a0 T _dl_resolve_conflicts
> 0000000000000000 t elf_machine_rela.0
>                  U _GLOBAL_OFFSET_TABLE_
> 0000000000000017 r .LC0
> 0000000000000000 r .LC1
> 0000000000000000 r .LC2
>                  U _rtld_local
>                  U _rtld_local_ro
>
> So, should I add #ifndef RESOLVE here also?

Wait - this seems to be produced even with the current glibc without my 
changes (glibc compiled by GCC 3.3):
nm /lib64/ld-linux-x86-64.so.2 |grep elf_machine_rela
0000000000000d40 t elf_machine_rela.0
0000000000007fa0 t elf_machine_rela.0
000000000000d010 t elf_machine_rela.0
0000000000000d70 t elf_machine_rela_relative.1
0000000000008330 t elf_machine_rela_relative.1

For reference, compile:
int
test (int j)
{
  
static  inline int
    __attribute__ ((always_inline))
    test_inline (int i)
    {
      return i++;
    }
  
  return test_inline (j);
}

I get with GCC 3.3:
gromit:/tmp:[0]$ gcc -Wall -c t.c -O2
gromit:/tmp:[0]$ nm t.o
0000000000000010 T test
0000000000000000 t test_inline.0

But with 3.4 (and also 3.5 removing the static):
gromit:/tmp:[0]$ /opt/gcc/3.4-devel/bin/gcc -Wall -c t.c -O2
gromit:/tmp:[0]$ nm t.o
0000000000000000 T test


It's a local entry point in 3.3.

The local entry point exists for me with both 3.3 and 3.5 in dl-reloc.o.

I guess we should go with my patch.  Ok? 

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 19:44                       ` Andreas Jaeger
@ 2004-09-08 20:02                         ` Roland McGrath
  2004-09-09  8:19                         ` Jakub Jelinek
  1 sibling, 0 replies; 19+ messages in thread
From: Roland McGrath @ 2004-09-08 20:02 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker

> On Wednesday 08 September 2004 19:24, Andreas Jaeger wrote:
> > Roland McGrath <roland@redhat.com> writes:
> > >> -static inline void
> > >> +inline void
> > >> +__attribute ((always_inline))
> > >>  elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
> > >>      const Elf64_Sym *sym, const struct r_found_version *version,
> > >>      void *const reloc_addr_arg)
> > >
> > > Does this really do the right thing in all of 3.[345]?
> > > I would think this would generate an external entry point too.
> >
> > It seems so :-(
[...]
> > 0000000000000000 t elf_machine_rela.0

Not external.  The question is why is it there at all?

> Wait - this seems to be produced even with the current glibc without my 
> changes (glibc compiled by GCC 3.3):
> nm /lib64/ld-linux-x86-64.so.2 |grep elf_machine_rela
> 0000000000000d40 t elf_machine_rela.0
> 0000000000007fa0 t elf_machine_rela.0
> 000000000000d010 t elf_machine_rela.0
> 0000000000000d70 t elf_machine_rela_relative.1
> 0000000000008330 t elf_machine_rela_relative.1

These are just uninlined statics.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08 19:44                       ` Andreas Jaeger
  2004-09-08 20:02                         ` Roland McGrath
@ 2004-09-09  8:19                         ` Jakub Jelinek
  2004-09-09  9:20                           ` Andreas Jaeger
  1 sibling, 1 reply; 19+ messages in thread
From: Jakub Jelinek @ 2004-09-09  8:19 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: libc-hacker, Roland McGrath

On Wed, Sep 08, 2004 at 09:44:33PM +0200, Andreas Jaeger wrote:
> Wait - this seems to be produced even with the current glibc without my 
> changes (glibc compiled by GCC 3.3):
> nm /lib64/ld-linux-x86-64.so.2 |grep elf_machine_rela
> 0000000000000d40 t elf_machine_rela.0
> 0000000000007fa0 t elf_machine_rela.0
> 000000000000d010 t elf_machine_rela.0
> 0000000000000d70 t elf_machine_rela_relative.1
> 0000000000008330 t elf_machine_rela_relative.1
> 
> For reference, compile:
> int
> test (int j)
> {
>   
> static  inline int
>     __attribute__ ((always_inline))
>     test_inline (int i)
>     {
>       return i++;
>     }
>   
>   return test_inline (j);
> }
> 
> I get with GCC 3.3:
> gromit:/tmp:[0]$ gcc -Wall -c t.c -O2
> gromit:/tmp:[0]$ nm t.o
> 0000000000000010 T test
> 0000000000000000 t test_inline.0

You mean hammer branch GCC 3.3, right?
Stock 3.3 should be ok.  GCC 3.4 initially also emitted successfully inlined
nested functions as separate functions too, but this was fixed in July this
year, see PR middle-end/15345, c/16450.

	Jakub

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-09  8:19                         ` Jakub Jelinek
@ 2004-09-09  9:20                           ` Andreas Jaeger
  0 siblings, 0 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-09  9:20 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: libc-hacker, Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]

Jakub Jelinek <jakub@redhat.com> writes:

> On Wed, Sep 08, 2004 at 09:44:33PM +0200, Andreas Jaeger wrote:
>> Wait - this seems to be produced even with the current glibc without my 
>> changes (glibc compiled by GCC 3.3):
>> nm /lib64/ld-linux-x86-64.so.2 |grep elf_machine_rela
>> 0000000000000d40 t elf_machine_rela.0
>> 0000000000007fa0 t elf_machine_rela.0
>> 000000000000d010 t elf_machine_rela.0
>> 0000000000000d70 t elf_machine_rela_relative.1
>> 0000000000008330 t elf_machine_rela_relative.1
>> 
>> For reference, compile:
>> int
>> test (int j)
>> {
>>   
>> static  inline int
>>     __attribute__ ((always_inline))
>>     test_inline (int i)
>>     {
>>       return i++;
>>     }
>>   
>>   return test_inline (j);
>> }
>> 
>> I get with GCC 3.3:
>> gromit:/tmp:[0]$ gcc -Wall -c t.c -O2
>> gromit:/tmp:[0]$ nm t.o
>> 0000000000000010 T test
>> 0000000000000000 t test_inline.0
>
> You mean hammer branch GCC 3.3, right?

Yes, I do.

> Stock 3.3 should be ok.  GCC 3.4 initially also emitted successfully inlined
> nested functions as separate functions too, but this was fixed in July this
> year, see PR middle-end/15345, c/16450.

That explains 3.4.  But why do I get these also with GCC 3.5 with my
patch (nm elf/dl-reloc.o):

00000000000002a0 t elf_machine_lazy_rel.7373
00000000000002f0 t elf_machine_rela.7361
0000000000000110 t elf_machine_rela_relative.7369

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Fix locale/weight.h with GCC 3.5
  2004-09-08  5:40                 ` Andreas Jaeger
  2004-09-08 17:01                   ` Roland McGrath
@ 2004-09-21  7:19                   ` Andreas Jaeger
  1 sibling, 0 replies; 19+ messages in thread
From: Andreas Jaeger @ 2004-09-21  7:19 UTC (permalink / raw)
  To: libc-hacker; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

Andreas Jaeger <aj@suse.de> writes:

> On Wednesday 08 September 2004 06:57, Andreas Jaeger wrote:
>> On Tuesday 07 September 2004 23:26, Roland McGrath wrote:
>> > Can't you just make that #ifndef RESOLVE?
>>
>> Yeah!  That seems to work.  I'll do now some more tests and send a proper
>> patch.
>
> Here's a patch - it has been tested with GCC 3.3.  Testing with 3.4 is still 
> in progress - and it works with 3.5 as far as I get (I run into an ICE in 
> gcc).  All tests were done on AMD64.

GCC is now fixed so that GCC 4.0 can compile most of glibc - but
something is miscompiled so that glibc crashes building sunrpc.

But nevertheless: My patch is still valid and has been used with
different compilers.  Ok to commit now?

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-09-21  7:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-06 18:52 Fix locale/weight.h with GCC 3.5 Andreas Jaeger
2004-09-06 19:22 ` Andreas Jaeger
2004-09-06 21:21   ` Roland McGrath
2004-09-07  5:06     ` Andreas Jaeger
2004-09-07  8:02       ` Roland McGrath
2004-09-07 11:26         ` Andreas Jaeger
2004-09-07 18:09           ` Andreas Jaeger
2004-09-07 21:26             ` Roland McGrath
2004-09-08  4:57               ` Andreas Jaeger
2004-09-08  5:40                 ` Andreas Jaeger
2004-09-08 17:01                   ` Roland McGrath
2004-09-08 17:24                     ` Andreas Jaeger
2004-09-08 17:46                       ` Roland McGrath
2004-09-08 19:33                         ` Andreas Jaeger
2004-09-08 19:44                       ` Andreas Jaeger
2004-09-08 20:02                         ` Roland McGrath
2004-09-09  8:19                         ` Jakub Jelinek
2004-09-09  9:20                           ` Andreas Jaeger
2004-09-21  7:19                   ` Andreas Jaeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).