* getting glibc to compile with GCC CVS mainline
@ 2005-02-07 8:37 Alexandre Oliva
2005-02-15 19:55 ` Andreas Jaeger
0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Oliva @ 2005-02-07 8:37 UTC (permalink / raw)
To: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
Here are patches to fix incompatibilities with the current CVS version
of GCC.
The first addresses a problem that causes GCC to reject auto nested
functions that are declared but not defined.
The second addresses a problem of trying to construct array types of
incomplete types. Although this is well-formed C++, it's ill-formed
C, even if the type would decay to pointer to incomplete type, which
is well-formed in both languages. There were two occurrences of this
error in glibc.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: glibc-unused-nested-auto.patch --]
[-- Type: text/x-patch, Size: 1833 bytes --]
Index: ChangeLog
2005-02-03 Alexandre Oliva <aoliva@redhat.com>
* elf/dynamic-link.h: Don't declare nested auto functions that are
not going to be defined.
--- elf/dynamic-link.h 2005-01-22 16:18:28.000000000 -0200
+++ elf/dynamic-link.h 2005-02-07 06:20:18.000000000 -0200
@@ -1,5 +1,5 @@
/* Inline functions for dynamic linking.
- Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,20 +31,24 @@
optimizing away alignment tests or using word instructions for
copying memory, breaking the very code written to handle the
unaligned cases. */
+# if ! ELF_MACHINE_NO_REL
auto void __attribute__((always_inline))
elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
void *const reloc_addr);
auto void __attribute__((always_inline))
+elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+ void *const reloc_addr);
+# endif
+# if ! ELF_MACHINE_NO_RELA
+auto void __attribute__((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
void *const reloc_addr);
auto void __attribute__((always_inline))
-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
- void *const reloc_addr);
-auto void __attribute__((always_inline))
elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
void *const reloc_addr);
+# endif
# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
auto void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: glibc-array-incomplete-type.patch --]
[-- Type: text/x-patch, Size: 2028 bytes --]
Index: ChangeLog
2005-02-02 Alexandre Oliva <aoliva@redhat.com>
* iconvdata/jis0208.h (struct jisx0208_ucs_idx): Move declaration
before use. Fix typo in comment.
Index: nptl/ChangeLog
2005-02-02 Alexandre Oliva <aoliva@redhat.com>
* sysdeps/pthread/pthread.h (__sigsetjmp): Don't declare __env
argument as array, GCC 4 doesn't like it.
Index: iconvdata/jis0208.h
--- iconvdata/jis0208.h 2003-06-11 18:40:42.000000000 -0300
+++ iconvdata/jis0208.h 2005-02-02 05:57:39.000000000 -0200
@@ -27,13 +27,7 @@
/* Conversion table. */
extern const uint16_t __jis0208_to_ucs[];
-extern const char __jisx0208_from_ucs4_lat1[256][2];
-extern const char __jisx0208_from_ucs4_greek[0xc1][2];
-extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
-extern const char __jisx0208_from_ucs_tab[][2];
-
-
-/* Struct for table with indeces in UCS mapping table. */
+/* Struct for table with indexes in UCS mapping table. */
struct jisx0208_ucs_idx
{
uint16_t start;
@@ -41,6 +35,11 @@
uint16_t idx;
};
+extern const char __jisx0208_from_ucs4_lat1[256][2];
+extern const char __jisx0208_from_ucs4_greek[0xc1][2];
+extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
+extern const char __jisx0208_from_ucs_tab[][2];
+
static inline uint32_t
__attribute ((always_inline))
Index: nptl/sysdeps/pthread/pthread.h
--- nptl/sysdeps/pthread/pthread.h 2004-12-05 00:18:43.000000000 -0200
+++ nptl/sysdeps/pthread/pthread.h 2005-02-02 08:21:16.000000000 -0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -661,7 +661,7 @@
/* Function used in the macros. */
struct __jmp_buf_tag;
-extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
/* Mutex handling. */
[-- Attachment #4: Type: text/plain, Size: 188 bytes --]
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: getting glibc to compile with GCC CVS mainline
2005-02-07 8:37 getting glibc to compile with GCC CVS mainline Alexandre Oliva
@ 2005-02-15 19:55 ` Andreas Jaeger
2005-02-15 21:30 ` Alexandre Oliva
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Jaeger @ 2005-02-15 19:55 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 5268 bytes --]
Alexandre Oliva <aoliva@redhat.com> writes:
> Here are patches to fix incompatibilities with the current CVS version
> of GCC.
>
> The first addresses a problem that causes GCC to reject auto nested
> functions that are declared but not defined.
The actual error message is:
dl-reloc.c: In function ‘_dl_relocate_object’:
dynamic-link.h:44: error: nested function ‘elf_machine_rel_relative’ declared but never defined
dynamic-link.h:37: error: nested function ‘elf_machine_rel’ declared but never defined
> The second addresses a problem of trying to construct array types of
> incomplete types. Although this is well-formed C++, it's ill-formed
> C, even if the type would decay to pointer to incomplete type, which
> is well-formed in both languages. There were two occurrences of this
> error in glibc.
Shall I commit these patches?
Andreas
>
> Index: ChangeLog
> 2005-02-03 Alexandre Oliva <aoliva@redhat.com>
>
> * elf/dynamic-link.h: Don't declare nested auto functions that are
> not going to be defined.
>
> --- elf/dynamic-link.h 2005-01-22 16:18:28.000000000 -0200
> +++ elf/dynamic-link.h 2005-02-07 06:20:18.000000000 -0200
> @@ -1,5 +1,5 @@
> /* Inline functions for dynamic linking.
> - Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
> + Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
> This file is part of the GNU C Library.
>
> The GNU C Library is free software; you can redistribute it and/or
> @@ -31,20 +31,24 @@
> optimizing away alignment tests or using word instructions for
> copying memory, breaking the very code written to handle the
> unaligned cases. */
> +# if ! ELF_MACHINE_NO_REL
> auto void __attribute__((always_inline))
> elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
> const ElfW(Sym) *sym, const struct r_found_version *version,
> void *const reloc_addr);
> auto void __attribute__((always_inline))
> +elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
> + void *const reloc_addr);
> +# endif
> +# if ! ELF_MACHINE_NO_RELA
> +auto void __attribute__((always_inline))
> elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
> const ElfW(Sym) *sym, const struct r_found_version *version,
> void *const reloc_addr);
> auto void __attribute__((always_inline))
> -elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
> - void *const reloc_addr);
> -auto void __attribute__((always_inline))
> elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
> void *const reloc_addr);
> +# endif
> # if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
> auto void __attribute__((always_inline))
> elf_machine_lazy_rel (struct link_map *map,
>
> Index: ChangeLog
> 2005-02-02 Alexandre Oliva <aoliva@redhat.com>
>
> * iconvdata/jis0208.h (struct jisx0208_ucs_idx): Move declaration
> before use. Fix typo in comment.
>
> Index: nptl/ChangeLog
> 2005-02-02 Alexandre Oliva <aoliva@redhat.com>
>
> * sysdeps/pthread/pthread.h (__sigsetjmp): Don't declare __env
> argument as array, GCC 4 doesn't like it.
>
> Index: iconvdata/jis0208.h
> --- iconvdata/jis0208.h 2003-06-11 18:40:42.000000000 -0300
> +++ iconvdata/jis0208.h 2005-02-02 05:57:39.000000000 -0200
> @@ -27,13 +27,7 @@
> /* Conversion table. */
> extern const uint16_t __jis0208_to_ucs[];
>
> -extern const char __jisx0208_from_ucs4_lat1[256][2];
> -extern const char __jisx0208_from_ucs4_greek[0xc1][2];
> -extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
> -extern const char __jisx0208_from_ucs_tab[][2];
> -
> -
> -/* Struct for table with indeces in UCS mapping table. */
> +/* Struct for table with indexes in UCS mapping table. */
> struct jisx0208_ucs_idx
> {
> uint16_t start;
> @@ -41,6 +35,11 @@
> uint16_t idx;
> };
>
> +extern const char __jisx0208_from_ucs4_lat1[256][2];
> +extern const char __jisx0208_from_ucs4_greek[0xc1][2];
> +extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
> +extern const char __jisx0208_from_ucs_tab[][2];
> +
>
> static inline uint32_t
> __attribute ((always_inline))
> Index: nptl/sysdeps/pthread/pthread.h
> --- nptl/sysdeps/pthread/pthread.h 2004-12-05 00:18:43.000000000 -0200
> +++ nptl/sysdeps/pthread/pthread.h 2005-02-02 08:21:16.000000000 -0200
> @@ -1,4 +1,4 @@
> -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
> +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
> This file is part of the GNU C Library.
>
> The GNU C Library is free software; you can redistribute it and/or
> @@ -661,7 +661,7 @@
>
> /* Function used in the macros. */
> struct __jmp_buf_tag;
> -extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
> +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
>
>
> /* Mutex handling. */
Andreas
--
Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
SUSE Linux Products GmbH, 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] 3+ messages in thread
* Re: getting glibc to compile with GCC CVS mainline
2005-02-15 19:55 ` Andreas Jaeger
@ 2005-02-15 21:30 ` Alexandre Oliva
0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2005-02-15 21:30 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: libc-hacker
On Feb 15, 2005, Andreas Jaeger <aj@suse.de> wrote:
> Alexandre Oliva <aoliva@redhat.com> writes:
>> Here are patches to fix incompatibilities with the current CVS version
>> of GCC.
>>
>> The first addresses a problem that causes GCC to reject auto nested
>> functions that are declared but not defined.
> The actual error message is:
> dl-reloc.c: In function ‘_dl_relocate_object’:
> dynamic-link.h:44: error: nested function ‘elf_machine_rel_relative’ declared but never defined
> dynamic-link.h:37: error: nested function ‘elf_machine_rel’ declared but never defined
>> The second addresses a problem of trying to construct array types of
>> incomplete types. Although this is well-formed C++, it's ill-formed
>> C, even if the type would decay to pointer to incomplete type, which
>> is well-formed in both languages. There were two occurrences of this
>> error in glibc.
> Shall I commit these patches?
The latter is already in, RTH beat me to posting it.
I'm told by Matthew Burgess that the former doesn't fix the problem on
i*86-linux-gnu, although it does fix it on frv-linux-gnu. It seems
that dl-machine.h, that defines these macros, is only included after
the ELF_MACHINE_NO_REL* macros are tested for. Maybe they should be
defined elsewhere?
Matthew agreed to file a bug report on this problem. I figured it
didn't make sense for me to waste time trying to implement a patch
that wouldn't even be looked at :-/
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-15 21:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07 8:37 getting glibc to compile with GCC CVS mainline Alexandre Oliva
2005-02-15 19:55 ` Andreas Jaeger
2005-02-15 21:30 ` Alexandre Oliva
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).