public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Yonggang Luo <luoyonggang@gmail.com>
To: elfutils-devel@sourceware.org
Cc: Yonggang Luo <luoyonggang@gmail.com>
Subject: [PATCH 07/25] move platform depended include into system.h of libasm, libcpu, libdw, libdwfl and libdwelf
Date: Fri, 21 Oct 2022 02:25:46 +0800	[thread overview]
Message-ID: <20221020182603.815-8-luoyonggang@gmail.com> (raw)
In-Reply-To: <20221020182603.815-1-luoyonggang@gmail.com>

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 lib/color.c                            | 1 -
 libasm/asm_abort.c                     | 1 -
 libasm/asm_addint8.c                   | 2 --
 libasm/asm_begin.c                     | 2 --
 libasm/asm_end.c                       | 2 --
 libasm/libasmP.h                       | 3 +++
 libcpu/i386_disasm.c                   | 1 -
 libcpu/memory-access.h                 | 3 +--
 libdw/dwarf_begin_elf.c                | 2 --
 libdw/dwarf_end.c                      | 1 -
 libdw/dwarf_setalt.c                   | 2 --
 libdw/libdw_find_split_unit.c          | 1 -
 libdwelf/dwelf_elf_begin.c             | 2 --
 libdwelf/dwelf_strtab.c                | 1 -
 libdwfl/argp-std.c                     | 1 -
 libdwfl/core-file.c                    | 6 ------
 libdwfl/dwfl_build_id_find_debuginfo.c | 2 --
 libdwfl/dwfl_build_id_find_elf.c       | 1 -
 libdwfl/dwfl_end.c                     | 1 -
 libdwfl/dwfl_frame.c                   | 1 -
 libdwfl/dwfl_module.c                  | 1 -
 libdwfl/dwfl_module_getdwarf.c         | 1 -
 libdwfl/dwfl_report_elf.c              | 2 --
 libdwfl/dwfl_segment_report_module.c   | 2 --
 libdwfl/find-debuginfo.c               | 1 -
 libdwfl/gzip.c                         | 2 --
 libdwfl/image-header.c                 | 4 ----
 libdwfl/link_map.c                     | 2 --
 libdwfl/linux-pid-attach.c             | 1 -
 libdwfl/offline.c                      | 1 -
 libdwfl/open.c                         | 2 --
 31 files changed, 4 insertions(+), 51 deletions(-)

diff --git a/lib/color.c b/lib/color.c
index bd105ec2..8063dc26 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -34,7 +34,6 @@
 #include <argp.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include "system.h"
 #include "libeu.h"
 #include "color.h"
diff --git a/libasm/asm_abort.c b/libasm/asm_abort.c
index 12743dc6..696298c4 100644
--- a/libasm/asm_abort.c
+++ b/libasm/asm_abort.c
@@ -32,7 +32,6 @@
 #endif
 
 #include <stdlib.h>
-#include <unistd.h>
 
 #include <libasmP.h>
 #include <libelf.h>
diff --git a/libasm/asm_addint8.c b/libasm/asm_addint8.c
index bb7d40f2..7f823e09 100644
--- a/libasm/asm_addint8.c
+++ b/libasm/asm_addint8.c
@@ -31,8 +31,6 @@
 # include <config.h>
 #endif
 
-#include <byteswap.h>
-#include <endian.h>
 #include <inttypes.h>
 #include <string.h>
 
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index a190202c..9e4dfe43 100644
--- a/libasm/asm_begin.c
+++ b/libasm/asm_begin.c
@@ -37,11 +37,9 @@
 #include <stdio_ext.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 #include <gelf.h>
 #include "libasmP.h"
-#include <system.h>
 
 
 static AsmCtx_t *
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index a26120f2..c06d2366 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -35,12 +35,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/stat.h>
 
 #include <libasmP.h>
 #include <libelf.h>
-#include <system.h>
 
 
 static int
diff --git a/libasm/libasmP.h b/libasm/libasmP.h
index 5b5fb776..11f42511 100644
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -32,6 +32,9 @@
 #include <stdio.h>
 
 #include <libasm.h>
+
+#include <system.h>
+
 #include "libebl.h"
 
 #include "libdwelf.h"
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 40475b81..599d1654 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -34,7 +34,6 @@
 #include <assert.h>
 #include <config.h>
 #include <ctype.h>
-#include <endian.h>
 #include <errno.h>
 #include <gelf.h>
 #include <stddef.h>
diff --git a/libcpu/memory-access.h b/libcpu/memory-access.h
index 3b6ca19b..6e92fc5b 100644
--- a/libcpu/memory-access.h
+++ b/libcpu/memory-access.h
@@ -29,11 +29,10 @@
 #ifndef _MEMORY_ACCESS_H
 #define _MEMORY_ACCESS_H 1
 
-#include <byteswap.h>
-#include <endian.h>
 #include <limits.h>
 #include <stdint.h>
 
+#include <system.h>
 
 /* When loading this file we require the macro MACHINE_ENCODING to be
    defined to signal the endianness of the architecture which is
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index a48dada6..8fcef335 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -38,11 +38,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <endian.h>
 
 #include "libelfP.h"
 #include "libdwP.h"
diff --git a/libdw/dwarf_end.c b/libdw/dwarf_end.c
index 77f537a7..8dd075cf 100644
--- a/libdw/dwarf_end.c
+++ b/libdw/dwarf_end.c
@@ -35,7 +35,6 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "libdwP.h"
 #include "cfi.h"
diff --git a/libdw/dwarf_setalt.c b/libdw/dwarf_setalt.c
index 9051b8e0..dc9b61cb 100644
--- a/libdw/dwarf_setalt.c
+++ b/libdw/dwarf_setalt.c
@@ -32,8 +32,6 @@
 
 #include "libdwP.h"
 
-#include <unistd.h>
-
 void
 dwarf_setalt (Dwarf *main, Dwarf *alt)
 {
diff --git a/libdw/libdw_find_split_unit.c b/libdw/libdw_find_split_unit.c
index da039e50..a22e7bc9 100644
--- a/libdw/libdw_find_split_unit.c
+++ b/libdw/libdw_find_split_unit.c
@@ -40,7 +40,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <unistd.h>
 
 void
 try_split_file (Dwarf_CU *cu, const char *dwo_path)
diff --git a/libdwelf/dwelf_elf_begin.c b/libdwelf/dwelf_elf_begin.c
index c3cfe633..17a90fc9 100644
--- a/libdwelf/dwelf_elf_begin.c
+++ b/libdwelf/dwelf_elf_begin.c
@@ -34,8 +34,6 @@
 #include "libdwflP.h"
 #include "libelfP.h"
 
-#include <unistd.h>
-
 NEW_VERSION (dwelf_elf_begin, ELFUTILS_0.177)
 Elf *
 dwelf_elf_begin (int fd)
diff --git a/libdwelf/dwelf_strtab.c b/libdwelf/dwelf_strtab.c
index 5ec8c295..c95f9467 100644
--- a/libdwelf/dwelf_strtab.c
+++ b/libdwelf/dwelf_strtab.c
@@ -37,7 +37,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "libdwelfP.h"
 #include <system.h>
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index bc013aa0..1605fbfe 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -35,7 +35,6 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <fcntl.h>
-#include <unistd.h>
 
 
 #define OPT_DEBUGINFO	0x100
diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
index 4418ef33..cd9b4f38 100644
--- a/libdwfl/core-file.c
+++ b/libdwfl/core-file.c
@@ -33,12 +33,6 @@
 #include "libdwflP.h"
 #include <gelf.h>
 
-#include <unistd.h>
-#include <endian.h>
-#include <byteswap.h>
-#include "system.h"
-
-
 /* On failure return, we update *NEXT to point back at OFFSET.  */
 static inline Elf *
 do_fail (int error, off_t *next, off_t offset)
diff --git a/libdwfl/dwfl_build_id_find_debuginfo.c b/libdwfl/dwfl_build_id_find_debuginfo.c
index 273e5e5f..856f2312 100644
--- a/libdwfl/dwfl_build_id_find_debuginfo.c
+++ b/libdwfl/dwfl_build_id_find_debuginfo.c
@@ -31,8 +31,6 @@
 #endif
 
 #include "libdwflP.h"
-#include <unistd.h>
-
 
 int
 dwfl_build_id_find_debuginfo (Dwfl_Module *mod,
diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
index 7b604d47..35bc8c9e 100644
--- a/libdwfl/dwfl_build_id_find_elf.c
+++ b/libdwfl/dwfl_build_id_find_elf.c
@@ -33,7 +33,6 @@
 #include "libdwflP.h"
 #include <inttypes.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include "system.h"
 
 
diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c
index b1840191..a1812407 100644
--- a/libdwfl/dwfl_end.c
+++ b/libdwfl/dwfl_end.c
@@ -31,7 +31,6 @@
 #endif
 
 #include "libdwflP.h"
-#include <unistd.h>
 
 void
 dwfl_end (Dwfl *dwfl)
diff --git a/libdwfl/dwfl_frame.c b/libdwfl/dwfl_frame.c
index 77e0c5cb..5ee71dd4 100644
--- a/libdwfl/dwfl_frame.c
+++ b/libdwfl/dwfl_frame.c
@@ -33,7 +33,6 @@
 #include <system.h>
 
 #include "libdwflP.h"
-#include <unistd.h>
 
 /* Set STATE->pc_set from STATE->regs according to the backend.  Return true on
    success, false on error.  */
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index e7dfdace..4fbff33e 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -33,7 +33,6 @@
 #include "libdwflP.h"
 #include "../libdw/cfi.h"
 #include <search.h>
-#include <unistd.h>
 
 static void
 free_cu (struct dwfl_cu *cu)
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index 6f076057..498c7cd2 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -34,7 +34,6 @@
 #include <inttypes.h>
 #include <fcntl.h>
 #include <string.h>
-#include <unistd.h>
 #include "../libdw/libdwP.h"	/* DWARF_E_* values are here.  */
 #include "../libelf/libelfP.h"
 #include "system.h"
diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
index a5f0e5e5..581f4079 100644
--- a/libdwfl/dwfl_report_elf.c
+++ b/libdwfl/dwfl_report_elf.c
@@ -32,8 +32,6 @@
 
 #include "libdwflP.h"
 #include <fcntl.h>
-#include <unistd.h>
-
 
 /* We start every ET_REL module at a moderately aligned boundary.
    This keeps the low addresses easy to read compared to a layout
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
index 28f87f10..287fc002 100644
--- a/libdwfl/dwfl_segment_report_module.c
+++ b/libdwfl/dwfl_segment_report_module.c
@@ -36,8 +36,6 @@
 #include <elf.h>
 #include <gelf.h>
 #include <inttypes.h>
-#include <endian.h>
-#include <unistd.h>
 #include <fcntl.h>
 
 #include <system.h>
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index 449df5a1..7f7ab632 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -33,7 +33,6 @@
 #include "libdwflP.h"
 #include <stdio.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include <sys/stat.h>
 #include "system.h"
 
diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c
index ba8ecfba..53013be3 100644
--- a/libdwfl/gzip.c
+++ b/libdwfl/gzip.c
@@ -33,8 +33,6 @@
 #include "libdwflP.h"
 #include "system.h"
 
-#include <unistd.h>
-
 #ifdef LZMA
 # define USE_INFLATE	1
 # include <lzma.h>
diff --git a/libdwfl/image-header.c b/libdwfl/image-header.c
index f906068a..c777cc84 100644
--- a/libdwfl/image-header.c
+++ b/libdwfl/image-header.c
@@ -32,10 +32,6 @@
 #endif
 
 #include "libdwflP.h"
-#include "system.h"
-
-#include <unistd.h>
-#include <endian.h>
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 # define LE16(x)	(x)
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index c0207cd3..7ec7eca1 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -32,8 +32,6 @@
 #include "../libdw/memory-access.h"
 #include "system.h"
 
-#include <byteswap.h>
-#include <endian.h>
 #include <fcntl.h>
 
 /* This element is always provided and always has a constant value.
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
index 09cba07b..de867857 100644
--- a/libdwfl/linux-pid-attach.c
+++ b/libdwfl/linux-pid-attach.c
@@ -38,7 +38,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <dirent.h>
-#include <unistd.h>
 
 #ifdef __linux__
 
diff --git a/libdwfl/offline.c b/libdwfl/offline.c
index 499663e3..e090b42b 100644
--- a/libdwfl/offline.c
+++ b/libdwfl/offline.c
@@ -34,7 +34,6 @@
 
 #include "libdwflP.h"
 #include <fcntl.h>
-#include <unistd.h>
 
 /* Since dwfl_report_elf lays out the sections already, this will only be
    called when the section headers of the debuginfo file are being
diff --git a/libdwfl/open.c b/libdwfl/open.c
index da8b59a3..68b755cd 100644
--- a/libdwfl/open.c
+++ b/libdwfl/open.c
@@ -35,8 +35,6 @@
 #undef	_
 #include "libdwflP.h"
 
-#include <unistd.h>
-
 #if !USE_BZLIB
 # define __libdw_bunzip2(...)	DWFL_E_BADELF
 #endif
-- 
2.36.1.windows.1


  parent reply	other threads:[~2022-10-20 18:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 18:25 [PATCH 00/25] Patches for building with mingw/gcc msvc/clang-cl Yonggang Luo
2022-10-20 18:25 ` [PATCH 01/25] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec' Yonggang Luo
2022-10-27 13:02   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 02/25] ignore build directory Yonggang Luo
2022-10-27 13:03   ` Mark Wielaard
2022-12-16 21:14     ` 罗勇刚(Yonggang Luo)
2022-12-20 12:35       ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 03/25] libebl: There is no need #include <dlfcn.h> in eblclosebackend.c and eblopenbackend.c Yonggang Luo
2022-10-27 13:09   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 04/25] libelf/libdwfl: Remove "#define LIB_SYSTEM_H 1" in libelf_crc32.c and libdwfl_crc32.c Yonggang Luo
2022-10-27 13:20   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 05/25] use #include <system.h> instead platform depended header <endian.h> in libdw/memory-access.h Yonggang Luo
2022-10-27 13:26   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 06/25] move platform depended include into system.h of libebl Yonggang Luo
2022-10-28 11:35   ` Mark Wielaard
2022-12-16 21:19     ` 罗勇刚(Yonggang Luo)
2022-12-20 13:59       ` Mark Wielaard
2022-12-20 17:44         ` Mark Wielaard
2022-10-20 18:25 ` Yonggang Luo [this message]
2022-10-28 12:07   ` [PATCH 07/25] move platform depended include into system.h of libasm, libcpu, libdw, libdwfl and libdwelf Mark Wielaard
2022-10-20 18:25 ` [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h Yonggang Luo
2022-10-28 11:41   ` Mark Wielaard
2022-12-16 21:21     ` 罗勇刚(Yonggang Luo)
2022-12-20 14:04       ` Mark Wielaard
2022-12-20 16:30         ` 罗勇刚(Yonggang Luo)
2022-12-21 16:54           ` Mark Wielaard
2022-12-22  3:50             ` 罗勇刚(Yonggang Luo)
2022-10-20 18:25 ` [PATCH 09/25] include libgen.h in system.h Yonggang Luo
2022-10-28 11:45   ` Mark Wielaard
2022-12-16 21:22     ` 罗勇刚(Yonggang Luo)
2022-12-16 21:34       ` 罗勇刚(Yonggang Luo)
2022-12-20 15:05       ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 10/25] libcpu: Remove the need of NMNES by using enum Yonggang Luo
2022-12-12 12:37   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 11/25] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc Yonggang Luo
2022-12-12 12:42   ` Mark Wielaard
2022-12-16 21:36     ` 罗勇刚(Yonggang Luo)
2022-10-20 18:25 ` [PATCH 12/25] libcpu: Use "#define FCT_mod$64r_m FCT_mod$r_m" is enough and can be recognized by clang-cl on windows in i386_data.h Yonggang Luo
2022-12-12 12:58   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 13/25] libdw: typeof -> __typeof that can be recognized by both clang-cl and gcc Yonggang Luo
2022-12-12 13:12   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header Yonggang Luo
2022-12-12 13:31   ` Mark Wielaard
2022-12-16 21:47     ` 罗勇刚(Yonggang Luo)
2022-12-20 15:08       ` Mark Wielaard
2022-12-20 16:31         ` 罗勇刚(Yonggang Luo)
2022-10-20 18:25 ` [PATCH 15/25] lib: Implement error properly even when not HAVE_ERR_H Yonggang Luo
2022-12-12 15:37   ` Mark Wielaard
2022-12-16 21:50     ` 罗勇刚(Yonggang Luo)
2022-12-20 15:10       ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 16/25] libeu: Move the implementation of pwrite_retry, write_retry and pread_retry from header to source Yonggang Luo
2022-12-12 15:45   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 17/25] libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32 Yonggang Luo
2022-10-20 18:25 ` [PATCH 18/25] lib: Use NOT_HAVE_LIBINTL to guard #include <libintl.h> Yonggang Luo
2022-10-20 18:25 ` [PATCH 19/25] libelf: F_GETFD may not predefined with msvc/mingw, guard the usage of it Yonggang Luo
2022-12-12 15:54   ` Mark Wielaard
2022-10-20 18:25 ` [PATCH 20/25] Add function sys_get_page_size to replace platform dependent sysconf (_SC_PAGESIZE) Yonggang Luo
2022-10-20 18:26 ` [PATCH 21/25] libasm: stdio_ext.h are not present on win32 Yonggang Luo
2022-10-20 18:26 ` [PATCH 22/25] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h Yonggang Luo
2022-10-20 18:26 ` [PATCH 23/25] libasm/debuginfod: fchmod doesn't present on win32 Yonggang Luo
2022-10-20 18:26 ` [PATCH 24/25] lib: isatty is not available on windows Yonggang Luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221020182603.815-8-luoyonggang@gmail.com \
    --to=luoyonggang@gmail.com \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).