|
From: <la...@ve...> - 2005-11-28 22:04:22
|
Dear Cool People, I am trying to compile Valgrind 3.1.0 on a hardened linux from scratch distribution. Kernel 2.6.11-12 GCC 3.4.4 LIBC 2.3.5 I have enabled stack protection (STACK GUARD) in the kernel as well as the libraries (LIBC ...) and I am having issues compiling valgrind. I have tried to compile WITH -fstack-protector-all -fpic -FPIC I have tried to compile WITHOUT -fno-stack-protector-all -no-pie ...and may other combinations. So my question is: Does valgrind work with stack guard protector enabled in LIBC? It would seem as if they both are competing for the same job except one is for debugging and the other is for protection. Either way is ok with me as I am just looking for some guidence on how to get compiled cleanly. Thank You for your Support. --kh Here is the short version of the errors. ------------------------------------ make[4]: Leaving directory `/root/valgrind-3.1.0/VEX' gcc -m32 -mpreferred-stack-boundary=2 -O -g -Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith-Wstrict-prototy pes -Wmissing-declarations -fno-stack-protector-all -Wno-long-long-Wdeclarat ion-after-statement -o memcheck-x86-linux -static -Wl,-defsym,valt_load_address=0xb0000000 -nodefau ltlibs -nostartfiles -u _start -m32 -Wl,-T,../valt_load_address_x86_linux.lds memcheck_x86_linux-mac_leakcheck.o memcheck_x86_linux-mac_malloc_wrappers.o memcheck_x86_linux-mc_main.o memcheck_x86_linux-mac_shared.o memcheck_x86_linux-mc_translate.o ../coregrind/libcoregrind_x86_linux.a ../VEX/libvex_x86_linux.a -lgcc /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libgcc.a(_udivdi3.oS): In function `__udivdi3': ../../gcc-3.4.4/gcc/libgcc2.c:1127: undefined reference to `__guard' ../../gcc-3.4.4/gcc/libgcc2.c:1129: undefined reference to `__stack_smash_handler' /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libgcc.a(_umoddi3.oS): In function `__umoddi3': ../../gcc-3.4.4/gcc/libgcc2.c:1115: undefined reference to `__guard' ../../gcc-3.4.4/gcc/libgcc2.c:1121: undefined reference to `__stack_smash_handler' collect2: ld returned 1 exit status make[3]: *** [memcheck-x86-linux] Error 1 make[3]: Leaving directory `/root/valgrind-3.1.0/memcheck' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/valgrind-3.1.0/memcheck' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/valgrind-3.1.0' make: *** [all] Error 2 |
|
From: Tom H. <to...@co...> - 2005-11-28 23:16:00
|
In message <IEE...@ve...>
<la...@ve...> wrote:
> Does valgrind work with stack guard protector enabled in LIBC? It would seem
> as if they both are competing for the same job except one is for debugging
> and the other is for protection.
We don't use libc in valgrind so it shouldn't matter to valgrind. Without
knowing how it works I can't say if it will work in a program run under
valgrind but it probably will.
> make[4]: Leaving directory `/root/valgrind-3.1.0/VEX'
> gcc -m32 -mpreferred-stack-boundary=2 -O -g
> -Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith-Wstrict-prototy
> pes -Wmissing-declarations -fno-stack-protector-all -Wno-long-long-Wdeclarat
> ion-after-statement -o
> memcheck-x86-linux -static -Wl,-defsym,valt_load_address=0xb0000000 -nodefau
> ltlibs -nostartfiles -u
> _start -m32 -Wl,-T,../valt_load_address_x86_linux.lds
> memcheck_x86_linux-mac_leakcheck.o
> memcheck_x86_linux-mac_malloc_wrappers.o
> memcheck_x86_linux-mc_main.o memcheck_x86_linux-mac_shared.o
> memcheck_x86_linux-mc_translate.o
> ../coregrind/libcoregrind_x86_linux.a
> ../VEX/libvex_x86_linux.a -lgcc
> /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libgcc.a(_udivdi3.oS): In
> function `__udivdi3':
> ../../gcc-3.4.4/gcc/libgcc2.c:1127: undefined reference to
> `__guard'
> ../../gcc-3.4.4/gcc/libgcc2.c:1129: undefined reference to
> `__stack_smash_handler'
Your libgcc has references to __guard and __stack_smash_handler
which are not being satisfied - what library are those routines in?
If they are in glibc then you have a problem as we deliberately do
not link with that. The code in libgcc is compiler support code and
should not really be relying on glibc.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|