This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

RE: crosstool-0.28-rc36: ld.so.1 undefined reference


gcc-3.4.0-glibc-2.2.5 barfs with a few undefined refereces and multiple
definitions. The follwing patch seems to take care of the undefined
reference of __dl_runtime_resolve symbol. 

Filename: patches/glibc-2.2.5/glibc-2.2.5-mips-dl-machine-1.60.patch 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retrieved with
  wget
'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/mips/dl-machine.h.diff?r1=1.59&r2=1.60&cvsroot=glibc'

ChangeLog:
        sysdeps/mips/dl-machine.h (elf_machine_matches_host): Use
        __attribute_used__.
        (__dl_runtime_resolve): Likewise.

Fixes error

/home/cross/crosstool-0.28-rc36/build/mips-unknown-linux-gnu/gcc-3.4.0-glibc-2.2.5/build-glibc/elf/ld.so.1:
undefined reference to `__dl_runtime_resolve'

===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mips/dl-machine.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- libc/sysdeps/mips/dl-machine.h      2002/02/03 00:29:15     1.59
+++ libc/sysdeps/mips/dl-machine.h      2002/02/08 18:56:57     1.60
@@ -69,7 +69,7 @@
    } while (0)
 
 /* Return nonzero iff ELF header is compatible with the running host. 
*/
-static inline int __attribute__ ((unused))
+static inline int __attribute_used__
 elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
 {
   switch (ehdr->e_machine)
@@ -262,7 +262,7 @@
 /* This is called from assembly stubs below which the compiler can't
see.  */ \
 static ElfW(Addr)                                                      
     \
 __dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr))  
     \
-                 __attribute__ ((unused));                             
     \
+                 __attribute_used__;                                   
     \
                                                                        
     \
 static ElfW(Addr)                                                      
     \
 __dl_runtime_resolve (ElfW(Word) sym_index,                            
     \ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looks like patches/glibs-2.3.2/glibc-2.3.2-allow-gcc-3.4-nounit.patch
needs to be "ported" to glibc-2.2.5 to fix the multiple definitions of
'dummy' in build-glibc/csu/crtn.S and undefined reference to
'i_am_not_a_leaf' in build-glibc/csu/crti.S. Also, there are multiple
definitions to '_init' and '_fini' in build-glibc/csu/crtn.S. The
linuxthreads 2.3.2 nounit.patch should also be "ported" to linuxthreads
2.2.5 ??

---
/ml


> -------- Original Message --------
> Subject: Re: crosstool-0.28-rc36: ld.so.1 undefined reference
> From: "Dan Kegel" <dank@kegel.com>
> Date: Sat, September 25, 2004 9:04 pm
> To: ml@bitbash.net
> Cc: crossgcc@sources.redhat.com
> 
> ml@bitbash.net wrote:
> > Using _dl_init instead of _dl_init_intenal works. It built the toolchain
> > (I did not test it though). 
> 
> Thanks, I'll make that change in the next snapshot.
> 
> > Now I'm trying to cross compile gcc-3.4.0-glibc-2.2.5. Looks like I need
> > to install host gcc3.2 or later. Does host_gcc3.2 require
> > host_glibc2.2.5?
> 
> I don't think so.   Let us know if you have any problems.
> - Dan


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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