From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 2B4423AA9414 for ; Sat, 17 Dec 2022 16:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B4423AA9414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1032.google.com with SMTP id js9so5311070pjb.2 for ; Sat, 17 Dec 2022 08:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sMCZEtbI5SxHu2TSUzxbdcOy1bzeQgM2BlG6ze3pRMk=; b=irctUZ6lokt2ARFQoSqIDFiS9K3MZbpamID/jtZ02IRNDRjwp68yMMLrcjdbAEWQrf pFLo1FJhCuL4qeoYDX9zh5/2dOWo9JutQnxo8l/8gyI1kQfHafRT8wQxniWv4jTl99N5 ULCxlo/BXqCmSRsw6t9qD0ZiZB7D4it/di4P28Xs+y+7B6tM4eu3rO5IJdIvCsVnuvsV ibSKLgqdZorm6Qps7+Zl4+FRG79+t3st6qx0H74bh2wZaH9kTH+hFCY4g7VDM2Qtx5Rl wrx+k4UPUkCfZqzD03k5I1TuW2fBldbw32pNhihCg4LTbAiXo+fCF/rwy2Yi5RQlz9qS HDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sMCZEtbI5SxHu2TSUzxbdcOy1bzeQgM2BlG6ze3pRMk=; b=ME7zqBFtL3u4HveNWmUvmApMNtx3VWwyE2lLyn2i8ZT/Zn+TEJAK6TbCz9rUDIpFLI clKr/UMjnoOsbFpmNmpePWLhrggI+syykhzTnl8ChhD/l2z6oD03l7AW6guD+7xtFTzm BTGwC6b4emk9uJ7CkSylb5sDbArJGQLeWifne5XJ/72UcDuDkcEDkH8aOiNZW5pVSdxa /ZpLBHhwUev+6R6uO7/LYSpntDD+f3MM7i9hBY3tZNcnK4SUzmpM8cOprggqSugGfUOF nx3gpyFmHv8Fyg/TkSBpD3sNM6g52m0JeIXRNteK8Vy2o5ygruiO5gb/RgD3sMiUStcM Y4dw== X-Gm-Message-State: ANoB5pmRNNmyd07JiU+e6pzwiHzeDGjLeN+S1xAJacJ6Z8QBo+AIRFNP Y6wliWwDtd3phv+503AL9BWqBqylIa0= X-Google-Smtp-Source: AA0mqf79VYmpcF2ztpLZNNcoYnyNnHrXOmXtjkurUoziwVTgKT0PJpeEbu5FRnKaE2uqi67i4e83Jw== X-Received: by 2002:a17:90a:f3c1:b0:21e:dec6:fc3d with SMTP id ha1-20020a17090af3c100b0021edec6fc3dmr33151991pjb.8.1671295953797; Sat, 17 Dec 2022 08:52:33 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id s92-20020a17090a2f6500b002191873187dsm6643229pjd.33.2022.12.17.08.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:52:33 -0800 (PST) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH v2 00/16] Patches for building with mingw/gcc msvc/clang-cl Date: Sun, 18 Dec 2022 00:51:57 +0800 Message-Id: <20221217165213.152-1-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 Fixes usage of basename about prototype differences libcpu: Remove the need of NMNES by using enum libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc libdw: Fixes compile of dwarf_whatattr.c and dwarf_whatform.c lib: Implement error properly even when not HAVE_ERR_H libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32 libasm: stdio_ext.h are not present on win32 libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h libasm/debuginfod: fchmod doesn't present on win32 lib: isatty is not available on windows Add function sys_get_page_size to replace platform dependent sysconf (_SC_PAGESIZE) libelf: F_GETFD may not predefined with msvc/mingw, guard the usage of it lib: Use HAVE_LIBINTL_H to guard #include .gitignore | 1 + ChangeLog | 4 ++ configure.ac | 3 + debuginfod/debuginfod-client.c | 4 +- lib/Makefile.am | 2 +- lib/color.c | 5 ++ lib/crc32_file.c | 6 +- lib/error.c | 16 ++++- lib/eu-config.h | 7 ++ libdw/dwarf_whatform.c => lib/system.c | 90 ++++++++++++++------------ lib/system.h | 9 ++- libasm/asm_begin.c | 7 +- libasm/asm_end.c | 2 + libcpu/Makefile.am | 2 +- libcpu/i386_disasm.c | 16 +---- libcpu/i386_mne.h | 36 +++++++++++ libcpu/i386_parse.y | 9 +-- libdw/dwarf_begin_elf.c | 2 +- libdw/dwarf_getsrc_file.c | 2 +- libdw/dwarf_whatattr.c | 9 ++- libdw/dwarf_whatform.c | 9 ++- libdwelf/dwelf_strtab.c | 2 +- libdwelf/libdwelf.h | 5 ++ libdwfl/dwfl_module_getsrc_file.c | 2 +- libdwfl/dwfl_segment_report_module.c | 2 +- libdwfl/find-debuginfo.c | 6 +- libdwfl/link_map.c | 2 +- libdwfl/linux-kernel-modules.c | 2 +- libdwfl/linux-proc-maps.c | 2 +- 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/libebl.h | 5 ++ libebl/libeblP.h | 1 + libelf/elf32_updatefile.c | 5 +- libelf/elf_begin.c | 12 +++- libelf/elf_end.c | 2 + libelf/elf_update.c | 5 +- libelf/libelf.h | 6 ++ src/addr2line.c | 4 +- src/ar.c | 2 +- src/nm.c | 4 +- src/ranlib.c | 2 +- src/stack.c | 2 +- src/strings.c | 2 +- src/strip.c | 2 +- 49 files changed, 215 insertions(+), 119 deletions(-) copy libdw/dwarf_whatform.c => lib/system.c (66%) create mode 100644 libcpu/i386_mne.h -- 2.36.1.windows.1