|
From: Konstantin S. <kon...@gm...> - 2009-12-29 10:55:06
Attachments:
valgrind_cxx_test.cc
cxx.patch
|
Hi Valgrind devs, First question: Valgrind installation contains include files, which makes me think that it is possible to build valgrind tools w/o having the valgrind sources. However, with the current version of valgrind, it does dot work: include/valgrind/pub_tool_basics.h includes "config.h", which is not a part of valgrind installation. Can that be fixed? Second question: Building valgrind tools requires passing quite unusual and system-dependent flags to gcc and ld. When building valgrind tools in the usual way, these flags are generated by automake/configure. Is there a simple way to guess these flags from the valgrind installation tree? Third question: Few of the valgrind public headers are not C++-able. Can that be fixed? Here is what I need to build my valgrind tool in C++. cxx.patch: the patch valgrind_cxx_test.cc: the test Linux: g++ -Itrunk/inst/include/valgrind -Itrunk -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -m32 valgrind_cxx_test.cc -c g++ -Itrunk/inst/include/valgrind -Itrunk -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -m64 valgrind_cxx_test.cc -c Mac g++ -Itrunk/inst/include/valgrind -Itrunk -DVGA_x86=1 -DVGO_darwin=1 -DVGP_x86_darwin=1 -m32 valgrind_cxx_test.cc -c If you build the test w/o the patch, you will see why the patch is required. Thanks and happy New Year! --kcc |
|
From: Bart V. A. <bar...@gm...> - 2009-12-29 15:19:48
|
On Tue, Dec 29, 2009 at 11:53 AM, Konstantin Serebryany <kon...@gm...> wrote: > First question: > Valgrind installation contains include files, which makes me think that it is possible to build valgrind tools w/o having the valgrind sources. > However, with the current version of valgrind, it does dot work: include/valgrind/pub_tool_basics.h includes "config.h", which is not a part of valgrind installation. > Can that be fixed? The header file "config.h" is included because the configure script figures out whether or not the selected compiler supports __builtin_expect() (HAVE_BUILTIN_EXPECT). Since gcc supports __builtin_expect() since at least gcc 3.0, and since we only support gcc 3.2 and above, it's probably safe to remove the #ifdef HAVE_BUILTIN_EXPECT and #include "config.h". > Third question: > Few of the valgrind public headers are not C++-able. > Can that be fixed? Should be fixed through r10970 and r10971. By the way, r10970 builds fine on Darwin and x86-64 but not on PPC. Bart. |
|
From: Stefan K. <en...@ho...> - 2009-12-29 17:06:51
|
Am 29.12.2009 17:19, schrieb Bart Van Assche: > On Tue, Dec 29, 2009 at 11:53 AM, Konstantin Serebryany > <kon...@gm...> wrote: >> First question: >> Valgrind installation contains include files, which makes me think that it is possible to build valgrind tools w/o having the valgrind sources. >> However, with the current version of valgrind, it does dot work: include/valgrind/pub_tool_basics.h includes "config.h", which is not a part of valgrind installation. >> Can that be fixed? > > The header file "config.h" is included because the configure script > figures out whether or not the selected compiler supports > __builtin_expect() (HAVE_BUILTIN_EXPECT). Since gcc supports > __builtin_expect() since at least gcc 3.0, and since we only support > gcc 3.2 and above, it's probably safe to remove the #ifdef > HAVE_BUILTIN_EXPECT and #include "config.h". If such case arises in the future again, its better to have a valgrind_onfig.h.in and let configure generate it. That generated file can be installed with the other includes. Atleast I have encountered this scheme in other software. Stefan > >> Third question: >> Few of the valgrind public headers are not C++-able. >> Can that be fixed? > > Should be fixed through r10970 and r10971. By the way, r10970 builds > fine on Darwin and x86-64 but not on PPC. > > Bart. > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: Konstantin S. <kon...@gm...> - 2009-12-29 15:38:17
|
On Tue, Dec 29, 2009 at 6:19 PM, Bart Van Assche <bar...@gm...>wrote: > On Tue, Dec 29, 2009 at 11:53 AM, Konstantin Serebryany > <kon...@gm...> wrote: > > First question: > > Valgrind installation contains include files, which makes me think that > it is possible to build valgrind tools w/o having the valgrind sources. > > However, with the current version of valgrind, it does dot > work: include/valgrind/pub_tool_basics.h includes "config.h", which is not a > part of valgrind installation. > > Can that be fixed? > > The header file "config.h" is included because the configure script > figures out whether or not the selected compiler supports > __builtin_expect() (HAVE_BUILTIN_EXPECT). Since gcc supports > __builtin_expect() since at least gcc 3.0, and since we only support > gcc 3.2 and above, it's probably safe to remove the #ifdef > HAVE_BUILTIN_EXPECT and #include "config.h". > That sounds good! > > > Third question: > > Few of the valgrind public headers are not C++-able. > > Can that be fixed? > > Should be fixed through r10970 and r10971. By the way, r10970 builds > fine on Darwin and x86-64 but not on PPC. > Yep, works! Thanks! --kcc > > Bart. > |
|
From: Konstantin S. <kon...@gm...> - 2009-12-30 08:20:49
|
Thanks Bart for the changes! However, there is still no way to build a sophisticated valgrind tool using just valgrind installation. 1. Some files are missing, at least valt_load_address_amd64_linux.lds and valt_load_address_x86_linux.lds 2. There is no way to guess the magic compiler flags, such as -Wl,-defsym,valt_load_address=0x38000000 -nodefaultlibs -nostartfiles -u _start or -Wl,-u,__start -Wl,-e,__start -Wl,-bind_at_load /usr/lib/dyld -arch i386 -Wl,-seg1addr,0xf0080000 -Wl,-stack_addr,0xf0080000 -Wl,-stack_size,0x80000 -Wl,-pagezero_size,0xf0000000 ? --kcc On Tue, Dec 29, 2009 at 6:37 PM, Konstantin Serebryany < kon...@gm...> wrote: > > > On Tue, Dec 29, 2009 at 6:19 PM, Bart Van Assche <bar...@gm... > > wrote: > >> On Tue, Dec 29, 2009 at 11:53 AM, Konstantin Serebryany >> <kon...@gm...> wrote: >> > First question: >> > Valgrind installation contains include files, which makes me think that >> it is possible to build valgrind tools w/o having the valgrind sources. >> > However, with the current version of valgrind, it does dot >> work: include/valgrind/pub_tool_basics.h includes "config.h", which is not a >> part of valgrind installation. >> > Can that be fixed? >> >> The header file "config.h" is included because the configure script >> figures out whether or not the selected compiler supports >> __builtin_expect() (HAVE_BUILTIN_EXPECT). Since gcc supports >> __builtin_expect() since at least gcc 3.0, and since we only support >> gcc 3.2 and above, it's probably safe to remove the #ifdef >> HAVE_BUILTIN_EXPECT and #include "config.h". >> > > That sounds good! > > >> >> > Third question: >> > Few of the valgrind public headers are not C++-able. >> > Can that be fixed? >> >> Should be fixed through r10970 and r10971. By the way, r10970 builds >> fine on Darwin and x86-64 but not on PPC. >> > > Yep, works! > > Thanks! > > --kcc > >> >> Bart. >> > > |
|
From: Bart V. A. <bar...@gm...> - 2009-12-30 09:57:26
|
On Wed, Dec 30, 2009 at 9:20 AM, Konstantin Serebryany <kon...@gm...> wrote: > Thanks Bart for the changes! > However, there is still no way to build a sophisticated valgrind tool using > just valgrind installation. > 1. Some files are missing, at least valt_load_address_amd64_linux.lds > and valt_load_address_x86_linux.lds > 2. There is no way to guess the magic compiler flags, such as > -Wl,-defsym,valt_load_address=0x38000000 -nodefaultlibs -nostartfiles -u > _start > or > -Wl,-u,__start -Wl,-e,__start -Wl,-bind_at_load /usr/lib/dyld -arch i386 > -Wl,-seg1addr,0xf0080000 -Wl,-stack_addr,0xf0080000 -Wl,-stack_size,0x80000 > -Wl,-pagezero_size,0xf0000000 > ? Other Valgrind authors are more familiar with the Valgrind build system than I am and are better placed to answer these questions. Bart. |