From patchwork Mon Jun 3 12:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 1109225 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="yn9sqRT2"; 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 45HZ9M1rt1z9s4V for ; Mon, 3 Jun 2019 22:28:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6FE4C85BEC; Mon, 3 Jun 2019 12:28:53 +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 gMW5gANKCAIn; Mon, 3 Jun 2019 12:28:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5924B85CBC; Mon, 3 Jun 2019 12:28:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 728C31BF4E6 for ; Mon, 3 Jun 2019 12:28:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6FAEA220DA for ; Mon, 3 Jun 2019 12:28:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6xLzgWwQw1km for ; Mon, 3 Jun 2019 12:28:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by silver.osuosl.org (Postfix) with ESMTPS id 154761FF11 for ; Mon, 3 Jun 2019 12:28:49 +0000 (UTC) Received: from localhost.localdomain (unknown [223.93.147.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 502FD2541D; Mon, 3 Jun 2019 12:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559564928; bh=DGiZVUG7fCVtJmewJp9u5pp1IYc3KUnI9ZUKKWM7csY=; h=From:To:Cc:Subject:Date:From; b=yn9sqRT27La0Xcy+9InyMH6LC7I91lF7Gf2aFFOddjVKryUTeEBsxhRBexCgZLpnH f29St/jKGLF+BbBqGmpXB7IC4bNHPx4LUrKFlXYC31+zJkGJKMxGlIyw7S6Mvgx13g qxfYko9EoknCesb2ywHmX1IIMnP4JR5j8w0N3qDI= From: guoren@kernel.org To: Thomas Petazzoni , Thomas De Schampheleire , arnout@mind.be Date: Mon, 3 Jun 2019 20:28:06 +0800 Message-Id: <1559564887-4088-1-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH 1/2] package/qemu: Move patches to version directory 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: Guo Ren , zhiwei_liu@c-sky.com, linux-csky@vger.kernel.org, buildroot@buildroot.org MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Guo Ren Signed-off-by: Guo Ren Cc: Thomas Petazzoni --- ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 ------------- .../qemu/0002-configure-improve-usbfs-check.patch | 60 ---------------------- ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 +++++++++++++ .../3.1.0/0002-configure-improve-usbfs-check.patch | 60 ++++++++++++++++++++++ 4 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch delete mode 100644 package/qemu/0002-configure-improve-usbfs-check.patch create mode 100644 package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch create mode 100644 package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch diff --git a/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch b/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch deleted file mode 100644 index a0c4a62..0000000 --- a/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch +++ /dev/null @@ -1,35 +0,0 @@ -From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Fri, 5 May 2017 09:07:15 +0200 -Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc - -user-exec.c has some conditional code to decide how to use the -mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but -with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path -gets used, which doesn't apply to uClibc. - -Fix this by excluding __UCLIBC__, which ensures we fall back to the -general case of using uc_mcontext.arm_pc, which works fine with -uClibc. - -Signed-off-by: Thomas Petazzoni ---- - user-exec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c -index 6db0758..2b3d116 100644 ---- a/accel/tcg/user-exec.c -+++ b/accel/tcg/user-exec.c -@@ -463,7 +463,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, - - #if defined(__NetBSD__) - pc = uc->uc_mcontext.__gregs[_REG_R15]; --#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) -+#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) - pc = uc->uc_mcontext.gregs[R15]; - #else - pc = uc->uc_mcontext.arm_pc; --- -2.7.4 - diff --git a/package/qemu/0002-configure-improve-usbfs-check.patch b/package/qemu/0002-configure-improve-usbfs-check.patch deleted file mode 100644 index d693b5d..0000000 --- a/package/qemu/0002-configure-improve-usbfs-check.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 9672cccd64c446369b5649fe23d575917638be46 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Tue, 5 Feb 2019 15:07:43 +0100 -Subject: [PATCH] configure: improve usbfs check - -The current check to test if usbfs support should be compiled or not -solely relies on the presence of , without -actually checking that all definition used by Qemu are provided by -this header file. - -With sufficiently old kernel headers, may be -present, but some of the definitions needed by Qemu may not be -available. - -This commit improves the check by building a small program that -actually tests whether the necessary definitions are available. - -In addition, it fixes a bug where have_usbfs was set to "yes" -regardless of the result of the test. - -Signed-off-by: Thomas Petazzoni ---- - configure | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index 3d89870d99..799c8e3b08 100755 ---- a/configure -+++ b/configure -@@ -4266,10 +4266,25 @@ fi - # check for usbfs - have_usbfs=no - if test "$linux_user" = "yes"; then -- if check_include linux/usbdevice_fs.h; then -+ cat > $TMPC << EOF -+#include -+ -+#ifndef USBDEVFS_GET_CAPABILITIES -+#error "USBDEVFS_GET_CAPABILITIES undefined" -+#endif -+ -+#ifndef USBDEVFS_DISCONNECT_CLAIM -+#error "USBDEVFS_DISCONNECT_CLAIM undefined" -+#endif -+ -+int main(void) -+{ -+ return 0; -+} -+EOF -+ if compile_prog "" ""; then - have_usbfs=yes - fi -- have_usbfs=yes - fi - - # check for fallocate --- -2.20.1 - diff --git a/package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch b/package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch new file mode 100644 index 0000000..a0c4a62 --- /dev/null +++ b/package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch @@ -0,0 +1,35 @@ +From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Fri, 5 May 2017 09:07:15 +0200 +Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc + +user-exec.c has some conditional code to decide how to use the +mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but +with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path +gets used, which doesn't apply to uClibc. + +Fix this by excluding __UCLIBC__, which ensures we fall back to the +general case of using uc_mcontext.arm_pc, which works fine with +uClibc. + +Signed-off-by: Thomas Petazzoni +--- + user-exec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c +index 6db0758..2b3d116 100644 +--- a/accel/tcg/user-exec.c ++++ b/accel/tcg/user-exec.c +@@ -463,7 +463,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, + + #if defined(__NetBSD__) + pc = uc->uc_mcontext.__gregs[_REG_R15]; +-#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) ++#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) + pc = uc->uc_mcontext.gregs[R15]; + #else + pc = uc->uc_mcontext.arm_pc; +-- +2.7.4 + diff --git a/package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch b/package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch new file mode 100644 index 0000000..d693b5d --- /dev/null +++ b/package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch @@ -0,0 +1,60 @@ +From 9672cccd64c446369b5649fe23d575917638be46 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 5 Feb 2019 15:07:43 +0100 +Subject: [PATCH] configure: improve usbfs check + +The current check to test if usbfs support should be compiled or not +solely relies on the presence of , without +actually checking that all definition used by Qemu are provided by +this header file. + +With sufficiently old kernel headers, may be +present, but some of the definitions needed by Qemu may not be +available. + +This commit improves the check by building a small program that +actually tests whether the necessary definitions are available. + +In addition, it fixes a bug where have_usbfs was set to "yes" +regardless of the result of the test. + +Signed-off-by: Thomas Petazzoni +--- + configure | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 3d89870d99..799c8e3b08 100755 +--- a/configure ++++ b/configure +@@ -4266,10 +4266,25 @@ fi + # check for usbfs + have_usbfs=no + if test "$linux_user" = "yes"; then +- if check_include linux/usbdevice_fs.h; then ++ cat > $TMPC << EOF ++#include ++ ++#ifndef USBDEVFS_GET_CAPABILITIES ++#error "USBDEVFS_GET_CAPABILITIES undefined" ++#endif ++ ++#ifndef USBDEVFS_DISCONNECT_CLAIM ++#error "USBDEVFS_DISCONNECT_CLAIM undefined" ++#endif ++ ++int main(void) ++{ ++ return 0; ++} ++EOF ++ if compile_prog "" ""; then + have_usbfs=yes + fi +- have_usbfs=yes + fi + + # check for fallocate +-- +2.20.1 + From patchwork Mon Jun 3 12:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 1109226 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Ps7KAUIT"; 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 45HZ9Q60rPz9s7h for ; Mon, 3 Jun 2019 22:28:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BB42585D8E; Mon, 3 Jun 2019 12:28:56 +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 UabpJUhY_ZUh; Mon, 3 Jun 2019 12:28:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0AADD85D6C; Mon, 3 Jun 2019 12:28:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 354B41BF4E6 for ; Mon, 3 Jun 2019 12:28:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1CD97220DA for ; Mon, 3 Jun 2019 12:28:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CGMrAd4-Z2Qk for ; Mon, 3 Jun 2019 12:28:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by silver.osuosl.org (Postfix) with ESMTPS id 6CE1F1FF11 for ; Mon, 3 Jun 2019 12:28:52 +0000 (UTC) Received: from localhost.localdomain (unknown [223.93.147.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9264C253BF; Mon, 3 Jun 2019 12:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559564932; bh=KJqJpjKOFHNZ7eNHKLEOn3zSzdK7X57B/6WSvoGQGOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ps7KAUITIKbx9fpMCIMEquyxs0qUDBtZpzFMkHBuGEBkjZvVqDARIuZ5qsVFYgZVS MKf9RGapwH9bhPOG9LfPd5/1Skki2Nijl5Hqf77WcGrFo1iPrAhCbkvnGKF3Hk/ibi /6+zHsNhq7ehEAzC3TI6KGCSAphOSuPyvEu4pPZA= From: guoren@kernel.org To: Thomas Petazzoni , Thomas De Schampheleire , arnout@mind.be Date: Mon, 3 Jun 2019 20:28:07 +0800 Message-Id: <1559564887-4088-2-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559564887-4088-1-git-send-email-guoren@kernel.org> References: <1559564887-4088-1-git-send-email-guoren@kernel.org> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/qemu: Add C-SKY qemu support 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: Guo Ren , zhiwei_liu@c-sky.com, linux-csky@vger.kernel.org, buildroot@buildroot.org Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Guo Ren Signed-off-by: Guo Ren Cc: Thomas Petazzoni --- package/qemu/Config.in.host | 1 + package/qemu/qemu.hash | 1 + package/qemu/qemu.mk | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host index 8a0df38..effe58b 100644 --- a/package/qemu/Config.in.host +++ b/package/qemu/Config.in.host @@ -3,6 +3,7 @@ config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS default y if BR2_arm default y if BR2_armeb default y if BR2_aarch64 + default y if BR2_csky default y if BR2_i386 default y if BR2_m68k default y if BR2_microblazeel diff --git a/package/qemu/qemu.hash b/package/qemu/qemu.hash index 338d2ae..9ee9833 100644 --- a/package/qemu/qemu.hash +++ b/package/qemu/qemu.hash @@ -2,3 +2,4 @@ sha256 6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc qemu-3.1.0.tar.xz sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100 COPYING sha256 48ffe9fc7f1d5462dbd19340bc4dd1d8a9e37c61ed535813e614cbe4a5f0d4df COPYING.LIB +sha256 61091767ffd16002e77f005155d096208094e69dee35e6d5ddcaa6c8a13b5e26 qemu-b517e1dc3125a57555d67a8deed9eac7b42288e2.tar.gz diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk index 19bcafa..012406e 100644 --- a/package/qemu/qemu.mk +++ b/package/qemu/qemu.mk @@ -4,9 +4,14 @@ # ################################################################################ +ifeq ($(BR2_csky),y) +QEMU_VERSION = b517e1dc3125a57555d67a8deed9eac7b42288e2 +QEMU_SITE = $(call github,c-sky,qemu,$(QEMU_VERSION)) +else QEMU_VERSION = 3.1.0 QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz QEMU_SITE = http://download.qemu.org +endif QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c QEMU_LICENSE_FILES = COPYING COPYING.LIB # NOTE: there is no top-level license file for non-(L)GPL licenses; @@ -209,6 +214,13 @@ endif ifeq ($(HOST_QEMU_ARCH),sh4aeb) HOST_QEMU_ARCH = sh4eb endif +ifeq ($(HOST_QEMU_ARCH),csky) +ifeq ($(BR2_ck610),y) +HOST_QEMU_ARCH = cskyv1 +else +HOST_QEMU_ARCH = cskyv2 +endif +endif HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH) ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)