From patchwork Wed Jul 13 02:03:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16597 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3655EBE173 for ; Wed, 13 Jul 2022 02:03:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 979A06330F; Wed, 13 Jul 2022 04:03:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657677837; bh=G4q/KTyhoEC034/ymuEHsZDqlTDQU45oNfLGvGsepbo=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=4YqcneRNt0/kZ75SiDwZQGGN46oTFXd/q+bL8AdiPKEfhEMbQGwaaELdTPhmgz6Da eIfOUMM4JJq08J8z3ZlXxvunER8N7xS1jcJDvobM2k4Rvp20dYQJzi/LTmQs4SxRRA NrJWbBlZAs9Q6Fd6KppvZS4JBD9IadAjBRs3v4brAkm7zB3iFNd4aGfF/mI3k0In1w 7bbyAQDiqNMym5donpfFmV95v6LNgxn7u4VZod0cC24IWn6xNSK0q1otnumEOU+yPU TQJbtCNE8K3qibYI9dIduF4RBv2H4EYL6i+sDURTeTgcbuswaZ9tTl5LVt+Avg6UKt Yc1lkRtWHq6rQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 78DD76048B for ; Wed, 13 Jul 2022 04:03:56 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S0uJ0ul+"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B4189305; Wed, 13 Jul 2022 04:03:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1657677836; bh=G4q/KTyhoEC034/ymuEHsZDqlTDQU45oNfLGvGsepbo=; h=From:To:Cc:Subject:Date:From; b=S0uJ0ul+4dnScTJIBBWFBjBnS4b80zxBEohSdbj6I2HFtSm0E6GM5hp+fVmykPP0S JwpPT6rB5kbK2Ga7KP6TLdzVoF0EKLlsFLP11nkPjgd9KCd3yW+b7tH06FKf1GDdKL gA3AmULgRsYhqQKRshGV6yXdTs667L7BWHq3vKWA= To: libcamera-devel@lists.libcamera.org Date: Wed, 13 Jul 2022 05:03:20 +0300 Message-Id: <20220713020320.19636-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: base: Suppress clang-11 compile error on ARM32 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Naushir Patuck Compiling backtrace.cpp for ARM32 produces the following error with the clang-11 (and later) compiler: -------------------- ../src/libcamera/base/backtrace.cpp:195:12: error: use of SP or PC in the list is deprecated [-Werror,-Winline-asm] int ret = unw_getcontext(&uc); ^ /usr/include/arm-linux-gnueabihf/libunwind-common.h:114:29: note: expanded from macro 'unw_getcontext' ^ /usr/include/arm-linux-gnueabihf/libunwind-arm.h:270:5: note: expanded from macro 'unw_tdep_getcontext' "stmia %[base], {r0-r15}" \ ^ :1:2: note: instantiated into assembly here stmia r0, {r0-r15} -------------------- Suppress this compilation error with a clang-specific pragma around the offending statements. Further information about this error can be found at https://github.com/dotnet/runtime/issues/38652 Bug: https://bugs.libcamera.org/show_bug.cgi?id=136 Signed-off-by: Naushir Patuck Tested-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Naushir Patuck Tested-by: Naushir Patuck --- src/libcamera/base/backtrace.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) base-commit: ba6435930f08e802cffc688d90f156a8959a0f86 diff --git a/src/libcamera/base/backtrace.cpp b/src/libcamera/base/backtrace.cpp index 483492c390c3..be30589d255e 100644 --- a/src/libcamera/base/backtrace.cpp +++ b/src/libcamera/base/backtrace.cpp @@ -191,10 +191,22 @@ __attribute__((__noinline__)) bool Backtrace::unwindTrace() { #if HAVE_UNWIND +/* + * unw_getcontext() for ARM32 is an inline assembly function using the stmia + * instruction to store SP and PC. This is considered by clang-11 as deprecated, + * and generates a warning. + */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Winline-asm" +#endif unw_context_t uc; int ret = unw_getcontext(&uc); if (ret) return false; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif unw_cursor_t cursor; ret = unw_init_local(&cursor, &uc);