From patchwork Wed Sep 9 07:18:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1360357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=FH2x3pDi; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmYJv2s1cz9sSJ for ; Wed, 9 Sep 2020 17:18:22 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id A0202102CB; Wed, 9 Sep 2020 09:18:13 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by helium.openadk.org (Postfix) with ESMTPS id 66589102A8; Wed, 9 Sep 2020 09:18:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599635890; x=1631171890; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4R7DvuoSmFLFNbCYAIH7ozfzfqOzxZyG0zx3pa7tqX0=; b=FH2x3pDijHSQDPoFqk8QyoxKd8L7kUxo1L6uNVzoxd8nWVc0G1ONNjoz i8PFceufRQBDUp5ryFdySZ/cTD2+pRMcA/WJDKljw2a5IwvgQEB9mrCYq xlZZqtv+k2bBibySpzZCZbyspiUancF5cE1qiZsYKqbGN3COnCzcjGM/m xLt02pJoQF3vk/Bj5LzGdBAuig7C0FWf7u4KDepSOqlSJ+Q8Mw8MJzKa7 KU1ru8YmqdFsKBY/hC4gnelGu0m6cRXZEnWK1sfK0RSFfZdhtgE1Qgqv6 mY+IVksAtafON0NQ4xvroqe8TnxA/1QjpyoHMT9+kFz03vbcAqo4FDRCO g==; IronPort-SDR: Tj3XG/eLIqUd7ozgvwCrEbkw2XMSw67X3aOkecOXQi5d/asJxlWI2u7bwlK9ooFQzK4wIHsBC9 ba8OKFUJGvqjzjWvibxqdHgkzpH4eEhHSubz0BTOX+CsNqKA1SPt7anIZWrVJxR0tdNcZP+fFm aihof5aZtfD3RvtOervv0xoY78AfDdMp3D3ukYrMJwhEJ5hOZ2ThevmPg7X0HjkZkMPVtTnQQ4 J3t6+Mm7cAmSgk07xGKIyYeArJk3u0J3shrWrOYA+RIXNEpS10WQvmTRdpC1Mqc6rfgaOszSkN bro= X-IronPort-AV: E=Sophos;i="5.76,408,1592841600"; d="scan'208";a="148131952" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Sep 2020 15:18:07 +0800 IronPort-SDR: EW3ykoL4kFhNhAxpfHNe9vY7ghhpxYmRDeUKTtm0Lyt/JSfh6ox/fnnb7G4KUiimUfNu/aV48Z BERkXP2dvWcg== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 00:04:32 -0700 IronPort-SDR: TN5XQ0T+6w4JJ5Ou0aZrmQGiQ4CR8DoFWrd2WVfhEJSE6Cukj2V1aWe5JXI6G6yIB7J51kQ/m4 fjvyI8ZkLpEw== WDCIronportException: Internal Received: from 6hj08h2.ad.shared (HELO localhost.hgst.com) ([10.84.70.99]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Sep 2020 00:18:06 -0700 From: Damien Le Moal To: devel@uclibc-ng.org, Waldemar Brodkorb Date: Wed, 9 Sep 2020 16:18:03 +0900 Message-Id: <20200909071804.35932-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909071804.35932-1-damien.lemoal@wdc.com> References: <20200909071804.35932-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [uclibc-ng-devel] [PATCH 1/2] utils/getconf: Fix compilation error X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" In the main() function, all cases of the "switch (specs[i].num)" switch-case are all conditionally defined. Depending on the target environementi, none of them may endup being defined, resulting in the code block before the no-op default case to generate a "warning: statement will never be executed" compilation error. Avoid this by conditionally defining this code block with the macro DO_GETCONF_NAME which is itself defined if any of the switc cases is defined too. Signed-off-by: Damien Le Moal --- utils/getconf.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/utils/getconf.c b/utils/getconf.c index 3dd3d75d9..b8d00f90f 100644 --- a/utils/getconf.c +++ b/utils/getconf.c @@ -1154,7 +1154,6 @@ environment SPEC.\n\n"); const char *spec = NULL; char buf[sizeof "POSIX_V6_LPBIG_OFFBIG"]; - char *argv0 = argv[0]; if (argc > 1 && strncmp (argv[1], "-v", 2) == 0) { if (argv[1][2] == '\0') @@ -1199,42 +1198,56 @@ environment SPEC.\n\n"); switch (specs[i].num) { +#undef DO_GETCONF_NAME #if !defined(_XBS5_ILP32_OFF32) && defined(_SC_XBS5_ILP32_OFF32) +#define DO_GETCONF_NAME case _SC_XBS5_ILP32_OFF32: #endif #if !defined(_XBS5_ILP32_OFFBIG) && defined(_SC_XBS5_ILP32_OFFBIG) +#define DO_GETCONF_NAME case _SC_XBS5_ILP32_OFFBIG: #endif #if !defined(_XBS5_LP64_OFF64) && defined(_SC_XBS5_LP64_OFF64) +#define DO_GETCONF_NAME case _SC_XBS5_LP64_OFF64: #endif #if !defined(_XBS5_LPBIG_OFFBIG) && defined(_SC_XBS5_LPBIG_OFFBIG) +#define DO_GETCONF_NAME case _SC_XBS5_LPBIG_OFFBIG: #endif #if !defined(_POSIX_V6_ILP32_OFF32) && defined(_SC_V6_ILP32_OFF32) +#define DO_GETCONF_NAME case _SC_V6_ILP32_OFF32: #endif #if !defined(_POSIX_V6_ILP32_OFFBIG) && defined(_SC_V6_ILP32_OFFBIG) +#define DO_GETCONF_NAME case _SC_V6_ILP32_OFFBIG: #endif #if !defined(_POSIX_V6_LP64_OFF64) && defined(_SC_V6_LP64_OFF64) +#define DO_GETCONF_NAME case _SC_V6_LP64_OFF64: #endif #if !defined(_POSIX_V6_LPBIG_OFFBIG) && defined(_SC_V6_LPBIG_OFFBIG) +#define DO_GETCONF_NAME case _SC_V6_LPBIG_OFFBIG: #endif #if !defined(_POSIX_V7_ILP32_OFF32) && defined(_SC_V7_ILP32_OFF32) +#define DO_GETCONF_NAME case _SC_V7_ILP32_OFF32: #endif #if !defined(_POSIX_V7_ILP32_OFFBIG) && defined(_SC_V7_ILP32_OFFBIG) +#define DO_GETCONF_NAME case _SC_V7_ILP32_OFFBIG: #endif #if !defined(_POSIX_V7_LP64_OFF64) && defined(_SC_V7_LP64_OFF64) +#define DO_GETCONF_NAME case _SC_V7_LP64_OFF64: #endif #if !defined(_POSIX_V7_LPBIG_OFFBIG) && defined(_SC_V7_LPBIG_OFFBIG) +#define DO_GETCONF_NAME case _SC_V7_LPBIG_OFFBIG: #endif +#ifdef DO_GETCONF_NAME { const char *args[argc + 3]; size_t spec_len = strlen (spec); @@ -1242,14 +1255,15 @@ environment SPEC.\n\n"); memcpy (mempcpy (mempcpy (getconf_name, getconf_dir, getconf_dirlen), "/", 1), spec, spec_len + 1); - args[0] = argv0; + args[0] = argv[0]; args[1] = "-v"; args[2] = spec; memcpy (&args[3], &argv[1], argc * sizeof (argv[1])); execv (getconf_name, (char * const *) args); error (4, errno, _("Couldn't execute %s"), getconf_name); } - default: +#endif + default: break; } } From patchwork Wed Sep 9 07:18:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1360359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=Vmmn11SM; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmYJy5xbHz9sSJ for ; Wed, 9 Sep 2020 17:18:26 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 4E26F102D1; Wed, 9 Sep 2020 09:18:14 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by helium.openadk.org (Postfix) with ESMTPS id 6769B102A9; Wed, 9 Sep 2020 09:18:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599635891; x=1631171891; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=2zABN4BKvMBRZSYIscsUoOAkI+UcfFR5cLc0SX/8UTs=; b=Vmmn11SMYT2gDXh+MtbZplOxCis9UR4X9cJc1zepfVc8e5eB8Rzz/3js 0o9SKf9Wjrbkg9pFNlDaArYGz8ieX4Q1aRkhJDw3/EmfjyynyhvibpyJJ jjgChmulKHQ7v1PfRX2zeB8FrNOV/VEBDY+66P5+VrnoDjLw9NnqPFrjH 2SGtGXiStcgjPx5+QI3UrsrfAqHXecNg+UO53V/Ob4eJNfx3kTaBW6m0A sCo7vfvLeq4viFkuRELwgMML6R8nHtGDkPSR1vhSGshtYmHfiQI7hB009 sozDUGqpQgTaJ1PU4MK2BsalSHkF0wr2sSwuQvJUBeQZnaC6LCj1+OHPH g==; IronPort-SDR: lywAGhm8CTVfuy1Orn6YBtJOo19lce3xj1rGhJCMfNWiTKDpwPk1kKQxiUrbPQjwM9oQCWvwuI hiU8vG0PEeZr31rqqvYAOtQOuKOTnzlR7gdzkP/soI2iaX0O333s8OzFqfMeGZwxOkF/SoJWZI CaX7pEGEPLaO9kggRMCjzAzlazteCoUDiVq72yFAAdMdCfn8ej4DG16TiEGEZSc/WiBZUvx2Oz JZMdm5V0C4dgbxUIWQm6HOLJA5AMamxlWJZIG5U1i6JueRhE5cE15dgJUtC7LtKeR0YAnjQseM qhE= X-IronPort-AV: E=Sophos;i="5.76,408,1592841600"; d="scan'208";a="148131953" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Sep 2020 15:18:08 +0800 IronPort-SDR: UTSnjTUrA4e76eiQ7loAksMk+wB5kexhpBQKsCm5DiBv4daQLG5+r0FPwVl036LtehqCrxhZU3 TMX923yk+5Ng== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 00:04:33 -0700 IronPort-SDR: ePJ6LCZvQauO0Ah4q3albYjysPEkiIIaDlo55onmZRETBcFlEGRWvX749ent4waMR0gF/JCwcx Ej/gBA30SG1w== WDCIronportException: Internal Received: from 6hj08h2.ad.shared (HELO localhost.hgst.com) ([10.84.70.99]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Sep 2020 00:18:07 -0700 From: Damien Le Moal To: devel@uclibc-ng.org, Waldemar Brodkorb Date: Wed, 9 Sep 2020 16:18:04 +0900 Message-Id: <20200909071804.35932-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909071804.35932-1-damien.lemoal@wdc.com> References: <20200909071804.35932-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [uclibc-ng-devel] [PATCH 2/2] librt: avoid compilation error X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" For NOMMU builds, LIBC_CANCEL_ASYNC and LIBC_CANCEL_RESET are not defined. Prevent these macros from being visible by the compiler in clock_nanosleep() by replacing "if (SINGLE_THREAD_P) {" with the pre-compiler directive "#if defined(SINGLE_THREAD_P)". Signed-off-by: Damien Le Moal --- librt/clock_nanosleep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/librt/clock_nanosleep.c b/librt/clock_nanosleep.c index 4cf1e06b4..1515cf5b0 100644 --- a/librt/clock_nanosleep.c +++ b/librt/clock_nanosleep.c @@ -36,9 +36,9 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, if (clock_id == CLOCK_PROCESS_CPUTIME_ID) clock_id = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED); - if (SINGLE_THREAD_P) +#if defined(SINGLE_THREAD_P) r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req, rem); - else +#else { int oldstate = LIBC_CANCEL_ASYNC (); @@ -47,6 +47,7 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, LIBC_CANCEL_RESET (oldstate); } +#endif return (INTERNAL_SYSCALL_ERROR_P (r, err) ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);