From patchwork Thu Oct 17 22:18:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1179035 X-Patchwork-Delegate: thomas.petazzoni@free-electrons.com Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cf3zZE02"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46vNq821Jdz9sP3 for ; Fri, 18 Oct 2019 09:18:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E11F784771; Thu, 17 Oct 2019 22:18:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7IsZcGRWLhXM; Thu, 17 Oct 2019 22:18:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id CEE0284BDF; Thu, 17 Oct 2019 22:18:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2BFB21BF228 for ; Thu, 17 Oct 2019 22:18:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 243D187D6A for ; Thu, 17 Oct 2019 22:18:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SsnN73wEtNcs for ; Thu, 17 Oct 2019 22:18:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id B785487D61 for ; Thu, 17 Oct 2019 22:18:37 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id j11so4085750wrp.1 for ; Thu, 17 Oct 2019 15:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=libDvsNP+CLntmpWpWMOfgHG0pz5OPyh2g/h1Yy8C2A=; b=Cf3zZE02bCfu+xl2ag0PHH+FSM1lzxo7xVprELYJ0p0xwjUifF+ALRGFas2ahGC/rH QpQU37OmbkNqY0xVbo5+4JeAnbRrcO0+CuqEh07dyxpQSdWV3tQbA+5dyBY2AmXWyok/ IY3diEsrWWxDrWy2B/+qm+NIRDuFdhr1bYFrl1gNmMyviGZu2ejK4aflWuPdK1M0pD8Q EhfK33Ps67Zk8ICw5z+v7JB5ZL9q1HD2Jck96o2DM3oURHcapT2fJUkj5Ig35NijR6OZ d0apSU2c+XoA1XTN5qJJ9xInFBym+XLUB0xOYEKWueI454ZuxeNPEReccdPAfsEf1+id +gVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=libDvsNP+CLntmpWpWMOfgHG0pz5OPyh2g/h1Yy8C2A=; b=VtmrOljFL4rUYX7s//JqqyosHLY0VIabU51nqQSYS2f2E2zY0y3WIae3BxAyN6CJs2 aXHUxlbGCEURuyavHXJIs1/gwPxaZWEFAWQcprZREjjyiJ0AyelFofvxm12fO2D1zL6P 5QFVXgcNdQNKGmjsjvpNOluB49tZaQxbAUaBO/xNPx5HPBCINK8LS/pDnqkIPyl22L6P CGOB2A5AinehWu9eOgvfDOSB9j8rtslCliWjwJJNm7RI/s3fuS2tp+sPe5UvBfFpxV6J n3RR/9tOxoFFcZTAiUNUjvdaSU1dfmadANP8Ba7hrOYwUb54bFir+3KPylg5QpJ5a7cf 2AIg== X-Gm-Message-State: APjAAAUprslQOCx312EYbw6G5qf3M/j/kliPnf26v/YGgzLG4oFVupmO bbavAq8iuyxSnhihwEl/HS3UATRfASQ= X-Google-Smtp-Source: APXvYqyxmAlZo+Vlf7CYJYc0CPS09kw1Hvxtx4ZM7Tt2tuHaLc7ZfWh/NQbIcUAWSPvOFwGG2fuUPg== X-Received: by 2002:adf:efc4:: with SMTP id i4mr4689541wrp.56.1571350715410; Thu, 17 Oct 2019 15:18:35 -0700 (PDT) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id g4sm3748020wrw.9.2019.10.17.15.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 15:18:34 -0700 (PDT) From: Petr Vorel To: buildroot@buildroot.org Date: Fri, 18 Oct 2019 00:18:27 +0200 Message-Id: <20191017221827.2852-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/1] package/ltp-testsuite: enable build under musl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This requires to remove a lot of broken code until it's fixed in upstream. Added 2 patches from upcoming release. Signed-off-by: Petr Vorel --- Changes v2->v3: * improve commit message (sorry for noise) Changes v1->v2: * refresh patches * update requirements comment in Config.in (Thomas) * improve code removing unsupported bits (Thomas) Kind regards, Petr ...ine-_GNU_SOURCE-to-fix-build-on-musl.patch | 27 ++++++++++ ...x-missing-__kernel_fsid_t-definition.patch | 41 +++++++++++++++ package/ltp-testsuite/Config.in | 5 +- package/ltp-testsuite/ltp-testsuite.mk | 50 ++++++++++++++++--- 4 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 package/ltp-testsuite/0003-setxattr03-define-_GNU_SOURCE-to-fix-build-on-musl.patch create mode 100644 package/ltp-testsuite/0004-fanotify-Fix-missing-__kernel_fsid_t-definition.patch diff --git a/package/ltp-testsuite/0003-setxattr03-define-_GNU_SOURCE-to-fix-build-on-musl.patch b/package/ltp-testsuite/0003-setxattr03-define-_GNU_SOURCE-to-fix-build-on-musl.patch new file mode 100644 index 0000000000..6b76926a39 --- /dev/null +++ b/package/ltp-testsuite/0003-setxattr03-define-_GNU_SOURCE-to-fix-build-on-musl.patch @@ -0,0 +1,27 @@ +From a712a3930d98336f4a0931ae06da691b7fa0ecd7 Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Mon, 14 Oct 2019 13:02:55 +0200 +Subject: [PATCH] setxattr03: define _GNU_SOURCE to fix build on musl + +musl defines loff_t in and guard it under _GNU_SOURCE. + +Signed-off-by: Petr Vorel +[Upstream status: 3d2b9ef91f32a0a1794a8a05b825b18c6f956b0c] +--- + testcases/kernel/syscalls/setxattr/setxattr03.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/testcases/kernel/syscalls/setxattr/setxattr03.c b/testcases/kernel/syscalls/setxattr/setxattr03.c +index bb511d5ba..58ee0f880 100644 +--- a/testcases/kernel/syscalls/setxattr/setxattr03.c ++++ b/testcases/kernel/syscalls/setxattr/setxattr03.c +@@ -13,6 +13,7 @@ + * -1 and set errno to EPERM + */ + ++#define _GNU_SOURCE + #include "config.h" + #include + #include +-- +2.23.0 diff --git a/package/ltp-testsuite/0004-fanotify-Fix-missing-__kernel_fsid_t-definition.patch b/package/ltp-testsuite/0004-fanotify-Fix-missing-__kernel_fsid_t-definition.patch new file mode 100644 index 0000000000..7450a0af9c --- /dev/null +++ b/package/ltp-testsuite/0004-fanotify-Fix-missing-__kernel_fsid_t-definition.patch @@ -0,0 +1,41 @@ +From b8aebc83523691be2b37e87c62099d700b0473c7 Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Mon, 14 Oct 2019 15:35:53 +0200 +Subject: [PATCH] fanotify: Fix missing __kernel_fsid_t definition + +which is needed for fallback definition when FAN_REPORT_FID is missing. +Instead of including where it's defined we just +define the missing bit. + +This fixes build error at least on musl. + +Acked-by: Cyril Hrubis +Acked-by: Jan Stancek +Suggested-by: Jan Stancek +Signed-off-by: Petr Vorel +[Upstream status: b8aebc83523691be2b37e87c62099d700b0473c7] +--- + testcases/kernel/syscalls/fanotify/fanotify.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h +index 1c7623d3b..435f100d8 100644 +--- a/testcases/kernel/syscalls/fanotify/fanotify.h ++++ b/testcases/kernel/syscalls/fanotify/fanotify.h +@@ -126,6 +126,13 @@ struct fanotify_event_info_header { + }; + + #ifdef HAVE_NAME_TO_HANDLE_AT ++#ifndef __kernel_fsid_t ++typedef struct { ++ int val[2]; ++} lapi_fsid_t; ++#define __kernel_fsid_t lapi_fsid_t ++#endif ++ + struct fanotify_event_info_fid { + struct fanotify_event_info_header hdr; + __kernel_fsid_t fsid; +-- +2.23.0 + diff --git a/package/ltp-testsuite/Config.in b/package/ltp-testsuite/Config.in index 500a8c2688..32e1b6ad76 100644 --- a/package/ltp-testsuite/Config.in +++ b/package/ltp-testsuite/Config.in @@ -12,7 +12,6 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL - depends on !BR2_TOOLCHAIN_USES_MUSL depends on BR2_PACKAGE_LTP_TESTSUITE_ARCH_SUPPORTS select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC @@ -21,7 +20,7 @@ config BR2_PACKAGE_LTP_TESTSUITE http://linux-test-project.github.io -comment "ltp-testsuite needs a glibc or uClibc toolchain w/ NPTL" +comment "ltp-testsuite needs a toolchain w/ NPTL" depends on BR2_PACKAGE_LTP_TESTSUITE_ARCH_SUPPORTS depends on BR2_USE_MMU - depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_TOOLCHAIN_USES_MUSL + depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk index 0c850d2b67..2ab2cd726e 100644 --- a/package/ltp-testsuite/ltp-testsuite.mk +++ b/package/ltp-testsuite/ltp-testsuite.mk @@ -62,15 +62,53 @@ LTP_TESTSUITE_CONF_ENV += \ LIBS="$(LTP_TESTSUITE_LIBS)" \ SYSROOT="$(STAGING_DIR)" -# Requires uClibc bessel support, normally not enabled +# uclibc: bessel support normally not enabled ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) -define LTP_TESTSUITE_REMOVE_UNSUPPORTED - rm -rf $(@D)/testcases/misc/math/float/bessel/ - rm -f $(@D)/testcases/misc/math/float/float_bessel.c -endef -LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED +LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \ + testcases/misc/math/float/bessel/ \ + testcases/misc/math/float/float_bessel.c +else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \ + testcases/kernel/pty/pty01.c \ + testcases/kernel/pty/pty02.c \ + testcases/kernel/pty/ptem01.c \ + testcases/kernel/sched/process_stress/process.c \ + testcases/kernel/syscalls/accept4/accept4_01.c \ + testcases/kernel/syscalls/confstr/confstr01.c \ + testcases/kernel/syscalls/fmtmsg/fmtmsg01.c \ + testcases/kernel/syscalls/getcontext/getcontext01.c \ + testcases/kernel/syscalls/getdents/getdents01.c \ + testcases/kernel/syscalls/getdents/getdents02.c \ + testcases/kernel/syscalls/ioctl/ioctl01.c \ + testcases/kernel/syscalls/ioctl/ioctl02.c \ + testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \ + testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c \ + testcases/kernel/syscalls/timer_create/timer_create01.c \ + testcases/kernel/syscalls/timer_create/timer_create03.c \ + testcases/misc/crash/crash01.c \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svcraw_create/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svctcp_create/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svctcp_create/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svcudp_bufcreate/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svcudp_create/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svcudp_create/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_registerrpc/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_svc_register/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_svc_unregister/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/ \ + testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_seccreate/ \ + utils/benchmark/ebizzy-0.3 endif +define LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES + $(foreach f,$(LTP_TESTSUITE_UNSUPPORTED_TEST_CASES), + rm -rf $(@D)/$(f) + ) +endef + +LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES + # ldd command build system tries to build a shared library unconditionally. ifeq ($(BR2_STATIC_LIBS),y) define LTP_TESTSUITE_REMOVE_LDD