[RFC] configure: Fix detection of BTF header to enable the BTF front-end

Message ID 875xvf70va.fsf@redhat.com
State New
Headers
Series [RFC] configure: Fix detection of BTF header to enable the BTF front-end |

Commit Message

Dodji Seketeli May 15, 2024, 11:47 a.m. UTC
  Hello,

Cestmir Kalina reported that running configure with --enable-btf with
no BTF header present on the system wrongly leads to the BTF
front-end of libabigail being enabled, and later leads to
compilation/installation errors.

This patch fixes that by ensuring that the ENABLE_BTF variable set by
the --enable-btf option handling code is not reused later during
actual btf.h header file detection code.

	* configure.ac: Use a new HAS_BTF_HEADERS to store the detection
	status for the btf.h header.  Emit a better notice message when
	the BTF header file is found.

OK to apply to the mainline if it passes the CI tests?
Thanks.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Čestmír Kalina May 15, 2024, 1:15 p.m. UTC | #1
On Wed, May 15, 2024 at 01:47:37PM GMT, Dodji Seketeli wrote:
> Hello,
> 
> Cestmir Kalina reported that running configure with --enable-btf with
> no BTF header present on the system wrongly leads to the BTF
> front-end of libabigail being enabled, and later leads to
> compilation/installation errors.
> 
> This patch fixes that by ensuring that the ENABLE_BTF variable set by
> the --enable-btf option handling code is not reused later during
> actual btf.h header file detection code.
> 
> 	* configure.ac: Use a new HAS_BTF_HEADERS to store the detection
> 	status for the btf.h header.  Emit a better notice message when
> 	the BTF header file is found.
> 
> OK to apply to the mainline if it passes the CI tests?
> Thanks.

Tested-by: Cestmir Kalina <ckalina@redhat.com>

> 
> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
> ---
>  configure.ac | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index c6e1ad64..e118a9c0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -391,10 +391,10 @@ dnl configure BTF usage
>  BPF_LIBS=
>  if test x$ENABLE_BTF != xno; then
>    AC_CHECK_HEADER([bpf/btf.h],
> -		  [ENABLE_BTF=yes],
> +		  [HAS_BTF_HEADERS=yes],
>  		  [AC_MSG_NOTICE([could not find bpf/btf.h])])
> -  if test x$ENABLE_BTF = xyes; then
> -    AC_MSG_NOTICE([enable BTF support])
> +  if test x$HAS_BTF_HEADERS = xyes; then
> +    AC_MSG_NOTICE([found BTF header file so enabling BTF support])
>      ENABLE_BTF=yes
>      AC_DEFINE([WITH_BTF], 1,
>  	     [Defined if user enabled BTF usage])
> -- 
> 2.39.3
> 
> 
> -- 
> 		Dodji
>
  
Dodji Seketeli May 15, 2024, 1:23 p.m. UTC | #2
Čestmír Kalina <ckalina@redhat.com> writes:

> On Wed, May 15, 2024 at 01:47:37PM GMT, Dodji Seketeli wrote:
>> Hello,
>> 
>> Cestmir Kalina reported that running configure with --enable-btf with
>> no BTF header present on the system wrongly leads to the BTF
>> front-end of libabigail being enabled, and later leads to
>> compilation/installation errors.
>> 
>> This patch fixes that by ensuring that the ENABLE_BTF variable set by
>> the --enable-btf option handling code is not reused later during
>> actual btf.h header file detection code.
>> 
>> 	* configure.ac: Use a new HAS_BTF_HEADERS to store the detection
>> 	status for the btf.h header.  Emit a better notice message when
>> 	the BTF header file is found.
>> 
>> OK to apply to the mainline if it passes the CI tests?
>> Thanks.
>
> Tested-by: Cestmir Kalina <ckalina@redhat.com>

Thanks!  Incidentally, the CI build did pass.  So I have applied the
patch to the mainline.

Many thanks for taking the time to report the issue and for testing the
patch.

[...]

Cheers,
  

Patch

diff --git a/configure.ac b/configure.ac
index c6e1ad64..e118a9c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,10 +391,10 @@  dnl configure BTF usage
 BPF_LIBS=
 if test x$ENABLE_BTF != xno; then
   AC_CHECK_HEADER([bpf/btf.h],
-		  [ENABLE_BTF=yes],
+		  [HAS_BTF_HEADERS=yes],
 		  [AC_MSG_NOTICE([could not find bpf/btf.h])])
-  if test x$ENABLE_BTF = xyes; then
-    AC_MSG_NOTICE([enable BTF support])
+  if test x$HAS_BTF_HEADERS = xyes; then
+    AC_MSG_NOTICE([found BTF header file so enabling BTF support])
     ENABLE_BTF=yes
     AC_DEFINE([WITH_BTF], 1,
 	     [Defined if user enabled BTF usage])