|
From: Julian S. <js...@ac...> - 2005-08-26 16:24:18
|
Greetings. I've been doing some hacking :-) aimed at getting rid
of all glibc dependencies (on the ASPACEM branch, if you want to see).
So, as of 1 minute ago, I have a statically linked valgrind_memcheck
that appears to work, and which depends on no glibc symbols.
How do I know? Because I've been linking with "-nodefaultlibs -lgcc",
which causes the linker to complain if any glibc-defined symbols are
used. So I've slowly been whittling these down to zero.
Ideally I'd like the build to use these flags, since it will cause
the build to fail in an obvious way if any glibc symbols creep back in.
However: I can't get it to link with "-nodefaultlibs -lgcc". The
invokation and results are shown below. Anybody have any idea what
I should do? The no-linking-glibc-world is one I know nothing about.
(For the curious: I replaced all glibc uses by our own implementations,
apart from three which are non-essential and hard to do:
localtime_r in VG_(ctime)
ptrace in m_debugger.c
fork in m_debugger.c.
If anyone has enthusiasm to hack up standalone replacements, especially
for localtime_r, please hack on!)
J
sewardj@feenicks:~/VgASPACEM/aspacem/memcheck$
(cd ../coregrind && make) \
&& gcc -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -m32 \
-mpreferred-stack-boundary=2 -O2 -Wno-long-long -o valgrind_memcheck \
-static ../coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=0xb0000000 \
-Wl,-T,../valt_load_address.lds mac_leakcheck.o \
mac_malloc_wrappers.o mc_main.o mac_shared.o mc_translate.o \
-nodefaultlibs -lgcc
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0xc): In function
`_start':
../sysdeps/i386/elf/start.S:109: undefined reference to `__libc_csu_fini'
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x11):../sysdeps/i386/elf/start.S:110:
undefined reference to `__libc_csu_init'
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x1d):../sysdeps/i386/elf/start.S:119:
undefined reference to `__libc_start_main'
collect2: ld returned 1 exit status
|