[klibc] multiple definition of `_start' when using -ld with klcc
Jon Ringle
jon at ringle.org
Wed Jul 1 09:44:04 PDT 2009
On Wednesday 01 July 2009 00:00:04 H. Peter Anvin wrote:
> Jon Ringle wrote:
> > Hi,
> >
> > I am trying to setup an environment where I can build external projects
> > against klibc. It works - except if I have a program that links to libc.
> > Then I get a multiple definition of `_start' message. Here is a simple
> > test case.
> >
>
> You can't do that. It's as simple as that. Sorry.
I actually encountered this problem while trying to build udev-141 with klcc cross compiler targeting armeb. The problem came about when udev configure ran the following test from configure.ac:
AC_CHECK_LIB(c, inotify_init,
[AC_DEFINE([HAVE_INOTIFY], 1, [inotify available])],
[AC_MSG_WARN([inotify support disabled])])
This test should pass since inotify_init is available in klibc's libc.so, but fails with:
configure:11683: checking for inotify_init in -lc
configure:11718: klcc -o conftest -g -O2 conftest.c -lc >&5
/home/ringlej/WAVE/git/Platform/Volcano/os/ptxdist/isc/platform-ISC/sysroot-target/usr/lib/klibc/lib/libc.so: In function `_start':
bpabi.c:(.text+0x0): multiple definition of `_start'
/home/ringlej/WAVE/git/Platform/Volcano/os/ptxdist/isc/platform-ISC/sysroot-target/usr/lib/klibc/lib/crt0.o:(.text+0x0): first defined here
I worked around this by setting ac_cv_lib_c_inotify_init=yes in the environment.
Jon
More information about the klibc
mailing list