[v2,02/16] move platform depended include into system.h of libebl

Message ID 20221217165213.152-3-luoyonggang@gmail.com
State Rejected
Headers
Series Patches for building with mingw/gcc msvc/clang-cl |

Commit Message

Yonggang Luo Dec. 17, 2022, 4:51 p.m. UTC
  Because all source in libebl #include <libeblP.h>, so #include <system.h> in
libeblP.h is enough, there is multiple memory-access.h file, so use relative path to
include it properly,

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com
---
 libebl/eblauxvinfo.c        | 2 --
 libebl/eblcorenote.c        | 2 --
 libebl/ebldynamictagname.c  | 1 -
 libebl/eblobjnote.c         | 8 ++++----
 libebl/eblobjnotetypename.c | 2 --
 libebl/eblopenbackend.c     | 1 -
 libebl/libeblP.h            | 1 +
 7 files changed, 5 insertions(+), 12 deletions(-)
  

Comments

Mark Wielaard Feb. 23, 2023, 10:44 a.m. UTC | #1
Hi,

On Sun, 2022-12-18 at 00:51 +0800, Yonggang Luo via Elfutils-devel
wrote:
> Because all source in libebl #include <libeblP.h>, so #include <system.h> in
> libeblP.h is enough, there is multiple memory-access.h file, so use relative path to
> include it properly,

See the discussion around v1 of this patch:
https://inbox.sourceware.org/elfutils-devel/19dc6579ce183b63a8956b17611e4a264d745b34.camel@klomp.org/

I have since pushed:

commit 6ecd16410ce1fe5cb0ac5b7c3342c5cc330e3a04
Author: Mark Wielaard <mark@klomp.org>
Date:   Tue Dec 20 14:53:43 2022 +0100

    Do not use relative include paths in library files.
    
    Rely on include dirs being set up correctly. Setup libdw AM_CPPFLAGS
    to include libebl directory. In libdwfl note that debuginfod.h is a
    generated file in the builddir. Only include it in the one file
    debuginfod-client.c that really needs it.
    
    Signed-off-by: Mark Wielaard <mark@klomp.org>

Please adjust your patch accordingly.

Thanks,

Mark
  

Patch

diff --git a/libebl/eblauxvinfo.c b/libebl/eblauxvinfo.c
index ce1141b8..186b8c07 100644
--- a/libebl/eblauxvinfo.c
+++ b/libebl/eblauxvinfo.c
@@ -31,8 +31,6 @@ 
 #endif
 
 #include <assert.h>
-#include <byteswap.h>
-#include <endian.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stddef.h>
diff --git a/libebl/eblcorenote.c b/libebl/eblcorenote.c
index 7fab3974..3d4c8a92 100644
--- a/libebl/eblcorenote.c
+++ b/libebl/eblcorenote.c
@@ -31,8 +31,6 @@ 
 #endif
 
 #include <assert.h>
-#include <byteswap.h>
-#include <endian.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stddef.h>
diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c
index 5d4a3a58..7a430f49 100644
--- a/libebl/ebldynamictagname.c
+++ b/libebl/ebldynamictagname.c
@@ -34,7 +34,6 @@ 
 #include <inttypes.h>
 #include <stdio.h>
 #include <libeblP.h>
-#include "system.h"
 
 
 const char *
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
index 5a7c5c62..0bb56c02 100644
--- a/libebl/eblobjnote.c
+++ b/libebl/eblobjnote.c
@@ -37,10 +37,10 @@ 
 #include <string.h>
 #include <libeblP.h>
 
-#include "common.h"
-#include "libelfP.h"
-#include "libdwP.h"
-#include "memory-access.h"
+#include "../libelf/common.h"
+#include "../libelf/libelfP.h"
+#include "../libdw/libdwP.h"
+#include "../libdw/memory-access.h"
 
 
 void
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
index 473a1f2f..2ee1b228 100644
--- a/libebl/eblobjnotetypename.c
+++ b/libebl/eblobjnotetypename.c
@@ -31,8 +31,6 @@ 
 # include <config.h>
 #endif
 
-#include <system.h>
-
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 02f80653..6e884ea0 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -37,7 +37,6 @@ 
 #include <string.h>
 #include <stdio.h>
 
-#include <system.h>
 #include <libeblP.h>
 
 Ebl *i386_init (Elf *, GElf_Half, Ebl *);
diff --git a/libebl/libeblP.h b/libebl/libeblP.h
index c408ed97..9dfd60de 100644
--- a/libebl/libeblP.h
+++ b/libebl/libeblP.h
@@ -33,6 +33,7 @@ 
 #include <libasm.h>
 #include <libebl.h>
 
+#include <system.h>
 
 /* Backend handle.  */
 struct ebl