> -----Original Message----- > From: Andrew Haley [mailto:aph@xxxxxxxxxx] > Sent: Thursday, January 11, 2007 5:36 PM > To: Lehner, Michael > Cc: gcc-help@xxxxxxxxxxx > Subject: Re: Objects tied in by Linker > > Lehner, Michael writes: > > > > I am compiling a Java Sources with gcj to native machine code for a > > mips target and our project is using Greenhills compiler, so I have > > to use Greenhills to compile the rest of the project and to link > > the whole thing. > > That probably won't work. gcc (and gcj) assume that their own > libraries are present. The symbols you're missing are part of libgcc. > > Also, gcj uses the C++ ABI, and you can't guarantee the Greenhills C++ > ABI is the same. If you compile all Java and C++ code with gcc, and > make sure that all the gcc runtime libraries are used, then it might > work. But I suspect your problems are just starting. > [Lehner, Michael] The hint to libgcc was very helpful to me I didn't find this library first because of its location. And I removed ccvprntf.o from libansi.a (a Greenhills-Library), because it had a multiple defined symbol with vfprintf.o (GNU). Using the GNU version also solved 6 errors and there is non new. But there are still 14 unresolved symbols and I don't know where to get them from, because most of them I can't even find in the linker output when I use the option -M. Perhaps someone could tell me something about the meaning of the symbols or where I find them. ------------------------------------------------------------------------ [elxr] (error) unresolved symbols: 14 _gp_disp from crt1.o --------------------- __fini_array_start from gnulib.a(elf-init.o) __fini_array_end from gnulib.a(elf-init.o) Linker output: .fini_array 0x0000000000909040 0x0 0x0000000000909040 PROVIDE (__fini_array_start, .) *(.fini_array) *(SORT(.fini_array.*)) 0x0000000000909040 PROVIDE (__fini_array_end, .) --------------------- __preinit_array_start from gnulib.a(elf-init.o) __preinit_array_end from gnulib.a(elf-init.o) Linker output: .preinit_array 0x0000000000909040 0x0 0x0000000000909040 PROVIDE (__preinit_array_start, .) *(.preinit_array) 0x0000000000909040 PROVIDE (__preinit_array_end, .) --------------------- __init_array_start from gnulib.a(elf-init.o) __init_array_end from gnulib.a(elf-init.o) Linker output: .init_array 0x0000000000909040 0x0 0x0000000000909040 PROVIDE (__init_array_start, .) *(SORT(.init_array.*)) *(.init_array) 0x0000000000909040 PROVIDE (__init_array_end, .) _errno from gnulib.a(pthread.o) ____strtoul_l_internal from gnulib.a(strtoul.o) __current_locale_name from gnulib.a(dcigettext.o) __libc_memalign from gnulib.a(dl-tls.o) __strtod_internal from gnulib.a(vfscanf.o) ____strtoll_l_internal from gnulib.a(strtoll.o) ____strtoull_l_internal from gnulib.a(strtoull.o) [elxr] (error) errors during processing --------------------------------------------------------------- Gnulib.a is a self made archive. I extracted all the archives of gnu and mad a new one where all objects are in one archive. This is because of the more simple handling with Greenhills linker. The symbols ____strtoul_l_internal, _IO_vfprintf, ____strtoll_l_internal and ____strtoull_l_internal can be solved by strtoll_l.o, strtoull_l.o, strtoul_l.o and vfprintf.o but then I get the following multiply definitions: [elxr] (error) symbol __strtol_ul_max_tab multiply defined in: frame\src\gnulib.a(strtol_l.o) frame\src\gnulib.a(strtoul_l.o) [elxr] (error) symbol __strtol_ul_rem_tab multiply defined in: frame\src\gnulib.a(strtol_l.o) frame\src\gnulib.a(strtoul_l.o) [elxr] (error) symbol __strtol_ul_max_tab multiply defined in: frame\src\gnulib.a(strtol_l.o) frame\src\gnulib.a(strtoll_l.o) [elxr] (error) symbol __strtol_ull_max_tab multiply defined in: frame\src\gnulib.a(strtoll_l.o) frame\src\gnulib.a(strtoull_l.o) [elxr] (error) symbol __strtol_ul_max_tab multiply defined in: frame\src\gnulib.a(strtol_l.o) frame\src\gnulib.a(strtoull_l.o) [elxr] (error) symbol __strtol_ull_rem_tab multiply defined in: frame\src\gnulib.a(strtoll_l.o) frame\src\gnulib.a(strtoull_l.o) Has anyone an idea how I could solve these remaining problems? I hope the problems aren't really starting, because I already see my next problems after successfully compiling the whole stuff, because we are using an own operating system and it isn't POSIX conform. This means there will be much work in porting java to our system (memory allocation, interfaces we are using, ...). Michael Mit freundlichen Grüßen Michael Lehner Siemens AG Automation and Drives Industrial Automation Systems A&D AS RD Werner-von-Siemens Str. 50 92224 Amberg, Germany Tel.: +49 9621 80-5209 michael.lehner@xxxxxxxxxxx Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Heinrich v. Pierer; Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Jürgen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Klaus Wucherer Sitz der Gesellschaft: Berlin und München Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684 WEEE-Reg.-Nr. DE 23691322