|
From: Josef W. <Jos...@gm...> - 2004-11-18 09:19:56
|
Hi,
yesterday I again looked at compiling callgrind with current CVS. And I found
a problem with valgrind.pc.in. Recently, on my request the last line was
changed from
Cflags: -I${includedir}
to
Cflags: -I${includedir} -I${includedir}/@VG_ARCH@ -I${includedir}/@VG_
PLATFORM@
Unfortunately, this is wrong: With PREFIX=/usr/local, ${includedir} gets
/usr/local/include. Thus, for VG<2.3, a tool using
CFLAGS=`pkg-config valgrind --cflags`
has to
#include <valgrind/tool.h>
tool.h wants to include "tool_arch.h", which is to be found in the
valgrind/x86/ subdir. But the change in valgrind.pc results in
-I/usr/local/include -I/usr/local/include/x86 ...
Thus, /usr/local/include/valgrind/x86 is never checked.
We simply could change the include path base in valgrind.pc.in (line4) into
includedir=@includedir@/valgrind
leading to correct paths for CFLAGS. But this is a source incompatible change
for external tools which used valgrind.pc before. I don't know if there are
such tools, and I never used it, but I could not use valgrind.pc in future
callgrind releases which also want to compile with VG<2.3 (or I do a version
check before).
OTOH, I have no idea how to solve this in another way without putting all
header files into one directory. What was the problem here?
Should one installation of valgrind be able to support more than one
architecture/platform in the future? But then, valgrind.pc is wrong again.
I assume multiple parallel valgrind installations (e.g. i386 and x86_64 for an
Opteron machine) would go into different prefixes, leading to different
include paths (e.g. /usr/local/include32/ ?). Thus, putting all headers
together seems to be no problem.
BTW: tool.h now also needs vki.h, which is never installed.
Josef
PS: In a recent mail, I wrote that I had problems with VG 2.2.0 and Suse 9.2.
In HEAD and VALGRIND_2_2_BRANCH, this is solved. Is it time for a VG 2.2.1 ?
|
|
From: Nicholas N. <nj...@ca...> - 2004-11-18 10:58:35
|
On Thu, 18 Nov 2004, Josef Weidendorfer wrote: > We simply could change the include path base in valgrind.pc.in (line4) into > includedir=@includedir@/valgrind > leading to correct paths for CFLAGS. But this is a source incompatible change > for external tools which used valgrind.pc before. I don't know if there are > such tools, and I never used it, I think it's safe to assume that Callgrind is the only external tool worth worrying about, I'm not aware of any others that are publically distributed. > but I could not use valgrind.pc in future > callgrind releases which also want to compile with VG<2.3 (or I do a version > check before). Perhaps the version check is best? It seems like changing the include path base in valgrind.pc.in is the right thing to do. If you are happy with that, let me know, and I will change valgrind.pc.in. > BTW: tool.h now also needs vki.h, which is never installed. Hmm, any idea why? include/linux/Makefile.am has an "incincdir" line, just like the other Makefile.am files... N |
|
From: Josef W. <Jos...@gm...> - 2004-11-18 12:43:51
|
On Thursday 18 November 2004 11:58, you wrote:
> On Thu, 18 Nov 2004, Josef Weidendorfer wrote:
> > We simply could change the include path base in valgrind.pc.in (line4)
> > into includedir=@includedir@/valgrind
> > leading to correct paths for CFLAGS. But this is a source incompatible
> > change for external tools which used valgrind.pc before. I don't know if
> > there are such tools, and I never used it,
>
> I think it's safe to assume that Callgrind is the only external tool worth
> worrying about, I'm not aware of any others that are publically
> distributed.
> Perhaps the version check is best? It seems like changing the include
> path base in valgrind.pc.in is the right thing to do. If you are happy
Yes.
> with that, let me know, and I will change valgrind.pc.in.
Ok, as tool.h directly includes other VG headers, $PREFIX/include/valgrind has
to be in the include path. So yes, please change line 4 in valgrind.pc.in to
includedir=@includedir@/valgrind
> > BTW: tool.h now also needs vki.h, which is never installed.
>
> Hmm, any idea why? include/linux/Makefile.am has an "incincdir" line,
> just like the other Makefile.am files...
I was wrong. But the path was missing in valgrind.pc.in.
Please also change the CFLAGS line in valgrind.pc.in to include VG_OS:
Cflags: -I${includedir} -I${includedir}/@VG_ARCH@ -I${includedir}/@VG_
PLATFORM@ -I${includedir}/@VG_OS@
Hmm. The Cflags line in valgrind.pc.in is for CFLAGS to use for VG tool
compilation. Perhaps it makes sense to also add
Cflags: ... @ARCH_TOOL_AM_CFLAGS@
And could you please increment VG_CORE_INTERFACE_MAJOR_VERSION to 7?
The compiler complains about changed prototypes (e.g. UInt* => UWord*).
Thanks,
Josef
>
> N
|
|
From: Nicholas N. <nj...@ca...> - 2004-11-18 13:00:29
|
Josef, I've committed all those changes. Let me know if I've missed anything. N |