[uClibc]undefined reference to syscall

Manuel Novoa III mjn3 at uclibc.org
Thu Jun 14 23:50:48 UTC 2001


This didn't make it to the list, so I'm reposting it.
-----------------------------------------------------

On Thu, Jun 14, 2001 at 10:12:08AM -0500, Mark Farver wrote:
> I'm a complete amateur at this so I apologize if this is a stupid
> question.
> 
> I'm trying to compile svgalib against uclibc.  Build and target are both
> i386.  I changed the CC= line in the svgalib makefile to:
> 
> CC = /usr/i386-linux-uclibc/bin/gcc -nostdinc -nostdlib \
>   -I /usr/i386-linux-uclibc/usr/include \
>   -L /usr/i386-linux-uclibc/usr/lib -L /usr/i386-linux-uclibc/lib

First, this is the hard way.  See the uClibc README file for the easy
way.  You don't need to change the Makefile.

> and the library appears to compile fine.  However when I try to compile
> one of SVGAlib small test apps I get an undefined reference to 'syscall'
> during linking.  It appears I'm missing a library, but I can't figure out
> which one.
> 
> /usr/i386-linux-uclibc/bin/gcc svgalibtest.c -lvga

In src/vgamisc.c, look for the function __svgalib_physmem(void).

Replace the line
	syscall(SYS_sysinfo, &si);
by
	sysinfo(&si);
and replace the includes directly above
 #include <syscall.h>
 #include <linux/kernel.h>
by
 #include <sys/sysinfo.h>

and try again.

Manuel






More information about the uClibc mailing list