Skip to contentSkip to conversation

Howto build a gcc 4.0 toolchain for ARM?

DISCUSSION Vineet Tuli 2 participants 7 messages Jan 27, 2006 – Feb 1, 2006 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
In reply to a message not in the archive

Some problem in my mail system. Attachment not going. Including the patches herein:

dynamic-link.h renamed from dynamic-link.h.old +0 -37
@@ -19,43 +19,6 @@
 
 #include <elf.h>
 #include <assert.h>
-
-#ifdef RESOLVE
-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to
-   ElfW(Addr), because not all architectures can assume that the
-   relocated address is properly aligned, whereas the compiler is
-   entitled to assume that a pointer to a type is properly aligned for
-   the type.  Even if we cast the pointer back to some other type with
-   less strict alignment requirements, the compiler might still
-   remember that the pointer was originally more aligned, thereby
-   optimizing away alignment tests or using word instructions for
-   copying memory, breaking the very code written to handle the
-   unaligned cases.  */
-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_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);
-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
-# else
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
-# endif
-#endif
-
 #include <dl-machine.h>
 
 #ifndef VERSYMIDX
iconvdata/jis0208.h +9 -9
@@ -24,15 +24,6 @@
 #include <gconv.h>
 #include <stdint.h>
 
-/* 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 jisx0208_ucs_idx
 {
@@ -42,6 +33,15 @@
 };
 
 
+/* 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];
+
+
 static inline uint32_t
 __attribute ((always_inline))
 jisx0208_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
include/libc-symbols.h +11 -66

89 lines not on this page · raw message

wcscoll.c +1 -2
@@ -22,12 +22,11 @@
 
 #define STRING_TYPE wchar_t
 #define USTRING_TYPE wint_t
-#define STRCOLL __wcscoll
+#define STRCOLL wcscoll
 #define STRCOLL_L __wcscoll_l
 
 #include "../string/strcoll.c"
 
 #ifndef USE_IN_EXTENDED_LOCALE_MODEL
-weak_alias (__wcscoll, wcscoll)
 libc_hidden_weak (wcscoll)
 #endif
sysdeps/arm/dl-machine.h renamed from sysdeps/arm/dl-machine.h.old +48 -6

90 lines not on this page · raw message

sysdeps/unix/sysv/linux/arm/ioperm.c renamed from sysdeps/unix/sysv/linux/arm/ioperm.c.old +9 -3
@@ -47,6 +47,12 @@
 #include <asm/page.h>
 #include <sys/sysctl.h>
 
+/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
+#define CTL_BUS_ISA BUS_ISA	/* and hope it's not the one from linux/input.h */
+#endif
+
 #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
 #define PATH_CPUINFO		"/proc/cpuinfo"
 
@@ -80,7 +86,7 @@
  * Initialize I/O system.  There are several ways to get the information
  * we need.  Each is tried in turn until one succeeds.
  *
- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is the preferred method
+ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the preferred method
  *    but not all kernels support it.
  *
  * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
@@ -100,8 +106,8 @@
 {
   char systype[256];
   int i, n;
-  static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-  static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
+  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
   size_t len = sizeof(io.base);
 
   if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
strcoll.c +4 -2
@@ -23,6 +23,7 @@
 # define STRING_TYPE char
 # define STRCOLL strcoll
 # define STRCOLL_L __strcoll_l
+# define USE_HIDDEN_DEF
 #endif
 
 #include "../locale/localeinfo.h"
@@ -35,6 +36,7 @@
 {
   return STRCOLL_L (s1, s2, _NL_CURRENT_LOCALE);
 }
-#if !defined WIDE_CHAR_VERSION
-libc_hidden_def (strcoll)
+
+#ifdef USE_HIDDEN_DEF
+libc_hidden_def (STRCOLL)
 #endif
wchar.h +0 -1
@@ -56,7 +56,6 @@
 extern int __wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
 			  size_t __n)
      __attribute_pure__;
-extern int __wcscoll (__const wchar_t *__s1, __const wchar_t *__s2);
 extern size_t __wcslen (__const wchar_t *__s) __attribute_pure__;
 extern size_t __wcsnlen (__const wchar_t *__s, size_t __maxlen)
      __attribute_pure__;

*******************************************************************************

Quoted 13 lines · Steve Papacharalambous

Hi Vineet,

I was looking at your steps on how to build a gcc-4.0 toolchain for ARM:

http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005665.html

The patches for glibc-2.3.5 that you mention don't appear to be attached to the page, can you let me know where I can get these patches please?

Thanks,

Steve

#3 lore raw

this step:

[root at localhost

<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]# cd
/usr/src
[root at localhost
<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]# tar
–xjf  gcc-4.0.2.tar.bz2

A configuration file must be modified so that the compiler is built without libc includes. Edit the /usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and append

–Dinhibit_libc –D__gthr_posix_h to the line starting with TARGET_LIBGCC2_CFLAGS =.

The top of the file is shown below, after appending the flags.

# Just for these, we omit the frame pointer since it makes such a big

# difference. It is then pointless adding debugging.
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC –Dinhibit_libc
–D__gthr_posix_h
LIBGCC2_DEBUG_CFLAGS = -g0

Go to the /usr/src/build/gcc-4.0.2 directory to configure and build the GNU C compiler with the commands below.

[root at localhost

<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]# cd
/usr/src/build/gcc-4.0.2
[root at localhost
<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]#
../../gcc-4.0.2/configure –-target=arm-linux –-prefix=/opt/armv4
--disable-threads –-enable-languages=c
[root at localhost
<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]# make
isn't working for me io always receive some error

that was crti.o how to fix this ??

[root at localhost

<http://linux.omap.com/mailman/listinfo/linux-omap-open-source>]# make
install
Quoted 409 lines · Vineet Tuli

Some problem in my mail system. Attachment not going. Including the patches herein:

dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 renamed from dynamic-link.h.old 2005-03-12 18:12:37.000000000 -0800 +0 -37
@@ -19,43 +19,6 @@
 
 #include <elf.h>
 #include <assert.h>
-
-#ifdef RESOLVE
-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to
-   ElfW(Addr), because not all architectures can assume that the
-   relocated address is properly aligned, whereas the compiler is
-   entitled to assume that a pointer to a type is properly aligned for
-   the type.  Even if we cast the pointer back to some other type with
-   less strict alignment requirements, the compiler might still
-   remember that the pointer was originally more aligned, thereby
-   optimizing away alignment tests or using word instructions for
-   copying memory, breaking the very code written to handle the
-   unaligned cases.  */
-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_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);
-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-                     ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
-# else
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-                     ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
-# endif
-#endif
-
 #include <dl-machine.h>

#ifndef VERSYMIDX

--- glibc-2.3.5.orig/iconvdata/jis0208.h 2003-06-11 21:40:
42.000000000 +0000
+++ glibc-2.3.5/iconvdata/jis0208.h 2005-07-15 18:32:20.726328528+0000

dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 renamed from dynamic-link.h.old 2005-03-12 18:12:37.000000000 -0800 +0 -9
@@ -24,15 +24,6 @@
 #include <gconv.h>
 #include <stdint.h>
 
-/* 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 jisx0208_ucs_idx
{

dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 renamed from dynamic-link.h.old 2005-03-12 18:12:37.000000000 -0800 +9 -0
@@ -42,6 +33,15 @@
 };
 
 
+/* 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];
+
+

static inline uint32_t
__attribute ((always_inline))
jisx0208_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)

include/libc-symbols.h 2005/03/17 21:06:27 1.71 renamed from include/libc-symbols.h 2005/02/11 00:29:46 1.70 +11 -66
@@ -583,78 +583,23 @@
 #  define hidden_proto(name, attrs...) \
   __hidden_proto (name, __GI_##name, ##attrs)
 #  define __hidden_proto(name, internal, attrs...) \
-  extern __typeof (name) internal; \
   extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
   __hidden_proto_hiddenattr (attrs);
 #  define __hidden_asmname(name) \
   __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
 #  define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
 #  define __hidden_asmname2(prefix, name) #prefix name
-#  ifdef HAVE_ASM_SET_DIRECTIVE
-#   define __hidden_def1(original, alias)                      \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP      \
-  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
-#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
-#     define __hidden_dot_def1(original, alias)         ASM_LINE_SEP   \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP  \
-  .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
-#   else
-#     define __hidden_dot_def1(original, alias)
-#   endif
-#  else
-#   define __hidden_def1(original, alias)                      \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP      \
-  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
-#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
-#    define __hidden_dot_def1(original, alias) ASM_LINE_SEP    \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP  \
-  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
-#   else
-#    define __hidden_dot_def1(original, alias)
-#   endif
-#  endif
-#  define __hidden_def2(...) #__VA_ARGS__
-#  define __hidden_def3(...) __hidden_def2 (__VA_ARGS__)
-#  define hidden_def(name)                                     \
-  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name) \
-  __hidden_dot_def1 (__GI_##name, name)));
-#  define hidden_data_def(name)                                        \
-  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name)));
-#  define hidden_ver(local, name)                              \
-  __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name) \
-  __hidden_dot_def1 (local, __GI_##name)));
-#  define hidden_data_ver(local, name)                         \
-  __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name)));
-#  ifdef HAVE_WEAK_SYMBOLS
-#   ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
-#    define __hidden_weak1(original, alias)                    \
-  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
-#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
-#     define __hidden_dot_weak1(original, alias)       ASM_LINE_SEP    \
-  .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
-#    else
-#     define __hidden_dot_weak1(original, alias)
-#    endif
-#   else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
-#    define __hidden_weak1(original, alias)                    \
-  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                     \
-  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
-#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
-#     define __hidden_dot_weak1(original, alias)       ASM_LINE_SEP    \
-  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
-  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
-#    else
-#     define __hidden_dot_weak1(original, alias)
-#    endif
-#   endif
-#   define hidden_weak(name)                                   \
-  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name) \
-  __hidden_dot_weak1 (__GI_##name, name)));
-#   define hidden_data_weak(name)                                      \
-  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name)));
-#  else
-#   define hidden_weak(name) hidden_def (name)
-#  endif
+#  define __hidden_ver1(local, internal, name) \
+  extern __typeof (name) __EI_##name __asm__(__hidden_asmname
 (#internal)); \
+  extern __typeof (name) __EI_##name \
+       __attribute__((alias (__hidden_asmname (#local))))
+#  define hidden_ver(local, name)      __hidden_ver1(local, __GI_##name,
 name);
+#  define hidden_data_ver(local, name) hidden_ver(local, name)
+#  define hidden_def(name)             __hidden_ver1(__GI_##name, name,
 name);
+#  define hidden_data_def(name)                hidden_def(name)
+#  define hidden_weak(name) \
+       __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
+#  define hidden_data_weak(name)       hidden_weak(name)
# else
/* For assembly, we need to do the opposite of what we do in C:
wcscoll.c 2005/03/17 21:06:24 1.14 renamed from wcscoll.c 2004/03/14 21:05:48 1.13 +1 -2
@@ -22,12 +22,11 @@
 
 #define STRING_TYPE wchar_t
 #define USTRING_TYPE wint_t
-#define STRCOLL __wcscoll
+#define STRCOLL wcscoll
 #define STRCOLL_L __wcscoll_l
 
 #include "../string/strcoll.c"
 
 #ifndef USE_IN_EXTENDED_LOCALE_MODEL
-weak_alias (__wcscoll, wcscoll)
 libc_hidden_weak (wcscoll)
 #endif
sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +8 -1
@@ -359,7 +359,14 @@
 # endif
 
 /* Deal with an out-of-range PC24 reloc.  */
-static Elf32_Addr
+#if __GNUC__ >= 4
+  auto inline Elf32_Addr
+#else
+  static inline Elf32_Addr
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
 {
   static void *fix_page;
@@ -392,7 +399,14 @@
 /* Perform the relocation specified by RELOC and SYM (which is fully

resolved).
MAP is the object containing the reloc. */

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +8 -1
-static inline void
+#if __GNUC__ >= 4
+  auto inline void
+#else
+  static inline void
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif

elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *sym, const struct r_found_version
*version,
void *const reloc_addr_arg)

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +8 -1
@@ -517,7 +531,14 @@
 }
 
 # ifndef RTLD_BOOTSTRAP
-static inline void
+#if __GNUC__ >= 4
+  auto inline void
+#else
+  static inline void
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 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)

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +24 -4
@@ -597,7 +618,14 @@
 }
 # endif
 
-static inline void
+#if __GNUC__ >= 4
+  auto inline void
+#else
+  static inline void
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc,
                          void *const reloc_addr_arg)
 {
@@ -606,7 +634,14 @@
 }
 
 # ifndef RTLD_BOOTSTRAP
-static inline void
+#if __GNUC__ >= 4
+  auto inline void
+#else
+  static inline void
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
                           void *const reloc_addr_arg)
 {
@@ -615,7 +650,14 @@
 }
 # endif
 
-static inline void
+#if __GNUC__ >= 4
+  auto inline void
+#else
+  static inline void
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 elf_machine_lazy_rel (struct link_map *map,
                      Elf32_Addr l_addr, const Elf32_Rel *reloc)
 {
 
 
 
 
 
--- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old        2003-02-20

14:22:24.000000000 -0800
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-01-31 16:01:
50.000000000 -0800

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +4 -0
@@ -47,6 +47,12 @@
 #include <asm/page.h>
 #include <sys/sysctl.h>
 
+/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
+#define CTL_BUS_ISA BUS_ISA    /* and hope it's not the one from

linux/input.h */

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +2 -0
+#endif
+

#define PATH_ARM_SYSTYPE "/etc/arm_systype"
#define PATH_CPUINFO "/proc/cpuinfo"

sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 renamed from sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005 +3 -3
@@ -80,7 +86,7 @@
  * Initialize I/O system.  There are several ways to get the information
  * we need.  Each is tried in turn until one succeeds.
  *
- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is the preferred method
+ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the preferred method
  *    but not all kernels support it.
  *
  * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
@@ -100,8 +106,8 @@
 {
   char systype[256];
   int i, n;
-  static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-  static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
+  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT
 };
   size_t len = sizeof(io.base);
 
   if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
strcoll.c 2005/03/17 21:06:24 1.34 renamed from strcoll.c 2004/03/14 20:51:30 1.33 +4 -2
@@ -23,6 +23,7 @@
 # define STRING_TYPE char
 # define STRCOLL strcoll
 # define STRCOLL_L __strcoll_l
+# define USE_HIDDEN_DEF
 #endif
 
 #include "../locale/localeinfo.h"
@@ -35,6 +36,7 @@
 {
   return STRCOLL_L (s1, s2, _NL_CURRENT_LOCALE);
 }
-#if !defined WIDE_CHAR_VERSION
-libc_hidden_def (strcoll)
+
+#ifdef USE_HIDDEN_DEF
+libc_hidden_def (STRCOLL)
 #endif
wchar.h 2005/03/17 21:06:24 1.27 renamed from wchar.h 2004/03/14 20:45:10 1.26 +0 -1
@@ -56,7 +56,6 @@
 extern int __wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
                          size_t __n)
      __attribute_pure__;
-extern int __wcscoll (__const wchar_t *__s1, __const wchar_t *__s2);
 extern size_t __wcslen (__const wchar_t *__s) __attribute_pure__;
 extern size_t __wcsnlen (__const wchar_t *__s, size_t __maxlen)
      __attribute_pure__;

*******************************************************************************

Quoted 5 lines · Steve Papacharalambous

Hi Vineet,

I was looking at your steps on how to build a gcc-4.0 toolchain for ARM:

http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005665.html

Quoted 6 lines

The patches for glibc-2.3.5 that you mention don't appear to be attached to the page, can you let me know where I can get these patches please?

Thanks,

Quoted 8 lines
Quoted 2 lines

Steve

_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

--
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty

#4 lore raw

Sorry for replying late. I was not available at office. Please use the option --disable-shared while compiling gcc. This will resolve the error of crti.o.

This will give an error "cannot create executables" in the end which can be safely ignored.

Vineet

Quoted 534 lines · Luís Cargnini

this step:
[root at localhost]# cd /usr/src
[root at localhost
]# tar –xjf gcc-4.0.2.tar.bz2

A configuration file must be modified so that the compiler is built without libc includes. Edit the /usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and append

–Dinhibit_libc –D__gthr_posix_h to the line starting with TARGET_LIBGCC2_CFLAGS =.

The top of the file is shown below, after appending the flags.

# Just for these, we omit the frame pointer since it makes such a big

# difference. It is then pointless adding debugging.
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC –Dinhibit_libc –D__gthr_posix_h

LIBGCC2_DEBUG_CFLAGS = -g0

Go to the /usr/src/build/gcc-4.0.2 directory to configure and build the GNU C compiler with the commands below.

[
root at localhost]# cd /usr/src/build/gcc-4.0.2
[root at localhost]# ../../gcc-4.0.2/configure –-target=arm-linux –-prefix=/opt/armv4 --disable-threads –-enable-languages=c

[root at localhost]# make
isn't working for me io always receive some error

that was crti.o how to fix this ??

[
root at localhost]# make install

On 27/01/06, Vineet Tuli <[email protected]> wrote:

        Some problem in my mail system. Attachment not going.
        Including the
        patches herein:
        
        --- elf/dynamic-link.h.old      2005-03-12 18:12:37.000000000
        -0800
        +++ elf/dynamic-link.h  2005-03-12 18:12:59.777820848 -0800
        @@ -19,43 +19,6 @@
        
        #include <elf.h>
        #include <assert.h>
        -
        -#ifdef RESOLVE
        -/* We pass reloc_addr as a pointer to void, as opposed to a
        pointer to
        -   ElfW(Addr), because not all architectures can assume that
        the
        -   relocated address is properly aligned, whereas the
        compiler is 
        -   entitled to assume that a pointer to a type is properly
        aligned for
        -   the type.  Even if we cast the pointer back to some other
        type with
        -   less strict alignment requirements, the compiler might
        still
        -   remember that the pointer was originally more aligned,
        thereby
        -   optimizing away alignment tests or using word instructions
        for
        -   copying memory, breaking the very code written to handle
        the
        -   unaligned cases.  */ 
        -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_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);
        -# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
        -auto void __attribute__((always_inline)) 
        -elf_machine_lazy_rel (struct link_map *map,
        -                     ElfW(Addr) l_addr, const ElfW(Rel)
        *reloc);
        -# else
        -auto void __attribute__((always_inline))
        -elf_machine_lazy_rel (struct link_map *map, 
        -                     ElfW(Addr) l_addr, const ElfW(Rela)
        *reloc);
        -# endif
        -#endif
        -
        #include <dl-machine.h>
        
        #ifndef VERSYMIDX
        
        
        
        --- glibc-2.3.5.orig/iconvdata/jis0208.h        2003-06-11
        21:40: 42.000000000 +0000
        +++ glibc-2.3.5/iconvdata/jis0208.h     2005-07-15
        18:32:20.726328528 +0000
        @@ -24,15 +24,6 @@
        #include <gconv.h>
        #include <stdint.h>
        
        -/* 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 jisx0208_ucs_idx
        {
        @@ -42,6 +33,15 @@
        };
        
        
        +/* 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]; 
        +
        +
        static inline uint32_t
        __attribute ((always_inline))
        jisx0208_to_ucs4 (const unsigned char **s, size_t avail,
        unsigned char offset)
        
        
        
        --- libc/include/libc-symbols.h 2005/02/11 00:29:46     1.70
        +++ libc/include/libc-symbols.h 2005/03/17 21:06:27     1.71
        @@ -583,78 +583,23 @@
        #  define hidden_proto(name, attrs...) \
           __hidden_proto (name, __GI_##name, ##attrs)
        #  define __hidden_proto(name, internal, attrs...) \ 
        -  extern __typeof (name) internal; \
           extern __typeof (name) name __asm__ (__hidden_asmname
        (#internal)) \
           __hidden_proto_hiddenattr (attrs);
        #  define __hidden_asmname(name) \
           __hidden_asmname1 (__USER_LABEL_PREFIX__, name) 
        #  define __hidden_asmname1(prefix, name)
        __hidden_asmname2(prefix, name)
        #  define __hidden_asmname2(prefix, name) #prefix name
        -#  ifdef HAVE_ASM_SET_DIRECTIVE
        -#   define __hidden_def1(original,
        alias)                      \ 
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        ASM_LINE_SEP      \
        -  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
        -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#     define __hidden_dot_def1(original, alias)
        ASM_LINE_SEP   \ 
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        ASM_LINE_SEP  \
        -  .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME
        (original)
        -#   else
        -#     define __hidden_dot_def1(original, alias)
        -#   endif
        -#  else 
        -#   define __hidden_def1(original,
        alias)                      \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        ASM_LINE_SEP      \
        -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
        -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME 
        -#    define __hidden_dot_def1(original, alias)
        ASM_LINE_SEP    \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        ASM_LINE_SEP  \
        -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
        -#   else
        -#    define __hidden_dot_def1(original, alias) 
        -#   endif
        -#  endif
        -#  define __hidden_def2(...) #__VA_ARGS__
        -#  define __hidden_def3(...) __hidden_def2 (__VA_ARGS__)
        -#  define hidden_def(name)
        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name)
        \ 
        -  __hidden_dot_def1 (__GI_##name, name)));
        -#  define
        hidden_data_def(name)                                        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name,
        name)));
        -#  define hidden_ver(local,
        name)                              \ 
        -  __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name)
        \
        -  __hidden_dot_def1 (local, __GI_##name)));
        -#  define hidden_data_ver(local, name)
        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (local,
        __GI_##name))); 
        -#  ifdef HAVE_WEAK_SYMBOLS
        -#   ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
        -#    define __hidden_weak1(original,
        alias)                    \
        -  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
        -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME 
        -#     define __hidden_dot_weak1(original, alias)
        ASM_LINE_SEP    \
        -  .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME
        (original)
        -#    else
        -#     define __hidden_dot_weak1(original, alias)
        -#    endif 
        -#   else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
        -#    define __hidden_weak1(original,
        alias)                    \
        -  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP
        \
        -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) 
        -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#     define __hidden_dot_weak1(original, alias)
        ASM_LINE_SEP    \
        -  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
        -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) 
        -#    else
        -#     define __hidden_dot_weak1(original, alias)
        -#    endif
        -#   endif
        -#   define hidden_weak(name)
        \
        -  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name)
        \ 
        -  __hidden_dot_weak1 (__GI_##name, name)));
        -#   define
        hidden_data_weak(name)                                      \
        -  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name,
        name)));
        -#  else
        -#   define hidden_weak(name) hidden_def (name) 
        -#  endif
        +#  define __hidden_ver1(local, internal, name) \
        +  extern __typeof (name) __EI_##name __asm__(__hidden_asmname
        (#internal)); \
        +  extern __typeof (name) __EI_##name \
        +       __attribute__((alias (__hidden_asmname (#local)))) 
        +#  define hidden_ver(local, name)      __hidden_ver1(local,
        __GI_##name, name);
        +#  define hidden_data_ver(local, name) hidden_ver(local,
        name)
        +#  define hidden_def(name)
        __hidden_ver1(__GI_##name, name, name); 
        +#  define
        hidden_data_def(name)                hidden_def(name)
        +#  define hidden_weak(name) \
        +       __hidden_ver1(__GI_##name, name, name)
        __attribute__((weak));
        +#  define hidden_data_weak(name)       hidden_weak(name) 
        # else
        /* For assembly, we need to do the opposite of what we do in
        C:
        
        
        
        --- wcsmbs/wcscoll.c    2004/03/14 21:05:48     1.13
        +++ wcsmbs/wcscoll.c    2005/03/17 21:06:24     1.14
        @@ -22,12 +22,11 @@ 
        
        #define STRING_TYPE wchar_t
        #define USTRING_TYPE wint_t
        -#define STRCOLL __wcscoll
        +#define STRCOLL wcscoll
        #define STRCOLL_L __wcscoll_l
        
        #include "../string/strcoll.c"
        
        #ifndef USE_IN_EXTENDED_LOCALE_MODEL 
        -weak_alias (__wcscoll, wcscoll)
        libc_hidden_weak (wcscoll)
        #endif
        
        
        
        
        --- glibc-2.3.4/sysdeps/arm/dl-machine.h.old    Sun Mar 20
        17:54:37 2005
        +++ glibc-2.3.4/sysdeps/arm/dl-machine.h        Sun Mar 20
        17:57:32 2005 
        @@ -359,7 +359,14 @@
        # endif
        
        /* Deal with an out-of-range PC24 reloc.  */
        -static Elf32_Addr
        +#if __GNUC__ >= 4
        +  auto inline Elf32_Addr
        +#else
        +  static inline Elf32_Addr
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
        {
           static void *fix_page; 
        @@ -392,7 +399,14 @@
        /* Perform the relocation specified by RELOC and SYM (which is
        fully resolved).
            MAP is the object containing the reloc.  */
        
        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void 
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rel (struct link_map *map, const Elf32_Rel
        *reloc, 
                         const Elf32_Sym *sym, const struct
        r_found_version *version,
                         void *const reloc_addr_arg)
        @@ -517,7 +531,14 @@
        }
        
        # ifndef RTLD_BOOTSTRAP
        -static inline void
        +#if __GNUC__ >= 4 
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        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)
        @@ -597,7 +618,14 @@
        }
        # endif
        
        -static inline void
        +#if __GNUC__ >= 4 
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel
        *reloc, 
                                  void *const reloc_addr_arg)
        {
        @@ -606,7 +634,14 @@
        }
        
        # ifndef RTLD_BOOTSTRAP
        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void 
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela
        *reloc,
                                   void *const reloc_addr_arg) 
        {
        @@ -615,7 +650,14 @@
        }
        # endif
        
        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) 
        +  __attribute ((always_inline))
        +#endif
        elf_machine_lazy_rel (struct link_map *map,
                              Elf32_Addr l_addr, const Elf32_Rel
        *reloc)
        {
        
        
        
        
        
        ---
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old        2003-02-20 14:22: 24.000000000 -0800
        +++
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c    2004-01-31
        16:01:50.000000000 -0800
        @@ -47,6 +47,12 @@
        #include <asm/page.h>
        #include <sys/sysctl.h>
        
        +/* see
        http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html
        */
        +#include <linux/version.h>
        +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
        +#define CTL_BUS_ISA BUS_ISA    /* and hope it's not the one
        from linux/input.h */ 
        +#endif
        +
        #define PATH_ARM_SYSTYPE       "/etc/arm_systype"
        #define PATH_CPUINFO           "/proc/cpuinfo"
        
        @@ -80,7 +86,7 @@
          * Initialize I/O system.  There are several ways to get the
        information 
          * we need.  Each is tried in turn until one succeeds.
          *
        - * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is the
        preferred method
        + * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the
        preferred method
          *    but not all kernels support it.
          *
          * 2. Read the value (not the contents) of symlink
        PATH_ARM_SYSTYPE.
        @@ -100,8 +106,8 @@
        {
           char systype[256];
           int i, n;
        -  static int iobase_name[] = { CTL_BUS, BUS_ISA,
        BUS_ISA_PORT_BASE }; 
        -  static int ioshift_name[] = { CTL_BUS, BUS_ISA,
        BUS_ISA_PORT_SHIFT };
        +  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA,
        BUS_ISA_PORT_BASE };
        +  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA,
        BUS_ISA_PORT_SHIFT }; 
           size_t len = sizeof(io.base);
        
           if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
        
        
        
        --- string/strcoll.c    2004/03/14 20:51:30     1.33
        +++ string/strcoll.c    2005/03/17 21:06:24     1.34
        @@ -23,6 +23,7 @@
        # define STRING_TYPE char
        # define STRCOLL strcoll
        # define STRCOLL_L __strcoll_l
        +# define USE_HIDDEN_DEF
        #endif
        
        #include "../locale/localeinfo.h"
        @@ -35,6 +36,7 @@ 
        {
           return STRCOLL_L (s1, s2, _NL_CURRENT_LOCALE);
        }
        -#if !defined WIDE_CHAR_VERSION
        -libc_hidden_def (strcoll)
        +
        +#ifdef USE_HIDDEN_DEF
        +libc_hidden_def (STRCOLL)
        #endif
        
        
        
        --- include/wchar.h     2004/03/14 20:45:10     1.26
        +++ include/wchar.h     2005/03/17 21:06:24     1.27
        @@ -56,7 +56,6 @@
        extern int __wcsncasecmp (__const wchar_t *__s1, __const
        wchar_t *__s2,
                                  size_t __n)
              __attribute_pure__; 
        -extern int __wcscoll (__const wchar_t *__s1, __const wchar_t
        *__s2);
        extern size_t __wcslen (__const wchar_t *__s)
        __attribute_pure__;
        extern size_t __wcsnlen (__const wchar_t *__s, size_t
        __maxlen)
              __attribute_pure__; 
        
        *******************************************************************************
        
        On Wed, 2006-01-25 at 09:37 +0000, Steve Papacharalambous
        wrote:
        > Hi Vineet,
        >
        > I was looking at your steps on how to build a gcc-4.0
        toolchain for ARM:
        >
        >
        http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005665.html
        >
        > The patches for glibc-2.3.5 that you mention don't appear to
        be attached
        > to the page, can you let me know where I can get these
        patches please?
        >
        > Thanks,
        >
        > Steve
        >
        
        _______________________________________________
        Linux-omap-open-source mailing list
        [email protected]
        http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Signature · 4 lines
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty 
#5 lore raw

ok i passed the compiler
but after added some patchs to glibc.2.3.5

glibc-2.3.5-allow-gcc-4.0-wordexp.patch glibc-2.3.5-allow-gcc4-string.patch glibc-2.3.5-allow-gcc4-symbols.patch glibc-2.3.5-allow-gcc4-wcstol_l.patch
and your own patch
i received the following error:
/opt/arm-linux/lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld: cannot find -lgcc_eh
collect2: ld returned 1 exit status
make[2]: *** [/home/lvcargnini/puc/mestrado/instramed/builds/linux/bglibc/iconv/iconvconfig] Error 1
make[2]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/glibc-2.3.5/iconv' make[1]: *** [iconv/others] Error 2
make[1]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/glibc-2.3.5'

Quoted 530 lines · Vineet Tuli

Sorry for replying late. I was not available at office. Please use the option --disable-shared while compiling gcc. This will resolve the error of crti.o.

This will give an error "cannot create executables" in the end which can be safely ignored.

Vineet

Quoted 6 lines · Luís Cargnini

this step:
[root at localhost]# cd /usr/src
[root at localhost
]# tar –xjf gcc-4.0.2.tar.bz2

A configuration file must be modified so that the compiler is built

without libc includes. Edit the /usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and append

Quoted 2 lines

–Dinhibit_libc –D__gthr_posix_h to the line starting with

TARGET_LIBGCC2_CFLAGS =.

Quoted 7 lines

The top of the file is shown below, after appending the flags.

# Just for these, we omit the frame pointer since it makes such a big

# difference. It is then pointless adding debugging.
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC –Dinhibit_libc

–D__gthr_posix_h

Quoted 4 lines

LIBGCC2_DEBUG_CFLAGS = -g0

Go to the /usr/src/build/gcc-4.0.2 directory to configure and build the

GNU C compiler with the commands below.

Quoted 4 lines

[
root at localhost]# cd /usr/src/build/gcc-4.0.2
[root at localhost]# ../../gcc-4.0.2/configure –-target=arm-linux

–-prefix=/opt/armv4 --disable-threads –-enable-languages=c

Quoted 381 lines

[root at localhost]# make
isn't working for me io always receive some error

that was crti.o how to fix this ??

[
root at localhost]# make install

On 27/01/06, Vineet Tuli <[email protected]> wrote:

        Some problem in my mail system. Attachment not going.
        Including the
        patches herein:

        --- elf/dynamic-link.h.old      2005-03-12 18:12:37.000000000
        -0800
        +++ elf/dynamic-link.h  2005-03-12 18:12:59.777820848 -0800
        @@ -19,43 +19,6 @@

        #include <elf.h>
        #include <assert.h>
        -
        -#ifdef RESOLVE
        -/* We pass reloc_addr as a pointer to void, as opposed to a
        pointer to
        -   ElfW(Addr), because not all architectures can assume that
        the
        -   relocated address is properly aligned, whereas the
        compiler is
        -   entitled to assume that a pointer to a type is properly
        aligned for
        -   the type.  Even if we cast the pointer back to some other
        type with
        -   less strict alignment requirements, the compiler might
        still
        -   remember that the pointer was originally more aligned,
        thereby
        -   optimizing away alignment tests or using word instructions
        for
        -   copying memory, breaking the very code written to handle
        the
        -   unaligned cases.  */
        -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_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);
        -# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
        -auto void __attribute__((always_inline))
        -elf_machine_lazy_rel (struct link_map *map,
        -                     ElfW(Addr) l_addr, const ElfW(Rel)
        *reloc);
        -# else
        -auto void __attribute__((always_inline))
        -elf_machine_lazy_rel (struct link_map *map,
        -                     ElfW(Addr) l_addr, const ElfW(Rela)
        *reloc);
        -# endif
        -#endif
        -
        #include <dl-machine.h>

        #ifndef VERSYMIDX



        --- glibc-2.3.5.orig/iconvdata/jis0208.h        2003-06-11
        21:40: 42.000000000 +0000
        +++ glibc-2.3.5/iconvdata/jis0208.h     2005-07-15
        18:32:20.726328528 +0000
        @@ -24,15 +24,6 @@
        #include <gconv.h>
        #include <stdint.h>

        -/* 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 jisx0208_ucs_idx
        {
        @@ -42,6 +33,15 @@
        };


        +/* 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];
        +
        +
        static inline uint32_t
        __attribute ((always_inline))
        jisx0208_to_ucs4 (const unsigned char **s, size_t avail,
        unsigned char offset)



        --- libc/include/libc-symbols.h 2005/02/11 00:29:46     1.70
        +++ libc/include/libc-symbols.h 2005/03/17 21:06:27     1.71
        @@ -583,78 +583,23 @@
        #  define hidden_proto(name, attrs...) \
           __hidden_proto (name, __GI_##name, ##attrs)
        #  define __hidden_proto(name, internal, attrs...) \
        -  extern __typeof (name) internal; \
           extern __typeof (name) name __asm__ (__hidden_asmname
        (#internal)) \
           __hidden_proto_hiddenattr (attrs);
        #  define __hidden_asmname(name) \
           __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
        #  define __hidden_asmname1(prefix, name)
        __hidden_asmname2(prefix, name)
        #  define __hidden_asmname2(prefix, name) #prefix name
        -#  ifdef HAVE_ASM_SET_DIRECTIVE
        -#   define __hidden_def1(original,
        alias)                      \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        ASM_LINE_SEP      \
        -  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
        -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#     define __hidden_dot_def1(original, alias)
        ASM_LINE_SEP   \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        ASM_LINE_SEP  \
        -  .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME
        (original)
        -#   else
        -#     define __hidden_dot_def1(original, alias)
        -#   endif
        -#  else
        -#   define __hidden_def1(original,
        alias)                      \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        ASM_LINE_SEP      \
        -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
        -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#    define __hidden_dot_def1(original, alias)
        ASM_LINE_SEP    \
        -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        ASM_LINE_SEP  \
        -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
        -#   else
        -#    define __hidden_dot_def1(original, alias)
        -#   endif
        -#  endif
        -#  define __hidden_def2(...) #__VA_ARGS__
        -#  define __hidden_def3(...) __hidden_def2 (__VA_ARGS__)
        -#  define hidden_def(name)
        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name)
        \
        -  __hidden_dot_def1 (__GI_##name, name)));
        -#  define
        hidden_data_def(name)                                        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name,
        name)));
        -#  define hidden_ver(local,
        name)                              \
        -  __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name)
        \
        -  __hidden_dot_def1 (local, __GI_##name)));
        -#  define hidden_data_ver(local, name)
        \
        -  __asm__ (__hidden_def3 (__hidden_def1 (local,
        __GI_##name)));
        -#  ifdef HAVE_WEAK_SYMBOLS
        -#   ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
        -#    define __hidden_weak1(original,
        alias)                    \
        -  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
        -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#     define __hidden_dot_weak1(original, alias)
        ASM_LINE_SEP    \
        -  .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME
        (original)
        -#    else
        -#     define __hidden_dot_weak1(original, alias)
        -#    endif
        -#   else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
        -#    define __hidden_weak1(original,
        alias)                    \
        -  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP
        \
        -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
        -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
        -#     define __hidden_dot_weak1(original, alias)
        ASM_LINE_SEP    \
        -  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
        -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
        -#    else
        -#     define __hidden_dot_weak1(original, alias)
        -#    endif
        -#   endif
        -#   define hidden_weak(name)
        \
        -  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name)
        \
        -  __hidden_dot_weak1 (__GI_##name, name)));
        -#   define
        hidden_data_weak(name)                                      \
        -  __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name,
        name)));
        -#  else
        -#   define hidden_weak(name) hidden_def (name)
        -#  endif
        +#  define __hidden_ver1(local, internal, name) \
        +  extern __typeof (name) __EI_##name __asm__(__hidden_asmname
        (#internal)); \
        +  extern __typeof (name) __EI_##name \
        +       __attribute__((alias (__hidden_asmname (#local))))
        +#  define hidden_ver(local, name)      __hidden_ver1(local,
        __GI_##name, name);
        +#  define hidden_data_ver(local, name) hidden_ver(local,
        name)
        +#  define hidden_def(name)
        __hidden_ver1(__GI_##name, name, name);
        +#  define
        hidden_data_def(name)                hidden_def(name)
        +#  define hidden_weak(name) \
        +       __hidden_ver1(__GI_##name, name, name)
        __attribute__((weak));
        +#  define hidden_data_weak(name)       hidden_weak(name)
        # else
        /* For assembly, we need to do the opposite of what we do in
        C:



        --- wcsmbs/wcscoll.c    2004/03/14 21:05:48     1.13
        +++ wcsmbs/wcscoll.c    2005/03/17 21:06:24     1.14
        @@ -22,12 +22,11 @@

        #define STRING_TYPE wchar_t
        #define USTRING_TYPE wint_t
        -#define STRCOLL __wcscoll
        +#define STRCOLL wcscoll
        #define STRCOLL_L __wcscoll_l

        #include "../string/strcoll.c"

        #ifndef USE_IN_EXTENDED_LOCALE_MODEL
        -weak_alias (__wcscoll, wcscoll)
        libc_hidden_weak (wcscoll)
        #endif




        --- glibc-2.3.4/sysdeps/arm/dl-machine.h.old    Sun Mar 20
        17:54:37 2005
        +++ glibc-2.3.4/sysdeps/arm/dl-machine.h        Sun Mar 20
        17:57:32 2005
        @@ -359,7 +359,14 @@
        # endif

        /* Deal with an out-of-range PC24 reloc.  */
        -static Elf32_Addr
        +#if __GNUC__ >= 4
        +  auto inline Elf32_Addr
        +#else
        +  static inline Elf32_Addr
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
        {
           static void *fix_page;
        @@ -392,7 +399,14 @@
        /* Perform the relocation specified by RELOC and SYM (which is
        fully resolved).
            MAP is the object containing the reloc.  */

        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rel (struct link_map *map, const Elf32_Rel
        *reloc,
                         const Elf32_Sym *sym, const struct
        r_found_version *version,
                         void *const reloc_addr_arg)
        @@ -517,7 +531,14 @@
        }

        # ifndef RTLD_BOOTSTRAP
        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        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)
        @@ -597,7 +618,14 @@
        }
        # endif

        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel
        *reloc,
                                  void *const reloc_addr_arg)
        {
        @@ -606,7 +634,14 @@
        }

        # ifndef RTLD_BOOTSTRAP
        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela
        *reloc,
                                   void *const reloc_addr_arg)
        {
        @@ -615,7 +650,14 @@
        }
        # endif

        -static inline void
        +#if __GNUC__ >= 4
        +  auto inline void
        +#else
        +  static inline void
        +#endif
        +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
        +  __attribute ((always_inline))
        +#endif
        elf_machine_lazy_rel (struct link_map *map,
                              Elf32_Addr l_addr, const Elf32_Rel
        *reloc)
Quoted 8 lines
        {





        ---
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old        2003-02-20

14:22: 24.000000000 -0800

Quoted 79 lines
        +++
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c    2004-01-31
        16:01:50.000000000 -0800
        @@ -47,6 +47,12 @@
        #include <asm/page.h>
        #include <sys/sysctl.h>

        +/* see
        http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html
        */
        +#include <linux/version.h>
        +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
        +#define CTL_BUS_ISA BUS_ISA    /* and hope it's not the one
        from linux/input.h */
        +#endif
        +
        #define PATH_ARM_SYSTYPE       "/etc/arm_systype"
        #define PATH_CPUINFO           "/proc/cpuinfo"

        @@ -80,7 +86,7 @@
          * Initialize I/O system.  There are several ways to get the
        information
          * we need.  Each is tried in turn until one succeeds.
          *
        - * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is the
        preferred method
        + * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the
        preferred method
          *    but not all kernels support it.
          *
          * 2. Read the value (not the contents) of symlink
        PATH_ARM_SYSTYPE.
        @@ -100,8 +106,8 @@
        {
           char systype[256];
           int i, n;
        -  static int iobase_name[] = { CTL_BUS, BUS_ISA,
        BUS_ISA_PORT_BASE };
        -  static int ioshift_name[] = { CTL_BUS, BUS_ISA,
        BUS_ISA_PORT_SHIFT };
        +  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA,
        BUS_ISA_PORT_BASE };
        +  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA,
        BUS_ISA_PORT_SHIFT };
           size_t len = sizeof(io.base);

           if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)



        --- string/strcoll.c    2004/03/14 20:51:30     1.33
        +++ string/strcoll.c    2005/03/17 21:06:24     1.34
        @@ -23,6 +23,7 @@
        # define STRING_TYPE char
        # define STRCOLL strcoll
        # define STRCOLL_L __strcoll_l
        +# define USE_HIDDEN_DEF
        #endif

        #include "../locale/localeinfo.h"
        @@ -35,6 +36,7 @@
        {
           return STRCOLL_L (s1, s2, _NL_CURRENT_LOCALE);
        }
        -#if !defined WIDE_CHAR_VERSION
        -libc_hidden_def (strcoll)
        +
        +#ifdef USE_HIDDEN_DEF
        +libc_hidden_def (STRCOLL)
        #endif



        --- include/wchar.h     2004/03/14 20:45:10     1.26
        +++ include/wchar.h     2005/03/17 21:06:24     1.27
        @@ -56,7 +56,6 @@
        extern int __wcsncasecmp (__const wchar_t *__s1, __const
        wchar_t *__s2,
                                  size_t __n)
Quoted 10 lines
              __attribute_pure__;
        -extern int __wcscoll (__const wchar_t *__s1, __const wchar_t
        *__s2);
        extern size_t __wcslen (__const wchar_t *__s)
        __attribute_pure__;
        extern size_t __wcsnlen (__const wchar_t *__s, size_t
        __maxlen)
              __attribute_pure__;

*******************************************************************************

Quoted 10 lines
        On Wed, 2006-01-25 at 09:37 +0000, Steve Papacharalambous
        wrote:
        > Hi Vineet,
        >
        > I was looking at your steps on how to build a gcc-4.0
        toolchain for ARM:
        >
        >
Quoted 26 lines

http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005665.html

Quoted 23 lines
        >
        > The patches for glibc-2.3.5 that you mention don't appear to
        be attached
        > to the page, can you let me know where I can get these
        patches please?
        >
        > Thanks,
        >
        > Steve
        >

        _______________________________________________
        Linux-omap-open-source mailing list
        [email protected]
        http://linux.omap.com/mailman/listinfo/linux-omap-open-source

--
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty

--
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty

#6 lore raw

Remove all occurances of -lgcc_eh from the files: Makeconfig, configure and configure.in from top level glibc soruce code directory and recompile.

Quoted 675 lines · Luís Cargnini

ok i passed the compiler
but after added some patchs to glibc.2.3.5

glibc-2.3.5-allow-gcc-4.0-wordexp.patch glibc-2.3.5-allow-gcc4-string.patch
glibc-2.3.5-allow-gcc4-symbols.patch glibc-2.3.5-allow-gcc4-wcstol_l.patch
and your own patch
i received the following error:
/opt/arm-linux/lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld:
cannot find -lgcc_eh
collect2: ld returned 1 exit status
make[2]: *** [/home/lvcargnini/puc/mestrado/instramed/builds/linux/bglibc/iconv/iconvconfig] Error 1 make[2]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/glibc-2.3.5/iconv' make[1]: *** [iconv/others] Error 2
make[1]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/glibc- 2.3.5'

On 31/01/06, Vineet Tuli <[email protected]> wrote:

        Sorry for replying late. I was not available at office. Please
        use the
        option --disable-shared while compiling gcc. This will resolve
        the error
        of crti.o.
        
        This will give an error "cannot create executables" in the end
        which can 
        be safely ignored.
        
        Vineet
        
        On Fri, 2006-01-27 at 13:48 -0200, Luís Cargnini wrote:
        > this step:
        > [root at localhost]# cd /usr/src
        > [root at localhost
        > ]# tar –xjf  gcc-4.0.2.tar.bz2 
        >
        > A configuration file must be modified so that the compiler
        is built without libc includes. Edit
        the /usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and append
        >
        > –Dinhibit_libc –D__gthr_posix_h to the line starting with
        TARGET_LIBGCC2_CFLAGS =. 
        >
        >
        > The top of the file is shown below, after appending the
        flags.
        >
        > # Just for these, we omit the frame pointer since it makes
        such a big
        > # difference. It is then pointless adding debugging. 
        > TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC –
        Dinhibit_libc –D__gthr_posix_h
        >
        > LIBGCC2_DEBUG_CFLAGS = -g0
        >
        > Go to the /usr/src/build/gcc-4.0.2 directory to configure
        and build the GNU C compiler with the commands below. 
        >
        > [
        > root at localhost]# cd /usr/src/build/gcc-4.0.2
        > [root at localhost]# ../../gcc-4.0.2/configure
        –-target=arm-linux –-prefix=/opt/armv4 --disable-threads
        –-enable-languages=c
        >
        > [root at localhost]# make 
        > isn't working for me io always receive some error
        >
        > that was crti.o how to fix this ??
        >
        > [
        > root at localhost]# make install
        >
        >
        > On 27/01/06, Vineet Tuli < [email protected]> wrote:
        >         Some problem in my mail system. Attachment not
        going.
        >         Including the
        >         patches herein:
        >
        >         --- elf/dynamic- link.h.old      2005-03-12
        18:12:37.000000000
        >         -0800
        >         +++ elf/dynamic-link.h  2005-03-12
        18:12:59.777820848 -0800
        >         @@ -19,43 +19,6 @@
        >
        >         #include <elf.h >
        >         #include <assert.h>
        >         -
        >         -#ifdef RESOLVE
        >         -/* We pass reloc_addr as a pointer to void, as
        opposed to a
        >         pointer to
        >         -   ElfW(Addr), because not all architectures can
        assume that 
        >         the
        >         -   relocated address is properly aligned, whereas
        the
        >         compiler is
        >         -   entitled to assume that a pointer to a type is
        properly
        >         aligned for 
        >         -   the type.  Even if we cast the pointer back to
        some other
        >         type with
        >         -   less strict alignment requirements, the compiler
        might
        >         still
        >         -   remember that the pointer was originally more
        aligned, 
        >         thereby
        >         -   optimizing away alignment tests or using word
        instructions
        >         for
        >         -   copying memory, breaking the very code written
        to handle
        >         the
        >         -   unaligned cases.  */
        >         -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_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);
        >         -# if ELF_MACHINE_NO_RELA || defined
        ELF_MACHINE_PLT_REL 
        >         -auto void __attribute__((always_inline))
        >         -elf_machine_lazy_rel (struct link_map *map,
        >         -                     ElfW(Addr) l_addr, const
        ElfW(Rel)
        >         *reloc);
        >         -# else
        >         -auto void __attribute__((always_inline))
        >         -elf_machine_lazy_rel (struct link_map *map,
        >         -                     ElfW(Addr) l_addr, const
        ElfW(Rela)
        >         *reloc); 
        >         -# endif
        >         -#endif
        >         -
        >         #include <dl-machine.h>
        >
        >         #ifndef VERSYMIDX
        >
        >
        >
        >         ---
        glibc-2.3.5.orig/iconvdata/jis0208.h        2003-06-11 
        >         21:40: 42.000000000 +0000
        >         +++ glibc-2.3.5/iconvdata/jis0208.h     2005-07-15
        >         18:32:20.726328528 +0000
        >         @@ -24,15 +24,6 @@
        >         #include <gconv.h >
        >         #include <stdint.h>
        >
        >         -/* 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 jisx0208_ucs_idx
        >         {
        >         @@ -42,6 +33,15 @@
        >         }; 
        >
        >
        >         +/* 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];
        >         +
        >         +
        >         static inline uint32_t 
        >         __attribute ((always_inline))
        >         jisx0208_to_ucs4 (const unsigned char **s, size_t
        avail,
        >         unsigned char offset)
        >
        >
        >
        >         --- libc/include/libc-symbols.h 2005/02/11 00:29:46
        1.70
        >         +++ libc/include/libc-symbols.h 2005/03/17 21:06:27
        1.71
        >         @@ -583,78 +583,23 @@
        >         #  define hidden_proto(name, attrs...) \
        >            __hidden_proto (name, __GI_##name, ##attrs) 
        >         #  define __hidden_proto(name, internal, attrs...) \
        >         -  extern __typeof (name) internal; \
        >            extern __typeof (name) name __asm__
        (__hidden_asmname
        >         (#internal)) \ 
        >            __hidden_proto_hiddenattr (attrs);
        >         #  define __hidden_asmname(name) \
        >            __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
        >         #  define __hidden_asmname1(prefix, name) 
        >         __hidden_asmname2(prefix, name)
        >         #  define __hidden_asmname2(prefix, name) #prefix
        name
        >         -#  ifdef HAVE_ASM_SET_DIRECTIVE
        >         -#   define __hidden_def1(original,
        >         alias)                      \
        >         -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        >         ASM_LINE_SEP      \
        >         -  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME
        (original)
        >         -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME 
        >         -#     define __hidden_dot_def1(original, alias)
        >         ASM_LINE_SEP   \
        >         -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        >         ASM_LINE_SEP  \
        >         -  .set C_SYMBOL_DOT_NAME (alias),
        C_SYMBOL_DOT_NAME 
        >         (original)
        >         -#   else
        >         -#     define __hidden_dot_def1(original, alias)
        >         -#   endif
        >         -#  else
        >         -#   define __hidden_def1(original, 
        >         alias)                      \
        >         -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias)
        >         ASM_LINE_SEP      \
        >         -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
        >         -#   ifdef HAVE_ASM_GLOBAL_DOT_NAME 
        >         -#    define __hidden_dot_def1(original, alias)
        >         ASM_LINE_SEP    \
        >         -  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias)
        >         ASM_LINE_SEP  \
        >         -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME
        (original) 
        >         -#   else
        >         -#    define __hidden_dot_def1(original, alias)
        >         -#   endif
        >         -#  endif
        >         -#  define __hidden_def2(...) #__VA_ARGS__
        >         -#  define __hidden_def3(...) __hidden_def2
        (__VA_ARGS__) 
        >         -#  define hidden_def(name)
        >         \
        >         -  __asm__ (__hidden_def3 (__hidden_def1
        (__GI_##name, name)
        >         \
        >         -  __hidden_dot_def1 (__GI_##name, name)));
        >         -#  define
        >
        hidden_data_def(name)                                        \
        >         -  __asm__ (__hidden_def3 (__hidden_def1
        (__GI_##name,
        >         name)));
        >         -#  define hidden_ver(local, 
        >         name)                              \
        >         -  __asm__ (__hidden_def3 (__hidden_def1 (local,
        __GI_##name)
        >         \
        >         -  __hidden_dot_def1 (local, __GI_##name)));
        >         -#  define hidden_data_ver(local, name) 
        >         \
        >         -  __asm__ (__hidden_def3 (__hidden_def1 (local,
        >         __GI_##name)));
        >         -#  ifdef HAVE_WEAK_SYMBOLS
        >         -#   ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
        >         -#    define __hidden_weak1(original, 
        >         alias)                    \
        >         -  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME
        (original)
        >         -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
        >         -#     define __hidden_dot_weak1(original, alias) 
        >         ASM_LINE_SEP    \
        >         -  .weakext C_SYMBOL_DOT_NAME (alias),
        C_SYMBOL_DOT_NAME
        >         (original)
        >         -#    else
        >         -#     define __hidden_dot_weak1(original, alias) 
        >         -#    endif
        >         -#   else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
        >         -#    define __hidden_weak1(original,
        >         alias)                    \
        >         -  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP 
        >         \
        >         -  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
        >         -#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
        >         -#     define __hidden_dot_weak1(original, alias)
        >         ASM_LINE_SEP    \ 
        >         -  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
        >         -  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME
        (original)
        >         -#    else
        >         -#     define __hidden_dot_weak1(original, alias) 
        >         -#    endif
        >         -#   endif
        >         -#   define hidden_weak(name)
        >         \
        >         -  __asm__ (__hidden_def3 (__hidden_weak1
        (__GI_##name, name)
        >         \
        >         -  __hidden_dot_weak1 (__GI_##name, name))); 
        >         -#   define
        >
        hidden_data_weak(name)                                      \
        >         -  __asm__ (__hidden_def3 (__hidden_weak1
        (__GI_##name,
        >         name)));
        >         -#  else 
        >         -#   define hidden_weak(name) hidden_def (name)
        >         -#  endif
        >         +#  define __hidden_ver1(local, internal, name) \
        >         +  extern __typeof (name) __EI_##name
        __asm__(__hidden_asmname 
        >         (#internal)); \
        >         +  extern __typeof (name) __EI_##name \
        >         +       __attribute__((alias (__hidden_asmname
        (#local))))
        >         +#  define hidden_ver(local,
        name)      __hidden_ver1(local, 
        >         __GI_##name, name);
        >         +#  define hidden_data_ver(local, name)
        hidden_ver(local,
        >         name)
        >         +#  define hidden_def(name)
        >         __hidden_ver1(__GI_##name, name, name); 
        >         +#  define
        >
        hidden_data_def(name)                hidden_def(name)
        >         +#  define hidden_weak(name) \
        >         +       __hidden_ver1(__GI_##name, name, name)
        >         __attribute__((weak)); 
        >         +#  define hidden_data_weak(name)
        hidden_weak(name)
        >         # else
        >         /* For assembly, we need to do the opposite of what
        we do in
        >         C:
        >
        >
        >
        >         --- wcsmbs/wcscoll.c    2004/03/14 21:05:48     1.13
        >         +++ wcsmbs/wcscoll.c    2005/03/17 21:06:24     1.14
        >         @@ -22,12 +22,11 @@
        >
        >         #define STRING_TYPE wchar_t 
        >         #define USTRING_TYPE wint_t
        >         -#define STRCOLL __wcscoll
        >         +#define STRCOLL wcscoll
        >         #define STRCOLL_L __wcscoll_l
        >
        >         #include "../string/strcoll.c" 
        >
        >         #ifndef USE_IN_EXTENDED_LOCALE_MODEL
        >         -weak_alias (__wcscoll, wcscoll)
        >         libc_hidden_weak (wcscoll)
        >         #endif
        >
        >
        >
        >
        >         --- glibc-2.3.4/sysdeps/arm/dl-machine.h.old    Sun
        Mar 20
        >         17:54:37 2005
        >         +++ glibc-2.3.4/sysdeps/arm/dl-machine.h        Sun
        Mar 20
        >         17:57:32 2005
        >         @@ -359,7 +359,14 @@ 
        >         # endif
        >
        >         /* Deal with an out-of-range PC24 reloc.  */
        >         -static Elf32_Addr
        >         +#if __GNUC__ >= 4
        >         +  auto inline Elf32_Addr
        >         +#else 
        >         +  static inline Elf32_Addr
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2)
        >         +  __attribute ((always_inline))
        >         +#endif 
        >         fix_bad_pc24 (Elf32_Addr *const reloc_addr,
        Elf32_Addr value)
        >         {
        >            static void *fix_page;
        >         @@ -392,7 +399,14 @@
        >         /* Perform the relocation specified by RELOC and SYM
        (which is 
        >         fully resolved).
        >             MAP is the object containing the reloc.  */
        >
        >         -static inline void
        >         +#if __GNUC__ >= 4
        >         +  auto inline void
        >         +#else 
        >         +  static inline void
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2)
        >         +  __attribute ((always_inline))
        >         +#endif 
        >         elf_machine_rel (struct link_map *map, const
        Elf32_Rel
        >         *reloc,
        >                          const Elf32_Sym *sym, const struct
        >         r_found_version *version,
        >                          void *const reloc_addr_arg) 
        >         @@ -517,7 +531,14 @@
        >         }
        >
        >         # ifndef RTLD_BOOTSTRAP
        >         -static inline void
        >         +#if __GNUC__ >= 4
        >         +  auto inline void
        >         +#else 
        >         +  static inline void
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2)
        >         +  __attribute ((always_inline))
        >         +#endif 
        >         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) 
        >         @@ -597,7 +618,14 @@
        >         }
        >         # endif
        >
        >         -static inline void
        >         +#if __GNUC__ >= 4
        >         +  auto inline void
        >         +#else
        >         +  static inline void
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2)
        >         +  __attribute ((always_inline))
        >         +#endif 
        >         elf_machine_rel_relative (Elf32_Addr l_addr, const
        Elf32_Rel
        >         *reloc,
        >                                   void *const
        reloc_addr_arg)
        >         {
        >         @@ -606,7 +634,14 @@ 
        >         }
        >
        >         # ifndef RTLD_BOOTSTRAP
        >         -static inline void
        >         +#if __GNUC__ >= 4
        >         +  auto inline void
        >         +#else
        >         +  static inline void 
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2)
        >         +  __attribute ((always_inline))
        >         +#endif
        >         elf_machine_rela_relative (Elf32_Addr l_addr, const
        Elf32_Rela 
        >         *reloc,
        >                                    void *const
        reloc_addr_arg)
        >         {
        >         @@ -615,7 +650,14 @@
        >         }
        >         # endif
        >
        >         -static inline void 
        >         +#if __GNUC__ >= 4
        >         +  auto inline void
        >         +#else
        >         +  static inline void
        >         +#endif
        >         +#if __GNUC__ >= 4 || (__GNUC__ == 3 &&
        __GNUC_MINOR__ >= 2) 
        >         +  __attribute ((always_inline))
        >         +#endif
        >         elf_machine_lazy_rel (struct link_map *map,
        >                               Elf32_Addr l_addr, const
        Elf32_Rel
        >         *reloc) 
        >         {
        >
        >
        >
        >
        >
        >         ---
        >
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old        2003-02-20 14:22: 24.000000000 -0800
        >         +++
        >
        glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c    2004-01-31
        >         16:01:50.000000000 -0800
        >         @@ -47,6 +47,12 @@
        >         #include <asm/page.h>
        >         #include <sys/sysctl.h> 
        >
        >         +/* see
        >
        http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html
        >         */
        >         +#include <linux/version.h> 
        >         +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
        >         +#define CTL_BUS_ISA BUS_ISA    /* and hope it's not
        the one
        >         from linux/input.h */
        >         +#endif
        >         + 
        >         #define PATH_ARM_SYSTYPE       "/etc/arm_systype"
        >         #define PATH_CPUINFO           "/proc/cpuinfo"
        >
        >         @@ -80,7 +86,7 @@
        >           * Initialize I/O system.  There are several ways
        to get the 
        >         information
        >           * we need.  Each is tried in turn until one
        succeeds.
        >           *
        >         - * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is
        the
        >         preferred method 
        >         + * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This
        is the
        >         preferred method
        >           *    but not all kernels support it.
        >           *
        >           * 2. Read the value (not the contents) of symlink 
        >         PATH_ARM_SYSTYPE.
        >         @@ -100,8 +106,8 @@
        >         {
        >            char systype[256];
        >            int i, n;
        >         -  static int iobase_name[] = { CTL_BUS, BUS_ISA, 
        >         BUS_ISA_PORT_BASE };
        >         -  static int ioshift_name[] = { CTL_BUS, BUS_ISA,
        >         BUS_ISA_PORT_SHIFT };
        >         +  static int iobase_name[] = { CTL_BUS,
        CTL_BUS_ISA,
        >         BUS_ISA_PORT_BASE }; 
        >         +  static int ioshift_name[] = { CTL_BUS,
        CTL_BUS_ISA,
        >         BUS_ISA_PORT_SHIFT };
        >            size_t len = sizeof(io.base);
        >
        >            if (! sysctl (iobase_name, 3, &io.io_base, &len,
        NULL, 0) 
        >
        >
        >
        >         --- string/strcoll.c    2004/03/14 20:51:30     1.33
        >         +++ string/strcoll.c    2005/03/17 21:06:24     1.34
        >         @@ -23,6 +23,7 @@
        >         # define STRING_TYPE char 
        >         # define STRCOLL strcoll
        >         # define STRCOLL_L __strcoll_l
        >         +# define USE_HIDDEN_DEF
        >         #endif
        >
        >         #include "../locale/localeinfo.h"
        >         @@ -35,6 +36,7 @@
        >         {
        >            return STRCOLL_L (s1, s2, _NL_CURRENT_LOCALE);
        >         }
        >         -#if !defined WIDE_CHAR_VERSION
        >         -libc_hidden_def (strcoll) 
        >         +
        >         +#ifdef USE_HIDDEN_DEF
        >         +libc_hidden_def (STRCOLL)
        >         #endif
        >
        >
        >
        >         --- include/wchar.h     2004/03/14 20:45:10     1.26
        >         +++ include/wchar.h     2005/03/17 21:06:24     1.27
        >         @@ -56,7 +56,6 @@
        >         extern int __wcsncasecmp (__const wchar_t *__s1,
        __const
        >         wchar_t *__s2,
        >                                   size_t __n)
        >               __attribute_pure__; 
        >         -extern int __wcscoll (__const wchar_t *__s1,
        __const wchar_t
        >         *__s2);
        >         extern size_t __wcslen (__const wchar_t *__s)
        >         __attribute_pure__;
        >         extern size_t __wcsnlen (__const wchar_t *__s,
        size_t 
        >         __maxlen)
        >               __attribute_pure__;
        >
        >
        *******************************************************************************
        >
        >         On Wed, 2006-01-25 at 09:37 +0000, Steve
        Papacharalambous 
        >         wrote:
        >         > Hi Vineet,
        >         >
        >         > I was looking at your steps on how to build a
        gcc-4.0
        >         toolchain for ARM:
        >         >
        >         > 
        >
        http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005665.html
        >         >
        >         > The patches for glibc-2.3.5 that you mention don't
        appear to
        >         be attached
        >         > to the page, can you let me know where I can get
        these
        >         patches please?
        >         >
        >         > Thanks, 
        >         >
        >         > Steve
        >         >
        >
        >         _______________________________________________
        >         Linux-omap-open-source mailing list
        >         [email protected]
        >
        http://linux.omap.com/mailman/listinfo/linux-omap-open-source
        >
        >
        >
        > --
        > Thanks && Regards
        > Msc. Bsc. Luís Vitório Cargnini
        > IEEE Member
        > Mastering Degree student @ PUC-RS Electrical Engineer
        Faculty
Signature · 4 lines
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

hi thanks it worked for glibc

now the last problem is with compialtion of gcc with glibc

because during compilation of new gcc (with glibc) it happened:

make[2]: Entering directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/b-gcc/gcc' /home/lvcargnini/puc/mestrado/instramed/builds/linux/b-gcc/gcc/xgcc -B/home/lvcargnini/puc/mestrado/instramed/builds/linux/b-gcc/gcc/ -B/opt/arm-linux/arm-linux/bin/ -B/opt/arm-linux/arm-linux/lib/ -isystem /opt/arm-linux/arm-linux/include -isystem
/opt/arm-linux/arm-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc- 4.0.2/gcc -I../../gcc-4.0.2/gcc/. -I../../gcc-4.0.2/gcc/../include -I../../gcc-4.0.2/gcc/../libcpp/include -fvisibility=hidden -DHIDE_EXPORTS -fexceptions -c ../../gcc-4.0.2/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr- default.h:1,

                 from ../../gcc-4.0.2/gcc/gthr.h:114,
                 from ../../gcc-4.0.2/gcc/unwind-dw2.c:42:

../../gcc-4.0.2/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directory
../../gcc-4.0.2/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or directory

just this it is simple i know that i could add the path but exist a way to fix this ?? this little problem is known ?
i tried adding -I/opt/arm-linux/include on Makefile it compiled but after some compiling time i received the following:

/opt/arm-linux/arm-linux/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/b-gcc/gcc' make[1]: *** [libgcc.a] Error 2
make[1]: Leaving directory `/home/lvcargnini/puc/mestrado/instramed/builds/linux/b-gcc/gcc'
make: *** [all-gcc] Error 2

--
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS Electrical Engineer Faculty