public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Help with an Wierd Error
@ 2010-04-02 18:05 Balaji.Iyer
  2010-04-06 16:52 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Balaji.Iyer @ 2010-04-02 18:05 UTC (permalink / raw)
  To: gcc

Hello Everyone,
      I am trying to build an OpenRISC port of GCC. I am not getting much response from the OR32 people, and this error sounds a bit generic from google searches so I thought if someone would know how to solve it.

I build binutils, gcc and newlib  as they mentioned in the or32 website. But now I am getting this wierd error when I am trying to compile "Hello World" program

==================================================================================================================
or32-elf-gcc -v /tmp/test.c
Reading specs from /opt/or32/lib/gcc/or32-elf/4.2.2/specs
Target: or32-elf
Configured with: ../gcc-4.2.2/configure --target=or32-elf --prefix=/opt/or32 --with-gnu-as --with-gnu-ld --disable-libssp --with-newlib --enable-languages=c --disable-checking
Thread model: single
gcc version 4.2.2
 /opt/or32/libexec/gcc/or32-elf/4.2.2/cc1 -quiet -v test.c -quiet -dumpbase test.c -auxbase test -version -o /var/folders/kX/kXco8IKOGbKCP9ef7v-8K++++TI/-Tmp-//cch1Gb3x.s
ignoring nonexistent directory "/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/or32/lib/gcc/or32-elf/4.2.2/include
 /opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/include
End of search list.
GNU C version 4.2.2 (or32-elf)
	compiled by GNU C version 4.2.1 (Apple Inc. build 5646) (dot 1).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9e4259fc872a297ae129c5bc285bd4ea
 /opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/bin/as -o /var/folders/kX/kXco8IKOGbKCP9ef7v-8K++++TI/-Tmp-//ccMYERCM.o /var/folders/kX/kXco8IKOGbKCP9ef7v-8K++++TI/-Tmp-//cch1Gb3x.s
 /opt/or32/libexec/gcc/or32-elf/4.2.2/collect2 /opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o -L/opt/or32/lib/gcc/or32-elf/4.2.2 -L/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib /var/folders/kX/kXco8IKOGbKCP9ef7v-8K++++TI/-Tmp-//ccMYERCM.o -lgcc -lc -lgcc -lor32 -lc -lgcc -lc -lor32
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o: In function `loop':
(.text+0x54): undefined reference to `_stack'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o: In function `loop':
(.text+0x64): undefined reference to `___bss_start'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o: In function `loop':
(.text+0x6c): undefined reference to `__end'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-findfp.o): In function `__sfmoreglue':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdio/../../../../../gcc-4.2.2/newlib/libc/stdio/findfp.c:88: undefined reference to `___mulsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libor32.a(sbrk.o): In function `sbrk':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/libgloss/or32/../../../../gcc-4.2.2/libgloss/or32/sbrk.c:37: undefined reference to `__stack'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/libgloss/or32/../../../../gcc-4.2.2/libgloss/or32/sbrk.c:35: undefined reference to `__end'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-vfprintf.o): In function `_vfprintf_r':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdio/../../../../../gcc-4.2.2/newlib/libc/stdio/vfprintf.c:1314: undefined reference to `___umodsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdio/../../../../../gcc-4.2.2/newlib/libc/stdio/vfprintf.c:1315: undefined reference to `___udivsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdio/../../../../../gcc-4.2.2/newlib/libc/stdio/vfprintf.c:1597: undefined reference to `___modsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdio/../../../../../gcc-4.2.2/newlib/libc/stdio/vfprintf.c:1598: undefined reference to `___divsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-dtoa.o): In function `quorem':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/dtoa.c:60: undefined reference to `___udivsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/dtoa.c:73: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/dtoa.c:74: undefined reference to `___mulsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-mprec.o): In function `__multiply':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mprec.c:366: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mprec.c:368: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mprec.c:383: undefined reference to `___mulsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-mprec.o):/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mprec.c:386: more undefined references to `___mulsi3' follow
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-mprec.o): In function `__s2b':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mprec.c:201: undefined reference to `___divsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/libc.a(lib_a-callocr.o): In function `_calloc_r':
/home_dir/Research/OpenRISC/b-gcc/or32-elf/newlib/libc/stdlib/../../../../../gcc-4.2.2/newlib/libc/stdlib/mallocr.c:3202: undefined reference to `___mulsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/libgcc.a(_muldi3.o): In function `__muldi3':
/home_dir/Research/OpenRISC/b-gcc/gcc/../../gcc-4.2.2/gcc/libgcc2.c:536: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/gcc/../../gcc-4.2.2/gcc/libgcc2.c:536: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/gcc/../../gcc-4.2.2/gcc/libgcc2.c:536: undefined reference to `___mulsi3'
/home_dir/Research/OpenRISC/b-gcc/gcc/../../gcc-4.2.2/gcc/libgcc2.c:536: undefined reference to `___mulsi3'
/opt/or32/lib/gcc/or32-elf/4.2.2/libgcc.a(_muldi3.o):/home_dir/Research/OpenRISC/b-gcc/gcc/../../gcc-4.2.2/gcc/libgcc2.c:538: more undefined references to `___mulsi3' follow
collect2: ld returned 1 exit status

=========================================================================================================

Any help is highly appreciated!

Yours Sincerely,

Balaji V. Iyer.

PS. Please CC me in your response since I am not a subscribed member of this mailing list.


Balaji V. Iyer, Ph.D.
Research Engineer,
Sensors & EM Applications Laboratory,
Georgia Tech Research Institute

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Help with an Wierd Error
  2010-04-02 18:05 Help with an Wierd Error Balaji.Iyer
@ 2010-04-06 16:52 ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2010-04-06 16:52 UTC (permalink / raw)
  To: Balaji.Iyer; +Cc: gcc

On 04/02/2010 11:02 AM, Balaji.Iyer@gtri.gatech.edu wrote:
> /opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o: In function `loop':
> (.text+0x64): undefined reference to `___bss_start'

It looks like a case of one-too-many underscores prepended to symbol 
names.  The default for ELF is to not prepend an underscore.  The 
default for COFF is to prepend an underscore.  Check USER_LABEL_PREFIX 
which should be empty for ELF (default definition in defaults.h file). 
Check ASM_OUTPUT_LABELREF which should use %U and not an explicit 
underscore (see defaults.h file).  Check for usage of the 
-fleading-underscores option (should not be used).  Check for header 
file inclusion to see if something is out of place, such as a use of 
svr3.h when svr4.h should be used.

Also check to make sure that gcc, gas, and gld all agree on whether a 
symbol is prepended with an underscore or not.  If gcc does it but gas 
doesn't, then C code calling assembly language code may fail because of 
the mismatch.

Jim

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-06 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-02 18:05 Help with an Wierd Error Balaji.Iyer
2010-04-06 16:52 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).