Skip to contentSkip to conversation

cmake: make libbpf's Linux UAPI headers available to all binaries

PATCH Applied Andrii Nakryiko 3 participants 6 messages Oct 24, 2020 – Oct 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmake: make libbpf's Linux UAPI headers available to all binaries

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
CMakeLists.txt +3 -1
index 8e9fe4710a0c..84693514e0c8 100644
@@ -2,7 +2,9 @@ project(pahole C)
 cmake_minimum_required(VERSION 2.8.8)
 cmake_policy(SET CMP0005 NEW)
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
+		    ${CMAKE_CURRENT_SOURCE_DIR}
+		    ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
 
 # Try to parse this later, Helio just showed me a KDE4 example to support
 # x86-64 builds.
Signature · 1 line
2.24.1
#1 lore raw

Em Sat, Oct 24, 2020 at 11:36:53AM -0700, Andrii Nakryiko escreveu:

Quoted 4 lines

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

Thanks, applied.

- Arnaldo

Quoted 23 lines
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
CMakeLists.txt +3 -1
index 8e9fe4710a0c..84693514e0c8 100644
@@ -2,7 +2,9 @@ project(pahole C)
 cmake_minimum_required(VERSION 2.8.8)
 cmake_policy(SET CMP0005 NEW)
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
+		    ${CMAKE_CURRENT_SOURCE_DIR}
+		    ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
 
 # Try to parse this later, Helio just showed me a KDE4 example to support
 # x86-64 builds.
Signature · 1 line
2.24.1
Signature · 1 line
- Arnaldo
#2 lore raw
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Sat, Oct 24, 2020 at 11:36:53AM -0700, Andrii Nakryiko escreveu:

Quoted 4 lines

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

Thanks, applied.

Still don't see it at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/, did you forget to push? This is breaking libbpf and kernel CIs at the moment :(

Quoted 29 lines

- Arnaldo

Quoted 21 lines
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
CMakeLists.txt +3 -2
index 8e9fe4710a0c..84693514e0c8 100644
@@ -2,7 +2,9 @@ project(pahole C)
 cmake_minimum_required(VERSION 2.8.8)
 cmake_policy(SET CMP0005 NEW)
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
+                 ${CMAKE_CURRENT_SOURCE_DIR}
+                 ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
 
 # Try to parse this later, Helio just showed me a KDE4 example to support
 # x86-64 builds.
--
Quoted 2 lines

2.24.1

--

- Arnaldo

#3 lore raw

Em Mon, Oct 26, 2020 at 04:26:22PM -0700, Andrii Nakryiko escreveu:

Quoted 9 lines
Quoted 7 lines · Arnaldo Carvalho de Melo

Em Sat, Oct 24, 2020 at 11:36:53AM -0700, Andrii Nakryiko escreveu:

Quoted 4 lines

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

Quoted 7 lines
Quoted 2 lines

Thanks, applied.

Still don't see it at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/, did you forget to push? This is breaking libbpf and kernel CIs at the moment :(

That got delayed due to that 'void variable found' bug that Hao fixed, I just tested built a kernel with it, rebooting with it, some more testing and it'll go to the public repo,

- Arnaldo

Quoted 29 lines
Quoted 29 lines

- Arnaldo

Quoted 21 lines
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
CMakeLists.txt +3 -2
index 8e9fe4710a0c..84693514e0c8 100644
@@ -2,7 +2,9 @@ project(pahole C)
 cmake_minimum_required(VERSION 2.8.8)
 cmake_policy(SET CMP0005 NEW)
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
+                 ${CMAKE_CURRENT_SOURCE_DIR}
+                 ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
 
 # Try to parse this later, Helio just showed me a KDE4 example to support
 # x86-64 builds.
--
Quoted 2 lines

2.24.1

--

- Arnaldo

Signature · 1 line
- Arnaldo
#4 lore raw

Em Tue, Oct 27, 2020 at 08:20:50AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 13 lines

Em Mon, Oct 26, 2020 at 04:26:22PM -0700, Andrii Nakryiko escreveu:

Quoted 12 lines
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Sat, Oct 24, 2020 at 11:36:53AM -0700, Andrii Nakryiko escreveu:

Quoted 4 lines

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

Thanks, applied.

Quoted 8 lines
Quoted 4 lines

Still don't see it at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/, did you forget to push? This is breaking libbpf and kernel CIs at the moment :(

That got delayed due to that 'void variable found' bug that Hao fixed, I just tested built a kernel with it, rebooting with it, some more testing and it'll go to the public repo,

Rebooted, tested usage of /sys/kernel/btf/vmlinux, pushed to the main git.kernel.org and to the mirror at github.

Thanks, please let me know if now everything is ok with the kernel CIs.

- Arnaldo

#5 lore raw
Quoted 20 lines · Arnaldo Carvalho de Melo

Em Tue, Oct 27, 2020 at 08:20:50AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 18 lines

Em Mon, Oct 26, 2020 at 04:26:22PM -0700, Andrii Nakryiko escreveu:

Quoted 16 lines
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Sat, Oct 24, 2020 at 11:36:53AM -0700, Andrii Nakryiko escreveu:

Quoted 4 lines

Now that libbpf is used to implement deduplicated strings container, all of the binaries will need linux/btf.h header to compile properly. libbpf is distributed with its own copies of Linux UAPI headers, so use them during compilation.

Thanks, applied.

Still don't see it at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/, did you forget to push? This is breaking libbpf and kernel CIs at the moment :(

Quoted 8 lines
Quoted 3 lines

That got delayed due to that 'void variable found' bug that Hao fixed, I just tested built a kernel with it, rebooting with it, some more testing and it'll go to the public repo,

Rebooted, tested usage of /sys/kernel/btf/vmlinux, pushed to the main git.kernel.org and to the mirror at github.

Thanks, please let me know if now everything is ok with the kernel CIs.

Thanks, Arnaldo! All good now.

Quoted 2 lines

- Arnaldo