On Mon, 2016-01-11 at 14:22 +0000, Sudeep Holla wrote:
The selftests build fails or picks up wrong headers when cross-compiling
and build directory is different from source as the headers are referred
using the relative paths.
This patch use $INSTALL_HDR_PATH to fix the compilation. It also removes
installing the headers.
Cc: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
---
tools/testing/selftests/membarrier/Makefile | 2 +-
tools/testing/selftests/memfd/Makefile | 2 +-
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/vm/Makefile | 7 ++-----
4 files changed, 5 insertions(+), 8 deletions(-)
Hi,
When I was cross-compiling these tests for arm{32,64}, I faced issues.
With limited knowledge I have on this build system, I came up with this
patch. Please treat this as bug report if this approach makes no-sense
and suggest on how to fix it.
Yeah sorry that doesn't work.
If $(INSTALL_HDR_PATH) isn't defined you end up with:
gcc -Wall -I /include -o compaction_test compaction_test.c -lrt
^
Which is wrong.
INSTALL_HDR_PATH will not be defined when the tests are built standalone, ie.
like:
$ make -C tools/testing/selftests
This has been on my todo list to fix, but it doesn't actually bother me so I
haven't got around to it.
Does the patch below work for you? It uses INSTALL_HDR_PATH if it is defined,
or otherwise KERNEL_HEADERS if it is defined, or finally it guesses at
../../../usr/include (ie. the base of the source tree).