From patchwork Wed Feb 5 11:45:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2757 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48CKWp2Fqvz3xyL for ; Wed, 5 Feb 2020 11:45:58 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48CKWm0Yp4z6Zf; Wed, 5 Feb 2020 11:45:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48CKWl4zyzz2yqy; Wed, 5 Feb 2020 11:45:55 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48CKWj1btwz2yW9 for ; Wed, 5 Feb 2020 11:45:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48CKWh3hFPz6ZQ; Wed, 5 Feb 2020 11:45:52 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1580903152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m/t5hcMJl3eI5RvHW4d5RmLS67WQjxiwC5TQRpI0zSg=; b=0SXNVbALjbvE7Lt2NtWw9R6Qf4HR4icuSr3qwtYAUbW8gMTxui9bsErweRplXE5RpBUcQS ofmh2OT9EDszNLAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1580903152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m/t5hcMJl3eI5RvHW4d5RmLS67WQjxiwC5TQRpI0zSg=; b=Ou0ekeK1U0CUVQ0cgDrgoVADja+4B9WW/fgL9IZ1OVboevOWQYWX4cudQ5epeGIBAAujHh FmJfumE+TYDkHO4GhP3FdWnGQ4iU3wpBXikUtEPMhuChWufoHsLsUV/chd+520ATa8tVbv GrMDw4ok4UBjZRIoRrPc5zlkSy/kdczXTyIY2IFRt/qLw/HtSe1+0IvipCcEGRaWpbI2Pr w9JFngKlW/cETW36nD1UxTGKutOPEIMPcqgRBZUvvJ4/X2o/6RC8e8tdAW8XqEwJhpNVIH iKeUKkVb9qgBoUisjupYcbNRjL3azNrdkYLIRRUxuXKmerDmM0kMtN/vOLuV5g== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/5] qemu: Fix build against glibc >= 2.31 Date: Wed, 5 Feb 2020 11:45:45 +0000 Message-Id: <20200205114547.16047-3-michael.tremer@ipfire.org> In-Reply-To: <20200205114547.16047-1-michael.tremer@ipfire.org> References: <20200205114547.16047-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- lfs/qemu | 1 + .../qemu-4.1.0-build-fix-glibc-2.31.patch | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/patches/qemu-4.1.0-build-fix-glibc-2.31.patch diff --git a/lfs/qemu b/lfs/qemu index a6b203029..2af66fbcc 100644 --- a/lfs/qemu +++ b/lfs/qemu @@ -78,6 +78,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/qemu-4.1.0-build-fix-glibc-2.31.patch cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/etc \ --localstatedir=/var --enable-kvm --disable-bluez --disable-attr \ --target-list="i386-linux-user x86_64-linux-user arm-linux-user i386-softmmu x86_64-softmmu arm-softmmu" \ diff --git a/src/patches/qemu-4.1.0-build-fix-glibc-2.31.patch b/src/patches/qemu-4.1.0-build-fix-glibc-2.31.patch new file mode 100644 index 000000000..37c744d3b --- /dev/null +++ b/src/patches/qemu-4.1.0-build-fix-glibc-2.31.patch @@ -0,0 +1,65 @@ +From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Tue, 12 Nov 2019 15:25:56 +0100 +Subject: [PATCH] linux-user: remove host stime() syscall + +stime() has been withdrawn from glibc +(12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") + +Implement the target stime() syscall using host +clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. + +Tested qemu-ppc/x86_64 with: + + #include + #include + + int main(void) + { + time_t t; + int ret; + + /* date -u -d"2019-11-12T15:11:00" "+%s" */ + t = 1573571460; + ret = stime(&t); + printf("ret %d\n", ret); + return 0; + } + + # date; ./stime; date + Tue Nov 12 14:18:32 UTC 2019 + ret 0 + Tue Nov 12 15:11:00 UTC 2019 + +Buglink: https://bugs.launchpad.net/qemu/+bug/1852115 +Reported-by: Cole Robinson +Signed-off-by: Laurent Vivier +Reviewed-by: Peter Maydell +Message-Id: <20191112142556.6335-1-laurent@vivier.eu> +--- + linux-user/syscall.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 4e97bcf..ce399a5 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -7764,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, + #ifdef TARGET_NR_stime /* not on alpha */ + case TARGET_NR_stime: + { +- time_t host_time; +- if (get_user_sal(host_time, arg1)) ++ struct timespec ts; ++ ts.tv_nsec = 0; ++ if (get_user_sal(ts.tv_sec, arg1)) { + return -TARGET_EFAULT; +- return get_errno(stime(&host_time)); ++ } ++ return get_errno(clock_settime(CLOCK_REALTIME, &ts)); + } + #endif + #ifdef TARGET_NR_alarm /* not on alpha */ +-- +1.8.3.1 +