elf-helpers: make sure config.h is included first

Message ID 20230501202007.GA30201@altlinux.org
State New
Headers
Series elf-helpers: make sure config.h is included first |

Commit Message

Dmitry V. Levin May 1, 2023, 8:20 p.m. UTC
  Before this change, verify-elf used to complain on x86 and armv7:
verify-elf: ERROR: ./usr/lib/libabigail.so.2.0.0: uses non-LFS functions: open

Include config.h in abg-elf-helpers.cc before other headers so that
AC_SYS_LARGEFILE applies to this file.  This fully enables LFS
in those of 32-bit systems that do not enable it by default.

	* src/abg-elf-helpers.cc: Include "config.h" first.

Fixes: 7bd69830520f ("Make Front Ends first class citizens")
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
---
 src/abg-elf-helpers.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Dodji Seketeli May 11, 2023, 4:24 p.m. UTC | #1
Hello Dmitry,

"Dmitry V. Levin" <ldv@strace.io> a écrit:

> Before this change, verify-elf used to complain on x86 and armv7:
> verify-elf: ERROR: ./usr/lib/libabigail.so.2.0.0: uses non-LFS functions: open
>
> Include config.h in abg-elf-helpers.cc before other headers so that
> AC_SYS_LARGEFILE applies to this file.  This fully enables LFS
> in those of 32-bit systems that do not enable it by default.
>
> 	* src/abg-elf-helpers.cc: Include "config.h" first.
>
> Fixes: 7bd69830520f ("Make Front Ends first class citizens")
> Signed-off-by: Dmitry V. Levin <ldv@strace.io>

This looks good to me so I have applied to patch to the master branch
upstream.

Thanks a lot for your contribution.

[...]

Cheers,
  

Patch

diff --git a/src/abg-elf-helpers.cc b/src/abg-elf-helpers.cc
index d47c1c39..e05dccdc 100644
--- a/src/abg-elf-helpers.cc
+++ b/src/abg-elf-helpers.cc
@@ -6,6 +6,7 @@ 
 /// @file
 ///
 /// This contains the definitions of the ELF utilities for the dwarf reader.
+#include "config.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>