Re: [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-21 Thread Yonggang Luo
On Thu, Dec 22, 2022 at 12:54 AM Mark Wielaard wrote: > > Hi, > > On Wed, 2022-12-21 at 00:30 +0800, 罗勇刚(Yonggang Luo) via Elfutils-devel > wrote: > > On Tue, Dec 20, 2022 at 10:04 PM Mark Wielaard > > wrot > > > I have to think what it means for a syste

Re: [PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

2022-12-20 Thread Yonggang Luo
On Tue, Dec 20, 2022 at 11:08 PM Mark Wielaard wrote: > > On Sat, 2022-12-17 at 05:47 +0800, 罗勇刚(Yonggang Luo) wrote: > > From bdf8a3b45f063d010e7c93b3d3bfc42b801ee9b2 Mon Sep 17 00:00:00 > > 2001 > > From: Yonggang Luo > > Date: Thu, 20 Oct 2022 02:50:03 +0800 >

Re: [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-20 Thread Yonggang Luo
On Tue, Dec 20, 2022 at 10:04 PM Mark Wielaard wrote: > > Hi, > > On Sat, 2022-12-17 at 05:21 +0800, 罗勇刚(Yonggang Luo) wrote: > > On Fri, Oct 28, 2022 at 7:41 PM Mark Wielaard wrote: > > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > &g

Re: [PATCH v2 13/16] lib: isatty is not available on windows

2022-12-19 Thread Yonggang Luo
It's because lack STDOUT_FILENO, so this patch can be dropped On Sun, Dec 18, 2022 at 12:52 AM Yonggang Luo wrote: > > Signed-off-by: Yonggang Luo > --- > lib/color.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/lib/color.c b/lib/color.c > in

[PATCH v2 15/16] libelf: F_GETFD may not predefined with msvc/mingw, guard the usage of it

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libelf/elf_begin.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 6d31882e..3d324694 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -1163,12 +1163,19 @@ elf_begin (int fildes, Elf_Cmd cmd, Elf

[PATCH v2 14/16] Add function sys_get_page_size to replace platform dependent sysconf (_SC_PAGESIZE)

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/Makefile.am| 2 +- lib/crc32_file.c | 2 +- lib/system.c | 48 ++ lib/system.h | 3 +++ libdw/dwarf_begin_elf.c| 2 +- libdwelf/dwelf_strtab.c

[PATCH v2 16/16] lib: Use HAVE_LIBINTL_H to guard #include

2022-12-17 Thread Yonggang Luo via Elfutils-devel
MSVC doesn't have libintl.h, so use macro to guard it. Signed-off-by: Yonggang Luo --- configure.ac| 2 ++ lib/eu-config.h | 7 +++ 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index b84623fe..aea12be3 100644 --- a/configure.ac +++ b/configure.ac @@ -

[PATCH v2 09/16] libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libelf/libelf.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libelf/libelf.h b/libelf/libelf.h index a139e733..2fa3838b 100644 --- a/libelf/libelf.h +++ b/libelf/libelf.h @@ -195,9 +195,15 @@ typedef struct { char *ar_name; /* Name

[PATCH v2 12/16] libasm/debuginfod: fchmod doesn't present on win32

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- debuginfod/debuginfod-client.c | 4 +++- libasm/asm_end.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 8873fcc8..7a67a440 100644 --- a/debuginfod

[PATCH v2 08/16] lib: Implement error properly even when not HAVE_ERR_H

2022-12-17 Thread Yonggang Luo via Elfutils-devel
on win32, there is no err.h Signed-off-by: Yonggang Luo --- lib/error.c | 16 +++- lib/system.h | 4 +--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/error.c b/lib/error.c index 5186fc15..d4cbf0ff 100644 --- a/lib/error.c +++ b/lib/error.c @@ -28,12 +28,14

[PATCH v2 13/16] lib: isatty is not available on windows

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/color.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/color.c b/lib/color.c index 8063dc26..963a2ec2 100644 --- a/lib/color.c +++ b/lib/color.c @@ -117,9 +117,14 @@ parse_opt (int key, char *arg, if (strcmp (arg, values[i].str) == 0

[PATCH v2 10/16] libasm: stdio_ext.h are not present on win32

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libasm/asm_begin.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c index 9e4dfe43..9b6d974e 100644 --- a/libasm/asm_begin.c +++ b/libasm/asm_begin.c @@ -34,10 +34,13 @@ #include #include

[PATCH v2 11/16] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdwelf/libdwelf.h | 5 + libebl/libebl.h | 5 + 2 files changed, 10 insertions(+) diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h index 263ca60e..167ac0dc 100644 --- a/libdwelf/libdwelf.h +++ b/libdwelf/libdwelf.h @@ -31,6 +31,11

[PATCH v2 07/16] libdw: Fixes compile of dwarf_whatattr.c and dwarf_whatform.c

2022-12-17 Thread Yonggang Luo via Elfutils-devel
[build] 1 error generated. Signed-off-by: Yonggang Luo --- libdw/dwarf_whatattr.c | 9 - libdw/dwarf_whatform.c | 9 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libdw/dwarf_whatattr.c b/libdw/dwarf_whatattr.c index d664b021..01d92307 100644 --- a/libdw/dwarf_

[PATCH v2 06/16] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc

2022-12-17 Thread Yonggang Luo via Elfutils-devel
This block of code can not be removed. As it's contains a goto label enomem that been used elsewhere Signed-off-by: Yonggang Luo --- libcpu/i386_disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c index c34f03d6..44b

[PATCH v2 05/16] libcpu: Remove the need of NMNES by using enum

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libcpu/Makefile.am | 2 +- libcpu/i386_disasm.c | 14 +- libcpu/i386_mne.h| 36 libcpu/i386_parse.y | 9 +++-- 4 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 libcpu/i386_mne.h

[PATCH v2 04/16] Fixes usage of basename about prototype differences

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdw/dwarf_getsrc_file.c| 2 +- libdwfl/dwfl_module_getsrc_file.c| 2 +- libdwfl/dwfl_segment_report_module.c | 2 +- libdwfl/find-debuginfo.c | 6 +++--- libdwfl/link_map.c | 2 +- src/addr2line.c

[PATCH v2 03/16] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- configure.ac | 1 + lib/crc32_file.c | 4 ++-- lib/system.h | 2 ++ libelf/elf32_updatefile.c | 3 ++- libelf/elf_begin.c| 5 - libelf/elf_end.c | 2 ++ libelf/elf_update.c | 5 - 7 files changed

[PATCH v2 00/16] Patches for building with mingw/gcc msvc/clang-cl

2022-12-17 Thread Yonggang Luo via Elfutils-devel
I split it into small patches for easier to review Changes v1->v2: The reviews are applied Yonggang Luo (16): ignore build directory move platform depended include into system.h of libebl Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

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

2022-12-17 Thread Yonggang Luo via Elfutils-devel
Because all source in libebl #include , so #include 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 -#include -#include #include #include #include diff --git a/libebl/eblcorenote.c b/libebl

[PATCH v2 01/16] ignore build directory

2022-12-17 Thread Yonggang Luo via Elfutils-devel
This is for in in three building and won't affect IDE for example mkdir build && cd build && ../configure && make install Signed-off-by: Yonggang Luo --- .gitignore | 1 + ChangeLog | 4 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore in

Re: [PATCH 15/25] lib: Implement error properly even when not HAVE_ERR_H

2022-12-16 Thread Yonggang Luo
On Mon, Dec 12, 2022 at 11:37 PM Mark Wielaard wrote: > > Hi, > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > on win32, there is no err.h > > [...] > > +#else > > + (void)status; > > + vfprintf(stderr, format, arg

Re: [PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

2022-12-16 Thread Yonggang Luo
>From bdf8a3b45f063d010e7c93b3d3bfc42b801ee9b2 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 20 Oct 2022 02:50:03 +0800 Subject: [PATCH] libdw: Fixes compile of dwarf_whatattr.c and dwarf_whatform.c If __OPTIMIZE__ is defined, then compile dwarf_whatattr.c and dwarf_whatform.c w

Re: [PATCH 11/25] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc

2022-12-16 Thread Yonggang Luo
On Mon, Dec 12, 2022 at 8:42 PM Mark Wielaard wrote: > > Hi, > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > Signed-off-by: Yonggang Luo > > --- > > libcpu/i386_disasm.c | 2 +- > > 1 file changed, 1 insertion(+), 1

Re: [PATCH 09/25] include libgen.h in system.h

2022-12-16 Thread Yonggang Luo
But still I think the force cast to (char *) is needed On Sat, Dec 17, 2022 at 5:22 AM 罗勇刚(Yonggang Luo) wrote: > > > > On Fri, Oct 28, 2022 at 7:45 PM Mark Wielaard wrote: > > > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > > wrote: > &

Re: [PATCH 09/25] include libgen.h in system.h

2022-12-16 Thread Yonggang Luo
On Fri, Oct 28, 2022 at 7:45 PM Mark Wielaard wrote: > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > basename function are accessed multiple place, but used without > > include libgen.h > > This is wrong. We use the GNU b

Re: [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-16 Thread Yonggang Luo
On Fri, Oct 28, 2022 at 7:41 PM Mark Wielaard wrote: > > Hi, > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > Signed-off-by: Yonggang Luo > > --- > > configure.ac | 1 + > > lib/crc32_file.c | 4

Re: [PATCH 06/25] move platform depended include into system.h of libebl

2022-12-16 Thread Yonggang Luo
On Fri, Oct 28, 2022 at 7:35 PM Mark Wielaard wrote: > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > Because all source in libebl #include , so #include > > in > > libeblP.h is enough, there is multiple memory-access.h file,

Re: [PATCH 02/25] ignore build directory

2022-12-16 Thread Yonggang Luo
It's a common step to configure and make under build directory, so that the IDE won't affect by it On Thu, Oct 27, 2022 at 9:03 PM Mark Wielaard wrote: > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > Signed-off-by: Yonggang Luo >

Re: [PATCH 7/7] Add CMake build files

2022-12-16 Thread Yonggang Luo
gt; Mark -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

Re: [PATCH 6/7] Fixes building with msvc/clang mingw/gcc

2022-12-16 Thread Yonggang Luo
this will be hard to keep working. > > Cheers, > > Mark -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-11-24 Thread Yonggang Luo
w if it works for you. > > Thanks, > > Mark -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

[PATCH 24/25] lib: isatty is not available on windows

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/color.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/color.c b/lib/color.c index 8063dc26..963a2ec2 100644 --- a/lib/color.c +++ b/lib/color.c @@ -117,9 +117,14 @@ parse_opt (int key, char *arg, if (strcmp (arg, values[i].str) == 0

[PATCH 21/25] libasm: stdio_ext.h are not present on win32

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libasm/asm_begin.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c index 9e4dfe43..9b6d974e 100644 --- a/libasm/asm_begin.c +++ b/libasm/asm_begin.c @@ -34,10 +34,13 @@ #include #include

[PATCH 17/25] libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libelf/libelf.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libelf/libelf.h b/libelf/libelf.h index a139e733..2fa3838b 100644 --- a/libelf/libelf.h +++ b/libelf/libelf.h @@ -195,9 +195,15 @@ typedef struct { char *ar_name; /* Name

[PATCH 23/25] libasm/debuginfod: fchmod doesn't present on win32

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- debuginfod/debuginfod-client.c | 4 +++- libasm/asm_end.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 2a14d9d9..4b7f837b 100644 --- a/debuginfod

[PATCH 20/25] Add function sys_get_page_size to replace platform dependent sysconf (_SC_PAGESIZE)

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/crc32_file.c | 2 +- lib/system.c | 17 + lib/system.h | 3 +++ libdw/dwarf_begin_elf.c| 2 +- libdwelf/dwelf_strtab.c| 2 +- libdwfl/linux-kernel-modules.c | 2 +- libdwfl

[PATCH 19/25] libelf: F_GETFD may not predefined with msvc/mingw, guard the usage of it

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libelf/elf_begin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 6d31882e..d867cd6f 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -1163,12 +1163,14 @@ elf_begin (int fildes, Elf_Cmd cmd, Elf *ref

[PATCH 15/25] lib: Implement error properly even when not HAVE_ERR_H

2022-10-20 Thread Yonggang Luo via Elfutils-devel
on win32, there is no err.h Signed-off-by: Yonggang Luo --- lib/error.c | 9 - lib/system.h | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/error.c b/lib/error.c index 5186fc15..7924735e 100644 --- a/lib/error.c +++ b/lib/error.c @@ -28,12 +28,14

[PATCH 22/25] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdwelf/libdwelf.h | 5 + libebl/libebl.h | 5 + 2 files changed, 10 insertions(+) diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h index 263ca60e..167ac0dc 100644 --- a/libdwelf/libdwelf.h +++ b/libdwelf/libdwelf.h @@ -31,6 +31,11

[PATCH 16/25] libeu: Move the implementation of pwrite_retry, write_retry and pread_retry from header to source

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/Makefile.am | 2 +- lib/system.c| 87 + lib/system.h| 59 - 3 files changed, 94 insertions(+), 54 deletions(-) create mode 100644 lib/system.c diff --git a/lib

[PATCH 18/25] lib: Use NOT_HAVE_LIBINTL to guard #include

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Add NOT_HAVE_LIBINTL macro to disable internationalization, sometimes we have don't want access internationalization such as MSVC, so the macro NOT_HAVE_LIBINTL can help that. Signed-off-by: Yonggang Luo --- lib/eu-config.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/l

[PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdw/dwarf_whatattr.c | 3 ++- libdw/dwarf_whatform.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libdw/dwarf_whatattr.c b/libdw/dwarf_whatattr.c index d664b021..59769865 100644 --- a/libdw/dwarf_whatattr.c +++ b/libdw/dwarf_whatattr.c

[PATCH 10/25] libcpu: Remove the need of NMNES by using enum

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libcpu/Makefile.am | 2 +- libcpu/i386_parse.y | 13 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am index 57d0a164..259ed838 100644 --- a/libcpu/Makefile.am +++ b/libcpu/Makefile.am @@ -92,7

[PATCH 13/25] libdw: typeof -> __typeof that can be recognized by both clang-cl and gcc

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdw/memory-access.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libdw/memory-access.h b/libdw/memory-access.h index 16c8c851..fca4129a 100644 --- a/libdw/memory-access.h +++ b/libdw/memory-access.h @@ -64,7 +64,7

[PATCH 11/25] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libcpu/i386_disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c index 599d1654..cc75a7b1 100644 --- a/libcpu/i386_disasm.c +++ b/libcpu/i386_disasm.c @@ -480,7 +480,7 @@ i386_disasm (Ebl *ebl

[PATCH 05/25] use #include instead platform depended header in libdw/memory-access.h

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libdw/memory-access.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libdw/memory-access.h b/libdw/memory-access.h index 800b517c..16c8c851 100644 --- a/libdw/memory-access.h +++ b/libdw/memory-access.h @@ -29,11 +29,10 @@ #ifndef

[PATCH 09/25] include libgen.h in system.h

2022-10-20 Thread Yonggang Luo via Elfutils-devel
basename function are accessed multiple place, but used without include libgen.h Signed-off-by: Yonggang Luo --- lib/system.h | 1 + libdw/dwarf_getsrc_file.c| 2 +- libdwfl/dwfl_module_getsrc_file.c| 2 +- libdwfl/dwfl_segment_report_module.c | 2

[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

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- libcpu/i386_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpu/i386_data.h b/libcpu/i386_data.h index 06356b8a..fe3c4ae1 100644 --- a/libcpu/i386_data.h +++ b/libcpu/i386_data.h @@ -1153,7 +1153,7 @@ FCT_mod$64r_m (struct output_data

[PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- configure.ac | 1 + lib/crc32_file.c | 4 ++-- lib/system.h | 2 ++ libelf/elf32_updatefile.c | 3 ++- libelf/elf_begin.c| 5 - libelf/elf_end.c | 2 ++ libelf/elf_update.c | 5 - 7 files changed

[PATCH 03/25] libebl: There is no need #include in eblclosebackend.c and eblopenbackend.c

2022-10-20 Thread Yonggang Luo via Elfutils-devel
It's not accessed symbols in dlfcn.h in eblclosebackend.c and eblopenbackend.c Signed-off-by: Yonggang Luo --- libebl/eblclosebackend.c | 1 - libebl/eblopenbackend.c | 1 - 2 files changed, 2 deletions(-) diff --git a/libebl/eblclosebackend.c b/libebl/eblclosebackend.c index 501

[PATCH 07/25] move platform depended include into system.h of libasm, libcpu, libdw, libdwfl and libdwelf

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- 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

[PATCH 01/25] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-20 Thread Yonggang Luo via Elfutils-devel
These filenames are invalid on win32 Signed-off-by: Yonggang Luo --- tests/Makefile.am | 2 +- tests/debuginfod-rpms/{hello2.spec. => hello2.spec} | 0 tests/debuginfod-rpms/{hello3.spec. => hello3.spec} | 0 3 files changed, 1 insertion(+), 1 de

[PATCH 04/25] libelf/libdwfl: Remove "#define LIB_SYSTEM_H 1" in libelf_crc32.c and libdwfl_crc32.c

2022-10-20 Thread Yonggang Luo via Elfutils-devel
function ‘bswap_32’ [-Werror=implicit-function-declaration] Signed-off-by: Yonggang Luo --- libdwfl/libdwfl_crc32.c | 1 - libelf/libelf_crc32.c | 1 - 2 files changed, 2 deletions(-) diff --git a/libdwfl/libdwfl_crc32.c b/libdwfl/libdwfl_crc32.c index b89d0d36..5bc7a4ad 100644 --- a/lib

[PATCH 06/25] move platform depended include into system.h of libebl

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Because all source in libebl #include , so #include 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 -#include -#include #include #include #include + #include #define AUXV_TYPES

[PATCH 00/25] Patches for building with mingw/gcc msvc/clang-cl

2022-10-20 Thread Yonggang Luo via Elfutils-devel
I split it into small patches for easier to review Yonggang Luo (25): Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec' ignore build directory libebl: There is no need #include in eblclosebackend.c and eblopenbackend.c

[PATCH 02/25] ignore build directory

2022-10-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8bcd88d7..ca06 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ Makefile.in /INSTALL /aclocal.m4 /autom4te.* +/build /config.cache /config.h

Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
27;. C:\work\xemu\elfutils> ``` -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
t's fine. But I don't understand the problem - my windows machines have > no problem with files named "hello2.spec2." with two periods. > Hi, Frank, `git clone` can not checkout the file, I didn't know why > - FChE > -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
I really want this to be merged :) ping Frank, as this would stop me clone elfutils on windows On Sat, Oct 15, 2022 at 4:35 AM Mark Wielaard wrote: > > Hi, > > On Tue, Sep 20, 2022 at 04:43:01PM +0800, Yonggang Luo via Elfutils-devel wrote: > > These filenames are invalid on wi

Re: [PATCH 5/7] Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN

2022-10-16 Thread Yonggang Luo
BYTE_ORDER is defined in -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo

Re: [PATCH 2/7] move platform depended include into system.h

2022-10-15 Thread Yonggang Luo
OK, updated in v2 On Sat, Oct 15, 2022 at 5:16 AM Mark Wielaard wrote: > > On Tue, Sep 20, 2022 at 04:43:02PM +0800, Yonggang Luo via Elfutils-devel wrote: > > All of these files either #include directly or #include "libelfP.h" > > And now "libelfP.h also #i

[PATCH v2 4/7] lib: Use NOT_HAVE_LIBINTL to guard #include

2022-10-15 Thread Yonggang Luo via Elfutils-devel
Add NOT_HAVE_LIBINTL macro to disable internationalization, sometimes we have don't want access internationalization such as MSVC, so the macro NOT_HAVE_LIBINTL can help that. Signed-off-by: Yonggang Luo --- lib/eu-config.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/l

[PATCH v2 3/7] Move the #include into eu-config.h

2022-10-15 Thread Yonggang Luo via Elfutils-devel
So we do not need include in each file. And indeed the macro #define _(Str) dgettext ("elfutils", Str) access libintl function dgettext, so it's make more sense #include in file eu-config.h Signed-off-by: Yonggang Luo --- debuginfod/debuginfod.cxx | 1 - lib/color.c

[PATCH v2 2/7] move platform depended include into system.h of libelf

2022-10-15 Thread Yonggang Luo via Elfutils-devel
All of these files either #include directly or #include "libelfP.h" And now "libelfP.h also #include , so the platform depended include can be moved to system.h safely Signed-off-by: Yonggang Luo --- lib/system.h | 11 +++ libelf/common.h |

[PATCH v2 0/7] Enable building libelf of elfutils on win32

2022-10-15 Thread Yonggang Luo via Elfutils-devel
After these changes, now libelf can be build with mingw/gcc and msvc/clang v1 -> v2 Do no modify libebl in commit move platform depended include into system.h of libelf Add commit Move the #include into eu-config.h to Yonggang Luo (7): Rename 'hello2.spec.' -> 'hell

[PATCH 7/7] Add CMake build files

2022-09-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- .gitignore | 1 + CMakeLists.txt | 47 + libelf/CMakeLists.txt| 192 +++ libelf/config-cmake/config.h | 27 + 4 files changed, 267 insertions(+) create mode 100644

[PATCH 5/7] Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN

2022-09-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/system.h | 4 ++-- libcpu/i386_disasm.c | 2 +- libcpu/memory-access.h | 26 +- libcpu/riscv_disasm.c| 2 +- libdw/memory-access.h| 8

[PATCH 2/7] move platform depended include into system.h

2022-09-20 Thread Yonggang Luo via Elfutils-devel
All of these files either #include directly or #include "libelfP.h" And now "libelfP.h also #include , so the platform depended include can be moved to system.h safely Signed-off-by: Yonggang Luo --- lib/system.h | 11 +++ libebl/eblmachineflagname.c

[PATCH 4/7] Remove duplicated #include

2022-09-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- debuginfod/debuginfod.cxx | 1 - lib/color.c | 1 - lib/printversion.c| 1 - lib/xasprintf.c | 1 - lib/xmalloc.c | 1 - libasm/asm_end.c | 1 - libasm/asm_error.c| 1 - libasm/asm_newscn.c | 1

[PATCH 6/7] Fixes building with msvc/clang mingw/gcc

2022-09-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- configure.ac | 1 + lib/system.h | 61 +- lib/system_win32.c| 162 ++ libelf/elf32_updatefile.c | 3 +- libelf/elf_begin.c| 7 +- libelf/elf_end.c | 2

[PATCH 0/7] Enable building libelf of elfutils on win32

2022-09-20 Thread Yonggang Luo via Elfutils-devel
After these changes, now libelf can be build with mingw/gcc and msvc/clang Yonggang Luo (7): Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec' move platform depended include into system.h lib: Use NOT_HAVE_LIBINTL to guard

[PATCH 3/7] lib: Use NOT_HAVE_LIBINTL to guard if need #include

2022-09-20 Thread Yonggang Luo via Elfutils-devel
Signed-off-by: Yonggang Luo --- lib/eu-config.h | 8 1 file changed, 8 insertions(+) diff --git a/lib/eu-config.h b/lib/eu-config.h index c7d7cbb2..5e6c3c72 100644 --- a/lib/eu-config.h +++ b/lib/eu-config.h @@ -52,9 +52,17 @@ # define rwlock_unlock(lock) ((void) (lock)) #endif

[PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-09-20 Thread Yonggang Luo via Elfutils-devel
These filenames are invalid on win32 Signed-off-by: Yonggang Luo --- tests/Makefile.am | 2 +- tests/debuginfod-rpms/{hello2.spec. => hello2.spec} | 0 tests/debuginfod-rpms/{hello3.spec. => hello3.spec} | 0 3 files changed, 1 insertion(+), 1 de