Bug 155913 - Allow VPATH compilation (ie. where $builddir != $srcdir)
Summary: Allow VPATH compilation (ie. where $builddir != $srcdir)
Status: ASSIGNED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries All
: NOR minor
Target Milestone: ---
Assignee: Nicholas Nethercote
URL:
Keywords:
: 117322 162753 198027 198228 (view as bug list)
Depends on: 197794
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-16 15:27 UTC by Rainer Keller
Modified: 2023-01-19 08:49 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch allowing the build to work. (5.67 KB, patch)
2009-07-07 00:11 UTC, Ashley Pittman
Details
Patch allowing the build and regtests to work (85.50 KB, patch)
2009-08-31 22:25 UTC, Ashley Pittman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Keller 2008-01-16 15:27:50 UTC
When not compiling within the top_srcdir, the include-dirs are not set.

This fixes it:

pcglap12:/usr/src/valgrind-svn # svn diff Makefile.tool-flags.am
Index: Makefile.tool-flags.am
===================================================================
--- Makefile.tool-flags.am      (revision 7351)
+++ Makefile.tool-flags.am      (working copy)
@@ -1,34 +1,34 @@
-add_includes_x86_linux = -I$(top_srcdir)/include \
+add_includes_x86_linux = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_x86=1 \
                -DVGO_linux=1 \
                -DVGP_x86_linux=1

-add_includes_amd64_linux = -I$(top_srcdir)/include \
+add_includes_amd64_linux = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_amd64=1 \
                -DVGO_linux=1 \
                -DVGP_amd64_linux=1

-add_includes_ppc32_linux = -I$(top_srcdir)/include \
+add_includes_ppc32_linux = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_ppc32=1 \
                -DVGO_linux=1 \
                -DVGP_ppc32_linux=1

-add_includes_ppc64_linux = -I$(top_srcdir)/include \
+add_includes_ppc64_linux = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_ppc64=1 \
                -DVGO_linux=1 \
                -DVGP_ppc64_linux=1

-add_includes_ppc32_aix5 = -I$(top_srcdir)/include \
+add_includes_ppc32_aix5 = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_ppc32=1 \
                -DVGO_aix5=1 \
                -DVGP_ppc32_aix5=1

-add_includes_ppc64_aix5 = -I$(top_srcdir)/include \
+add_includes_ppc64_aix5 = -I$(top_srcdir) -I$(top_srcdir)/include \
                -I@VEX_DIR@/pub \
                -DVGA_ppc64=1 \
                -DVGO_aix5=1 \



With best regards,
Rainer
Comment 1 Nicholas Nethercote 2009-06-25 03:19:47 UTC
The patch in comment 1 is now out-of-date.

Here's the current status of this:

- Vex was recently incorporated properly in the build system, ie. it has a Makefile.am file now.  This is a good step.

- But Vex currently has several files with the same name in different directories, but that confuses automake.  I have a hack in the Vex Makefile.am that works around this (it involves copying files around), but it makes VPATH builds a total pain.  The plan is to rename the Vex files (bug 197794) once Julian has committed the DCAS branch to the trunk (bug 197793).

- After that, getting the regtests working out-of-tree is going to be the hard part.  This is important -- as long as the regtests don't work out-of-tree, the developers won't build out-of-tree.  And if the developers don't build out-of-tree, then out-of-tree builds are likely to get broken frequently.

- If the regtests can be made to work, then the nightly tests can be made to use out-of-tree builds, which will provide regular testing.
Comment 2 Nicholas Nethercote 2009-06-25 03:22:15 UTC
*** Bug 162753 has been marked as a duplicate of this bug. ***
Comment 3 Nicholas Nethercote 2009-06-29 06:26:13 UTC
*** Bug 198027 has been marked as a duplicate of this bug. ***
Comment 4 Nicholas Nethercote 2009-06-29 06:30:26 UTC
*** Bug 198228 has been marked as a duplicate of this bug. ***
Comment 5 Nicholas Nethercote 2009-07-01 09:13:12 UTC
*** Bug 117322 has been marked as a duplicate of this bug. ***
Comment 6 Nicholas Nethercote 2009-07-02 22:51:45 UTC
The vex renaming and DCAS merging have now been done.  Patches to fix this are welcome *if they allow the regtests to work*.  Run "make regtest" to run the test suite.
Comment 7 Ashley Pittman 2009-07-07 00:11:03 UTC
Created attachment 35106 [details]
Patch allowing the build to work.

This patch allows the build to work again, I can make, make install and run the resulting valgrind.

The regtests still need more work which I'm experimenting with now, in the meantime I thought this patch might be useful to someone.
Comment 8 Ashley Pittman 2009-08-31 22:25:52 UTC
Created attachment 36597 [details]
Patch allowing the build and regtests to work

Attached is a patch against head (r10880) to allow both VPATH building and the regtests to work.

A small number of tests fail in VPATH mode with this patch applied (mostly none/shell*) and it's possible I've not patched all the output filters for distros I don't have a test machine for, that aside VPATH functionality should be the same as normal.
Comment 9 Paul Floyd 2023-01-18 17:17:41 UTC
There was a recent change that fixed this.

I'll check this patch, but it's probably OK. I don't think that I tested make regtest out-of-source.
Comment 10 Paul Floyd 2023-01-19 08:49:15 UTC
If I do this

git clone
cd valgrind
./autogen.sh
mkdir build
cd build
../configure
make -j 8 && make -j 8 check

then it works up to there but

make regtest

gives errors

sh: .../valgrind/build/tests/platform_test: No such file or directory

and

-- Running  tests in memcheck/tests/linux ------------------------------
vg_regtest: `./filter_stderr' not found or not a file (.)
/bin/sh: line 3: tests/post_regtest_checks: No such file or directory
make: *** [Makefile:1399: regtest] Error 1