Hi folks,
I've been trying to compile GPC on my NetBSD/sparc 1.5.2 system. Unfortunately it fails with a bunch of 'undefined reference' errors for calls to libc functions.
Here are a few snips of the output from make. If anyone could suggest a fix, I'd be very grateful.
bash-2.05$ uname -a NetBSD helios 1.5.2 NetBSD 1.5.2 (GENERIC) #0: Wed Aug 22 04:33:09 CST 2001 toor@proxima:/usr/src/sys/arch/sparc/compile/GENERIC sparc
bash-2.05$ make make all-recursive Making all in intl Making all in lib Making all in makeinfo gcc -DIN_GCC -DHAIFA -g -O2 -DHAVE_CONFIG_H -o cccp cccp.o cexp.o intl.o prefix.o version.o mbchar.o obstack.o ../libiberty/libiberty.a /usr/lib/crt0.o: In function `___start': /usr/lib/crt0.o(.text+0xf8): undefined reference to `main' cccp.o: In function `safe_read': /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x224): undefined reference to `_read' /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x238): undefined reference to `___errno' cccp.o: In function `safe_write': /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x280): undefined reference to `_write' /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x294): undefined reference to `___errno' cccp.o: In function `eprint_string': /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x2d8): undefined reference to `_(short, (void))'
<snip>
`___divdi3' /tmp/sky/share/bison.simple(.text+0xafc): undefined reference to `___udivdi3' /tmp/sky/share/bison.simple(.text+0xb70): undefined reference to `___moddi3' /tmp/sky/share/bison.simple(.text+0xb8c): undefined reference to `___umoddi3'
<snip>
/usr/tmp/gpc-build/gcc/obstack.c(.text+0x510): undefined reference to `_(short, (void))' /usr/tmp/gpc-build/gcc/obstack.c(.text+0x514): undefined reference to `_fputs' collect2: ld returned 1 exit status *** Error code 1
Stop. *** Error code 1
Stop.
Regards,
Philip.
<snip>
`___divdi3' /tmp/sky/share/bison.simple(.text+0xafc): undefined reference to `___udivdi3' /tmp/sky/share/bison.simple(.text+0xb70): undefined reference to `___moddi3' /tmp/sky/share/bison.simple(.text+0xb8c): undefined reference to `___umoddi3'
<snip>
These are normal on *BSD afaik. Libgcc is not automatically linked IIRC, and probably needs explicitely a -lgcc
On Tue, Aug 27, 2002 at 03:52:53PM +0200, Marco van de Voort wrote:
<snip>
`___divdi3' /tmp/sky/share/bison.simple(.text+0xafc): undefined reference to `___udivdi3' /tmp/sky/share/bison.simple(.text+0xb70): undefined reference to `___moddi3' /tmp/sky/share/bison.simple(.text+0xb8c): undefined reference to `___umoddi3'
<snip>
These are normal on *BSD afaik. Libgcc is not automatically linked IIRC, and probably needs explicitely a -lgcc
I've tried adding -lgcc to the CFLAGS line in my Makefile, but it still fails in the same way. Any ideas, please?
Cheers,
Philip.
Philip Plant wrote:
I've been trying to compile GPC on my NetBSD/sparc 1.5.2 system. Unfortunately it fails with a bunch of 'undefined reference' errors for calls to libc functions.
Here are a few snips of the output from make. If anyone could suggest a fix, I'd be very grateful.
bash-2.05$ uname -a NetBSD helios 1.5.2 NetBSD 1.5.2 (GENERIC) #0: Wed Aug 22 04:33:09 CST 2001 toor@proxima:/usr/src/sys/arch/sparc/compile/GENERIC sparc
bash-2.05$ make
I'm not familiar with *BSD, but you might need to do `make bootstrap' (see the GCC install instructions).
Frank
Hi Frank,
On Tue, Aug 27, 2002 at 08:36:09PM +0200, Frank Heckenbach wrote:
Philip Plant wrote:
I've been trying to compile GPC on my NetBSD/sparc 1.5.2 system. Unfortunately it fails with a bunch of 'undefined reference' errors for calls to libc functions.
<snip>
I'm not familiar with *BSD, but you might need to do `make bootstrap' (see the GCC install instructions).
I tried that too, after Googling for help, but no luck there either: it fails with the same error messages...
Philip.
Hi folks,
I've been trying to compile GPC on my NetBSD/sparc 1.5.2 system. Unfortunately it fails with a bunch of 'undefined reference' errors for calls to libc functions.
Here are a few snips of the output from make. If anyone could suggest a fix, I'd be very grateful.
bash-2.05$ uname -a NetBSD helios 1.5.2 NetBSD 1.5.2 (GENERIC) #0: Wed Aug 22 04:33:09 CST 2001 toor@proxima:/usr/src/sys/arch/sparc/compile/GENERIC sparc
bash-2.05$ make make all-recursive Making all in intl Making all in lib Making all in makeinfo gcc -DIN_GCC -DHAIFA -g -O2 -DHAVE_CONFIG_H -o cccp cccp.o cexp.o intl.o prefix.o version.o mbchar.o obstack.o ../libiberty/libiberty.a /usr/lib/crt0.o: In function `___start': /usr/lib/crt0.o(.text+0xf8): undefined reference to `main' cccp.o: In function `safe_read': /usr/tmp/gcc-2.95.2/gcc/cccp.c(.text+0x224): undefined reference to `_read'
<snip> Those look like standard underscore problem, some systems like all names with underscore prepended (a.out), other not (ELF). They have nothing to do with Pascal. I think (like other posters) that you just misconfigured GCC (or there is a bug in configure). You should first try to build GCC _without_ GPC. If nothing else helps, you should be able to find GCC build directory in system sources. Once GCC builds, you should have no problems with GPC.