From patchwork Wed Dec 27 03:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82867 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F59D3858D38 for ; Wed, 27 Dec 2023 03:56:26 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 0FB193858D32 for ; Wed, 27 Dec 2023 03:56:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FB193858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0FB193858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703649364; cv=none; b=fJ9a/mKUhHkmfEXrAHHO7uLqug2abkeuP+CrnhXVs0qZxB4nmJTPEwJfxya2TlvJOQwd3MMB7wAy4b3LOGNqkddDCBnzRt3PeuicMwKQCsAmtZ7nvxMy+CxRV3gFdwgJFxd6VIyKIPw3LlGlsKl4LqJsMQi3B1wMD/Yy/cbGSco= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703649364; c=relaxed/simple; bh=dRP9fGUVfnCB/a6O/a2XIHo/uA5o5Ds39UPu8bqBNcw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jLfLdsD+l20X061QAYRBRlIhnO8tkJJzTYslaclH9k8zoAMZwgLKpBn7I5jeCAWp/z84qBcLYojkOH6FUH6QjI6LFA6MgiABxUqWB0xEckVkQ0q97TbpIQDGsYGQj7qUHhQPJSaWnvhmKaUqRpNnTrmnPnDFTUI+6zWINB0AfcM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 9B25D34069F; Wed, 27 Dec 2023 03:56:01 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: common: pull in newlib extensions for Linux compatibility Date: Tue, 26 Dec 2023 22:55:59 -0500 Message-ID: <20231227035559.19669-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Since newlib allows people to opt-in to extra errno names, pull them into our table too. The values don't conflict with each other -- the newlib names & values are distinct from newlib's Linux compatibility. --- sim/common/gennltvals.py | 6 +- sim/common/target-newlib-errno.c | 117 +++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 1 deletion(-) diff --git a/sim/common/gennltvals.py b/sim/common/gennltvals.py index 62304a8beab1..2acbb81e8f5a 100755 --- a/sim/common/gennltvals.py +++ b/sim/common/gennltvals.py @@ -142,7 +142,11 @@ def gen_common(output_dir: Path, newlib: Path, cpp: str): No arch should override these. """ - gentvals(output_dir, cpp, 'errno', newlib / 'newlib/libc/include', + # Enable Linux errno extensions since the newlib values are designed to + # not conflict with each other. + gentvals(output_dir, + cpp + ' -D__LINUX_ERRNO_EXTENSIONS__', + 'errno', newlib / 'newlib/libc/include', ('errno.h', 'sys/errno.h'), 'E[A-Z0-9]*') gentvals(output_dir, cpp, 'signal', newlib / 'newlib/libc/include', diff --git a/sim/common/target-newlib-errno.c b/sim/common/target-newlib-errno.c index 13369df39f2a..bdcf4acd6996 100644 --- a/sim/common/target-newlib-errno.c +++ b/sim/common/target-newlib-errno.c @@ -41,6 +41,9 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef EADDRNOTAVAIL { "EADDRNOTAVAIL", EADDRNOTAVAIL, 125 }, #endif +#ifdef EADV + { "EADV", EADV, 68 }, +#endif #ifdef EAFNOSUPPORT { "EAFNOSUPPORT", EAFNOSUPPORT, 106 }, #endif @@ -50,12 +53,30 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef EALREADY { "EALREADY", EALREADY, 120 }, #endif +#ifdef EBADE + { "EBADE", EBADE, 50 }, +#endif #ifdef EBADF { "EBADF", EBADF, 9 }, #endif +#ifdef EBADFD + { "EBADFD", EBADFD, 81 }, +#endif #ifdef EBADMSG { "EBADMSG", EBADMSG, 77 }, #endif +#ifdef EBADR + { "EBADR", EBADR, 51 }, +#endif +#ifdef EBADRQC + { "EBADRQC", EBADRQC, 54 }, +#endif +#ifdef EBADSLT + { "EBADSLT", EBADSLT, 55 }, +#endif +#ifdef EBFONT + { "EBFONT", EBFONT, 57 }, +#endif #ifdef EBUSY { "EBUSY", EBUSY, 16 }, #endif @@ -65,6 +86,12 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ECHILD { "ECHILD", ECHILD, 10 }, #endif +#ifdef ECHRNG + { "ECHRNG", ECHRNG, 37 }, +#endif +#ifdef ECOMM + { "ECOMM", ECOMM, 70 }, +#endif #ifdef ECONNABORTED { "ECONNABORTED", ECONNABORTED, 113 }, #endif @@ -77,12 +104,18 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef EDEADLK { "EDEADLK", EDEADLK, 45 }, #endif +#ifdef EDEADLOCK + { "EDEADLOCK", EDEADLOCK, 56 }, +#endif #ifdef EDESTADDRREQ { "EDESTADDRREQ", EDESTADDRREQ, 121 }, #endif #ifdef EDOM { "EDOM", EDOM, 33 }, #endif +#ifdef EDOTDOT + { "EDOTDOT", EDOTDOT, 76 }, +#endif #ifdef EDQUOT { "EDQUOT", EDQUOT, 132 }, #endif @@ -128,6 +161,39 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef EISDIR { "EISDIR", EISDIR, 21 }, #endif +#ifdef EL2HLT + { "EL2HLT", EL2HLT, 44 }, +#endif +#ifdef EL2NSYNC + { "EL2NSYNC", EL2NSYNC, 38 }, +#endif +#ifdef EL3HLT + { "EL3HLT", EL3HLT, 39 }, +#endif +#ifdef EL3RST + { "EL3RST", EL3RST, 40 }, +#endif +#ifdef ELBIN + { "ELBIN", ELBIN, 75 }, +#endif +#ifdef ELIBACC + { "ELIBACC", ELIBACC, 83 }, +#endif +#ifdef ELIBBAD + { "ELIBBAD", ELIBBAD, 84 }, +#endif +#ifdef ELIBEXEC + { "ELIBEXEC", ELIBEXEC, 87 }, +#endif +#ifdef ELIBMAX + { "ELIBMAX", ELIBMAX, 86 }, +#endif +#ifdef ELIBSCN + { "ELIBSCN", ELIBSCN, 85 }, +#endif +#ifdef ELNRNG + { "ELNRNG", ELNRNG, 41 }, +#endif #ifdef ELOOP { "ELOOP", ELOOP, 92 }, #endif @@ -158,9 +224,15 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ENFILE { "ENFILE", ENFILE, 23 }, #endif +#ifdef ENOANO + { "ENOANO", ENOANO, 53 }, +#endif #ifdef ENOBUFS { "ENOBUFS", ENOBUFS, 105 }, #endif +#ifdef ENOCSI + { "ENOCSI", ENOCSI, 43 }, +#endif #ifdef ENODATA { "ENODATA", ENODATA, 61 }, #endif @@ -179,12 +251,21 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ENOLINK { "ENOLINK", ENOLINK, 67 }, #endif +#ifdef ENOMEDIUM + { "ENOMEDIUM", ENOMEDIUM, 135 }, +#endif #ifdef ENOMEM { "ENOMEM", ENOMEM, 12 }, #endif #ifdef ENOMSG { "ENOMSG", ENOMSG, 35 }, #endif +#ifdef ENONET + { "ENONET", ENONET, 64 }, +#endif +#ifdef ENOPKG + { "ENOPKG", ENOPKG, 65 }, +#endif #ifdef ENOPROTOOPT { "ENOPROTOOPT", ENOPROTOOPT, 109 }, #endif @@ -200,6 +281,9 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ENOSYS { "ENOSYS", ENOSYS, 88 }, #endif +#ifdef ENOTBLK + { "ENOTBLK", ENOTBLK, 15 }, +#endif #ifdef ENOTCONN { "ENOTCONN", ENOTCONN, 128 }, #endif @@ -221,6 +305,9 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ENOTTY { "ENOTTY", ENOTTY, 25 }, #endif +#ifdef ENOTUNIQ + { "ENOTUNIQ", ENOTUNIQ, 80 }, +#endif #ifdef ENXIO { "ENXIO", ENXIO, 6 }, #endif @@ -242,6 +329,9 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef EPIPE { "EPIPE", EPIPE, 32 }, #endif +#ifdef EPROCLIM + { "EPROCLIM", EPROCLIM, 130 }, +#endif #ifdef EPROTO { "EPROTO", EPROTO, 71 }, #endif @@ -254,18 +344,36 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ERANGE { "ERANGE", ERANGE, 34 }, #endif +#ifdef EREMCHG + { "EREMCHG", EREMCHG, 82 }, +#endif +#ifdef EREMOTE + { "EREMOTE", EREMOTE, 66 }, +#endif #ifdef EROFS { "EROFS", EROFS, 30 }, #endif +#ifdef ESHUTDOWN + { "ESHUTDOWN", ESHUTDOWN, 110 }, +#endif +#ifdef ESOCKTNOSUPPORT + { "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, 124 }, +#endif #ifdef ESPIPE { "ESPIPE", ESPIPE, 29 }, #endif #ifdef ESRCH { "ESRCH", ESRCH, 3 }, #endif +#ifdef ESRMNT + { "ESRMNT", ESRMNT, 69 }, +#endif #ifdef ESTALE { "ESTALE", ESTALE, 133 }, #endif +#ifdef ESTRPIPE + { "ESTRPIPE", ESTRPIPE, 143 }, +#endif #ifdef ETIME { "ETIME", ETIME, 62 }, #endif @@ -278,11 +386,20 @@ CB_TARGET_DEFS_MAP cb_init_errno_map[] = { #ifdef ETXTBSY { "ETXTBSY", ETXTBSY, 26 }, #endif +#ifdef EUNATCH + { "EUNATCH", EUNATCH, 42 }, +#endif +#ifdef EUSERS + { "EUSERS", EUSERS, 131 }, +#endif #ifdef EWOULDBLOCK { "EWOULDBLOCK", EWOULDBLOCK, 11 }, #endif #ifdef EXDEV { "EXDEV", EXDEV, 18 }, +#endif +#ifdef EXFULL + { "EXFULL", EXFULL, 52 }, #endif /* gennltvals: END */ { NULL, -1, -1 },