Bug 307729 - pkgconfig support broken valgrind.pc valt_load_address=@VALT_LOAD_ADDRESS@
Summary: pkgconfig support broken valgrind.pc valt_load_address=@VALT_LOAD_ADDRESS@
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-02 14:27 UTC by Mark Wielaard
Modified: 2012-10-04 20:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2012-10-02 14:27:38 UTC
valgrind comes with a pkgconfig file valgrind.pc. One of the values it defines is valt_load_address. This can be used to build valgrind tools "out of tree". The result of $(pkg-config --variable=valt_load_address valgrind) can be used as the value of -Ttext= when building a tool. Example makefile snippet:

VALT_LOAD_ADDRESS = $(shell pkg-config --variable=valt_load_address valgrind)
all: mytool

mytool: my_tool.o
	$(CC) -static -nodefaultlibs -nostartfiles -o $@ -u _start \
	      -Wl,--build-id=none,-Ttext=$(VALT_LOAD_ADDRESS) $< \
	      $(shell pkg-config --libs valgrind)

.c.o:
	$(CC) $(CFLAGS) -c $^

This is currently broken since VALT_LOAD_ADDRESS has been replaced by VALT_LOAD_ADDRESS_PRI. But valgrind.pc.in still contains:
valt_load_address=@VALT_LOAD_ADDRESS@

Simple fix:

Index: valgrind.pc.in
===================================================================
--- valgrind.pc.in	(revision 13016)
+++ valgrind.pc.in	(working copy)
@@ -5,7 +5,7 @@
 arch=@VGCONF_ARCH_PRI@
 os=@VGCONF_OS@
 platform=@VGCONF_ARCH_PRI@-@VGCONF_OS@
-valt_load_address=@VALT_LOAD_ADDRESS@
+valt_load_address=@VALT_LOAD_ADDRESS_PRI@
 
 Name: Valgrind
 Description: A dynamic binary instrumentation framework


This is also fedora bug #827219
https://bugzilla.redhat.com/show_bug.cgi?id=827219
Comment 1 Tom Hughes 2012-10-04 20:02:30 UTC
Committed as r13018.