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

Message ID 20221015163622.129-1-luoyonggang@gmail.com
Headers
Series Enable building libelf of elfutils on win32 |

Message

Yonggang Luo Oct. 15, 2022, 4:36 p.m. UTC
  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 <libintl.h> into eu-config.h to

Yonggang Luo (7):
  Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'
  move platform depended include into system.h of libelf
  Move the #include <libintl.h> into eu-config.h
  lib: Use NOT_HAVE_LIBINTL to guard #include <libintl.h>
  Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN
  Fixes building with msvc/clang mingw/gcc
  Add CMake build files

 .gitignore                                    |   1 +
 CMakeLists.txt                                |  47 +++++
 configure.ac                                  |   1 +
 debuginfod/debuginfod.cxx                     |   1 -
 lib/color.c                                   |   1 -
 lib/eu-config.h                               |   8 +
 lib/printversion.c                            |   1 -
 lib/system.h                                  |  74 ++++++-
 lib/system_win32.c                            | 162 +++++++++++++++
 lib/xasprintf.c                               |   1 -
 lib/xmalloc.c                                 |   1 -
 libasm/asm_end.c                              |   1 -
 libasm/asm_error.c                            |   1 -
 libasm/asm_newscn.c                           |   1 -
 libcpu/i386_disasm.c                          |   2 +-
 libcpu/i386_lex.l                             |   1 -
 libcpu/i386_parse.y                           |   1 -
 libcpu/memory-access.h                        |  26 +--
 libcpu/riscv_disasm.c                         |   2 +-
 libdw/libdwP.h                                |   1 -
 libdw/memory-access.h                         |   8 +-
 libdwfl/argp-std.c                            |   1 -
 libdwfl/dwfl_error.c                          |   1 -
 libdwfl/dwfl_segment_report_module.c          |   2 +-
 libebl/libeblP.h                              |   1 -
 libelf/CMakeLists.txt                         | 192 ++++++++++++++++++
 libelf/common.h                               |   5 +-
 libelf/config-cmake/config.h                  |  27 +++
 libelf/elf32_checksum.c                       |   5 +-
 libelf/elf32_getphdr.c                        |   2 -
 libelf/elf32_getshdr.c                        |   2 -
 libelf/elf32_updatefile.c                     |   6 +-
 libelf/elf32_updatenull.c                     |   2 -
 libelf/elf32_xlatetof.c                       |   5 +-
 libelf/elf32_xlatetom.c                       |   1 -
 libelf/elf_begin.c                            |  10 +-
 libelf/elf_cntl.c                             |   2 -
 libelf/elf_compress.c                         |   2 -
 libelf/elf_end.c                              |   3 +-
 libelf/elf_error.c                            |   1 -
 libelf/elf_getarsym.c                         |  10 +-
 libelf/elf_getdata.c                          |   2 -
 libelf/elf_getdata_rawchunk.c                 |   2 -
 libelf/elf_getshdrstrndx.c                    |   2 -
 libelf/elf_readall.c                          |   2 -
 libelf/elf_update.c                           |   7 +-
 libelf/gelf_xlate.c                           |   1 -
 libelf/libelf.h                               |   6 +
 libelf/libelfP.h                              |   5 +
 libelf/nlist.c                                |   1 -
 lib/xasprintf.c => libelf/win32/ar.h          | 104 +++++-----
 src/addr2line.c                               |   1 -
 src/ar.c                                      |   1 -
 src/arlib-argp.c                              |   1 -
 src/arlib.c                                   |   1 -
 src/arlib.h                                   |   2 +-
 src/arlib2.c                                  |   1 -
 src/elfcmp.c                                  |   1 -
 src/elflint.c                                 |   1 -
 src/findtextrel.c                             |   1 -
 src/nm.c                                      |   1 -
 src/objdump.c                                 |   1 -
 src/ranlib.c                                  |   1 -
 src/readelf.c                                 |   1 -
 src/size.c                                    |   1 -
 src/strings.c                                 |   1 -
 src/strip.c                                   |   1 -
 src/unstrip.c                                 |   1 -
 tests/Makefile.am                             |   2 +-
 .../{hello2.spec. => hello2.spec}             |   0
 .../{hello3.spec. => hello3.spec}             |   0
 71 files changed, 612 insertions(+), 162 deletions(-)
 create mode 100644 CMakeLists.txt
 create mode 100644 lib/system_win32.c
 create mode 100644 libelf/CMakeLists.txt
 create mode 100644 libelf/config-cmake/config.h
 copy lib/xasprintf.c => libelf/win32/ar.h (66%)
 rename tests/debuginfod-rpms/{hello2.spec. => hello2.spec} (100%)
 rename tests/debuginfod-rpms/{hello3.spec. => hello3.spec} (100%)