Skip to contentSkip to conversation

Fix compilation error

PATCH New alexey.skidanov at intel.com (Alexey Skidanov) 1 participant 4 messages Sep 14, 2018 Kselftest

lore
Share & tools
lore

alexey.skidanov at intel.com (Alexey Skidanov)

#0 lore raw

PATCH 1/1 Fix compilation error

ionmap_test compilation failed because there is no dma_buf.h on any of include paths. Moreover, it's better to use the dma_buf.h file of kernel under test and not the currently running one.

To fix this, add new target to the Makefile, installing Kernel headers for user space and direct compiler to look for dma_buf.h file there.

Signed-off-by Alexey Skidanov <alexey.skidanov at intel.com>
---
 tools/testing/selftests/android/ion/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/android/ion/Makefile +6 -2
index e036952..a4aac0e 100644
@@ -1,10 +1,14 @@
 
-INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
+INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../uapi/include
 CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
 
 TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
 
-all: $(TEST_GEN_FILES)
+all: usr_headers $(TEST_GEN_FILES)
+
+usr_headers:
+	cd ../../../../../
+	make headers_install INSTALL_HDR_PATH=./uapi
 
 $(TEST_GEN_FILES): ipcsocket.c ionutils.c
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 Fix compilation error

Quoted 7 lines · Alexey Skidanov

ionmap_test compilation failed because there is no dma_buf.h on any of include paths. Moreover, it's better to use the dma_buf.h file of kernel under test and not the currently running one.

To fix this, add new target to the Makefile, installing Kernel headers for user space and direct compiler to look for dma_buf.h file there.

This is what gpio has:

../../../../usr/include/linux/gpio.h:

         make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/

I'd like to be consistent with other selftests. Shuah, what's your opinion on the best way to get the headers?

Thanks,
Laura

Quoted 27 lines
Signed-off-by Alexey Skidanov <alexey.skidanov at intel.com>
---
  tools/testing/selftests/android/ion/Makefile | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/android/ion/Makefile +6 -2
index e036952..a4aac0e 100644
@@ -1,10 +1,14 @@
 
-INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
+INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../uapi/include
  CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
 
  TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
 
-all: $(TEST_GEN_FILES)
+all: usr_headers $(TEST_GEN_FILES)
+
+usr_headers:
+	cd ../../../../../
+	make headers_install INSTALL_HDR_PATH=./uapi
 
  $(TEST_GEN_FILES): ipcsocket.c ionutils.c
 
#2 lore raw

PATCH 1/1 Fix compilation error

Hello!

Quoted 10 lines · Laura Abbott
Quoted 7 lines · Alexey Skidanov

ionmap_test compilation failed because there is no dma_buf.h on any of include paths. Moreover, it's better to use the dma_buf.h file of kernel under test and not the currently running one.

To fix this, add new target to the Makefile, installing Kernel headers for user space and direct compiler to look for dma_buf.h file there.

Quoted 7 lines

This is what gpio has:

../../../../usr/include/linux/gpio.h:

         make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/

I'd like to be consistent with other selftests. Shuah, what's your opinion on the best way to get the headers?

Please consider Anders' patch, which is already in Shuah's next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=next&id=b2d35fa5fc80c27e868e393dcab4c94a0d71737f

Greetings!

Daniel Díaz
daniel.diaz at linaro.org

Quoted 31 lines

Thanks,
Laura

Quoted 27 lines
Signed-off-by Alexey Skidanov <alexey.skidanov at intel.com>
---
  tools/testing/selftests/android/ion/Makefile | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/android/ion/Makefile +6 -2
index e036952..a4aac0e 100644
@@ -1,10 +1,14 @@
 
-INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
+INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../uapi/include
  CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
 
  TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
 
-all: $(TEST_GEN_FILES)
+all: usr_headers $(TEST_GEN_FILES)
+
+usr_headers:
+     cd ../../../../../
+     make headers_install INSTALL_HDR_PATH=./uapi
 
  $(TEST_GEN_FILES): ipcsocket.c ionutils.c
 
#3 lore raw

PATCH 1/1 Fix compilation error

Quoted 21 lines · Daniel Díaz

Hello!

Quoted 10 lines · Laura Abbott
Quoted 7 lines · Alexey Skidanov

ionmap_test compilation failed because there is no dma_buf.h on any of include paths. Moreover, it's better to use the dma_buf.h file of kernel under test and not the currently running one.

To fix this, add new target to the Makefile, installing Kernel headers for user space and direct compiler to look for dma_buf.h file there.

Quoted 7 lines

This is what gpio has:

../../../../usr/include/linux/gpio.h:

         make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/

I'd like to be consistent with other selftests. Shuah, what's your opinion on the best way to get the headers?

Quoted 9 lines

Please consider Anders' patch, which is already in Shuah's next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=next&id=b2d35fa5fc80c27e868e393dcab4c94a0d71737f

Greetings!

Daniel Díaz
daniel.diaz at linaro.org

Looks like the issue is already resolved :)

Quoted 31 lines
Quoted 31 lines

Thanks,
Laura

Quoted 27 lines
Signed-off-by Alexey Skidanov <alexey.skidanov at intel.com>
---
  tools/testing/selftests/android/ion/Makefile | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/android/ion/Makefile +6 -2
index e036952..a4aac0e 100644
@@ -1,10 +1,14 @@
 
-INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
+INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../uapi/include
  CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
 
  TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
 
-all: $(TEST_GEN_FILES)
+all: usr_headers $(TEST_GEN_FILES)
+
+usr_headers:
+     cd ../../../../../
+     make headers_install INSTALL_HDR_PATH=./uapi
 
  $(TEST_GEN_FILES): ipcsocket.c ionutils.c