From nobody Sat May 4 14:41:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600048206; cv=none; d=zohomail.com; s=zohoarc; b=ISQRi+SQV/FLMEdgWTm/9AIEnlLXEmQAhr93KbCt/gcAquxkiETmwC2qF2RwqJD78SrlU3lRqO28aSWJAILuIPiWNruOUOUg+0TCso/JCFqYTojCz9xCTSPhuGqzHWXBGFcAEkWeK7K4++uNC54tAzauWu+PjoyvOLfckwP1FVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600048206; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=5lzhnz/LWRZ9eAbfuvQwAj7H+iiUKib80nurC+lFUwo=; b=AyLz3dd3Ci8nf7Hm6GqycmZeCgvhzu7PiRdddhCQsxZd7ypQ130OxpnHzCkkfwtVkAugc1zWhb0zFcz8uvCRT50c25TCah5G9ouXTtRRLxEvhCyrCHFeZHEbg8Xr60mu43iPKEBTVDLJTzVsuCbnrGR25hm+b1TIG5xiUpkTBak= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600048206897357.7136933589328; Sun, 13 Sep 2020 18:50:06 -0700 (PDT) Received: from localhost ([::1]:57858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHdd7-0000em-OK for importer@patchew.org; Sun, 13 Sep 2020 21:50:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHdcb-0000Ep-At for qemu-devel@nongnu.org; Sun, 13 Sep 2020 21:49:33 -0400 Received: from mail5.windriver.com ([192.103.53.11]:43450 helo=mail5.wrs.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHdcY-0007IV-Ik for qemu-devel@nongnu.org; Sun, 13 Sep 2020 21:49:32 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 08E1n5B9027605 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 13 Sep 2020 18:49:16 -0700 Received: from pek-lpg-core2.corp.ad.wrs.com (128.224.153.41) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.487.0; Sun, 13 Sep 2020 18:48:55 -0700 From: To: Subject: [PATCH] lockable.h: always define unknown_lock_type Date: Mon, 14 Sep 2020 09:42:36 +0800 Message-ID: <20200914014236.2355289-1-mingli.yu@windriver.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.103.53.11; envelope-from=Mingli.Yu@windriver.com; helo=mail5.wrs.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/13 21:49:26 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mingli Yu There comes below build failure when use gcc 10.1.0 and "-Og" passed to compiler. | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld= .bfd: /mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1= .0/fsdev/qemu-fsdev-throttle.c:25: undefined reference to `unknown_lock_typ= e' | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld= .bfd: ../fsdev/qemu-fsdev-throttle.o: in function `fsdev_co_throttle_reques= t': | /mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/= fsdev/qemu-fsdev-throttle.c:103: undefined reference to `unknown_lock_type' | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld= .bfd: ../fsdev/qemu-fsdev-throttle.o:/mnt/build/tmp/work/x86_64-linux/qemu-= system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103: more und= efined references to `unknown_lock_type' follow | collect2: error: ld returned 1 exit status So always define unknown_lock_type to fix the above error. Signed-off-by: Mingli Yu --- include/qemu/lockable.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h index b620023141..e792ed9a69 100644 --- a/include/qemu/lockable.h +++ b/include/qemu/lockable.h @@ -25,17 +25,12 @@ struct QemuLockable { }; =20 /* This function gives an error if an invalid, non-NULL pointer type is pa= ssed - * to QEMU_MAKE_LOCKABLE. For optimized builds, we can rely on dead-code = elimination - * from the compiler, and give the errors already at link time. + * to QEMU_MAKE_LOCKABLE. */ -#if defined(__OPTIMIZE__) && !defined(__SANITIZE_ADDRESS__) -void unknown_lock_type(void *); -#else static inline void unknown_lock_type(void *unused) { abort(); } -#endif =20 static inline __attribute__((__always_inline__)) QemuLockable * qemu_make_lockable(void *x, QemuLockable *lockable) --=20 2.26.2