This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


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

glibc-2.3.6 build errors on sparc64


Hi,

Cross-compiling glibc-2.3.6 to the sparc64-linux platform, with gcc-4.0.2,
fails as follows:

../sysdeps/sparc/sparc64/memset.S: Assembler messages:
../sysdeps/sparc/sparc64/memset.S:248: Error: Architecture mismatch on "fzero".
../sysdeps/sparc/sparc64/memset.S:248:  (Requires v9a|v9b; requested architecture is v9.)
../sysdeps/sparc/sparc64/memset.S:251: Error: Architecture mismatch on "fzero".
../sysdeps/sparc/sparc64/memset.S:251:  (Requires v9a|v9b; requested architecture is v9.)
make[2]: *** [/cross/cross-build/build-glibc-sparc64/string/memset.o] error 1

glibc was configured with

.../glibc-2.3.6/configure --host=sparc64-linux --build=i486-suse-linux \
  --prefix=/cross/sparc64-linux --with-headers=/cross/sparc64-linux/include \
  --enable-add-ons=linuxthreads,libidn --disable-profile

gcc was configured with

.../gcc-4.0.2/configure --enable-shared --disable-nls \
  --target=sparc64-linux --prefix=/cross/sparc64-linux-tools \
  --with-local-prefix=/cross/sparc64-linux/local \
  --with-as=/cross/sparc64-linux-tools/bin/sparc64-linux-as --with-gnu-as \
  --with-ld=/cross/sparc64-linux-tools/bin/sparc64-linux-ld --with-gnu-ld \
  --enable-languages=c --enable-__cxa_atexit --disable-multilib

The assembler was configured with

.../binutils-2.16.1/configure --enable-shared --disable-nls \
  --target=sparc64-linux --prefix=/cross/sparc64-linux-tools

So, apparently, in the default configurations of sparc64 tools, the "fzero"
instruction is invalid. Therefore I think it's a bug if memset.S uses this
instruction unconditionally. Since the information about v9 vs. v9a/v9b is
not available during preprocessing of the .S file, IMO glibc's configure
script should check for it, or it should use something like

   stx %g0, [%o0]
   ldd [%o0], %f0

instead of

   fzero %f0

Likewise for memcpy.S, which dies with errors about faligndata, fsrc1,
alignaddr instructions:
...
../sysdeps/sparc/sparc64/memcpy.S:890: Error: Architecture mismatch on "faligndata".
../sysdeps/sparc/sparc64/memcpy.S:890:  (Requires v9a|v9b; requested architecture is v9.)
../sysdeps/sparc/sparc64/memcpy.S:898: Error: Architecture mismatch on "faligndata".
../sysdeps/sparc/sparc64/memcpy.S:898:  (Requires v9a|v9b; requested architecture is v9.)

Likewise also for sysdeps/sparc/sparc64/soft-fp/sfp-machine.h, which has
two references to fzero:
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c: In function '_Qp_itoq':
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c:32: warning: right shift count >= width of type
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c:32: warning: right shift count >= width of type
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c:33: warning: right shift count is negative
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c:33: warning: right shift count is negative
../sysdeps/sparc/sparc64/soft-fp/qp_itoq.c:33: warning: '_fcw' is used uninitialized in this function
/tmp/ccT65aKv.s: Assembler messages:
/tmp/ccT65aKv.s:200: Error: Architecture mismatch on "fzero".
/tmp/ccT65aKv.s:200:  (Requires v9a|v9b; requested architecture is v9.)
make[2]: *** [/cross/cross-build/build-glibc-sparc64/soft-fp/qp_itoq.o] error 1

Furthermore there are build errors in dl-machine.h:

In file included from dynamic-link.h:63,
                 from dl-reloc.c:269:
../sysdeps/sparc/sparc64/dl-machine.h: In function '_dl_relocate_object':
../sysdeps/sparc/sparc64/dl-machine.h:39: error: invalid storage class for function 'elf_machine_matches_host'
../sysdeps/sparc/sparc64/dl-machine.h:60: error: invalid storage class for function 'elf_machine_dynamic'
../sysdeps/sparc/sparc64/dl-machine.h:71: error: invalid storage class for function 'elf_machine_load_address'
../sysdeps/sparc/sparc64/dl-machine.h:95: error: invalid storage class for function 'sparc64_fixup_plt'
../sysdeps/sparc/sparc64/dl-machine.h:219: error: invalid storage class for function 'elf_machine_fixup_plt'
../sysdeps/sparc/sparc64/dl-machine.h:229: error: invalid storage class for function 'elf_machine_plt_value'
../sysdeps/sparc/sparc64/dl-machine.h:484: error: invalid storage class for function 'elf_machine_runtime_setup'
make[2]: *** [/cross/cross-build/build-glibc-sparc64/elf/dl-reloc.o] error 1

The following patch fixes it. (Cf. also Jakub's 2005-03-15 patch.)

--- glibc-2.3.6/sysdeps/sparc/sparc64/dl-machine.h.bak	2005-10-17 06:52:30.000000000 +0200
+++ glibc-2.3.6/sysdeps/sparc/sparc64/dl-machine.h	2005-12-03 20:40:32.000000000 +0100
@@ -34,7 +34,12 @@
 #define ELF64_R_TYPE_DATA(info) ((info) >> 8)
 
 /* Return nonzero iff ELF header is compatible with the running host.  */
-static inline int
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline int
 elf_machine_matches_host (const Elf64_Ehdr *ehdr)
 {
   return ehdr->e_machine == EM_SPARCV9;
@@ -55,7 +60,12 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static inline Elf64_Addr
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline Elf64_Addr
 elf_machine_dynamic (void)
 {
   register Elf64_Addr *elf_pic_register __asm__("%l7");
@@ -66,7 +76,12 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static inline Elf64_Addr
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline Elf64_Addr
 elf_machine_load_address (void)
 {
   register Elf32_Addr *pc __asm ("%o7");
@@ -88,7 +103,12 @@
 
 /* We have 4 cases to handle.  And we code different code sequences
    for each one.  I love V9 code models...  */
-static inline void
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline void
 sparc64_fixup_plt (struct link_map *map, const Elf64_Rela *reloc,
 		   Elf64_Addr *reloc_addr, Elf64_Addr value,
 		   Elf64_Addr high, int t)
@@ -212,7 +232,12 @@
     }
 }
 
-static inline Elf64_Addr
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline Elf64_Addr
 elf_machine_fixup_plt (struct link_map *map, lookup_t t,
 		       const Elf64_Rela *reloc,
 		       Elf64_Addr *reloc_addr, Elf64_Addr value)
@@ -223,7 +248,12 @@
 }
 
 /* Return the final value of a plt relocation.  */
-static inline Elf64_Addr
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline Elf64_Addr
 elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
 		       Elf64_Addr value)
 {
@@ -479,7 +509,12 @@
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */
 
-static inline int
+#ifdef RESOLVE
+auto
+#else
+static
+#endif
+inline int
 elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 {
   if (l->l_info[DT_JMPREL] && lazy)


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