[{"id":23856,"web_url":"https://patchwork.libcamera.org/comment/23856/","msgid":"<CAEmqJPqCQRhV20wqpbkqTDkrs1vNLYr4_LxxDoH=fdNA+L6WHA@mail.gmail.com>","date":"2022-07-13T07:33:29","subject":"Re: [libcamera-devel] [PATCH] libcamera: base: Suppress clang-11\n\tcompile error on ARM32","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nThanks for the updates.\n\nOn Wed, 13 Jul 2022 at 03:03, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> From: Naushir Patuck <naush@raspberrypi.com>\n>\n> Compiling backtrace.cpp for ARM32 produces the following error with the\n> clang-11 (and later) compiler:\n>\n> --------------------\n> ../src/libcamera/base/backtrace.cpp:195:12: error: use of SP or PC in the\n> list is deprecated [-Werror,-Winline-asm]\n>         int ret = unw_getcontext(&uc);\n>                   ^\n> /usr/include/arm-linux-gnueabihf/libunwind-common.h:114:29: note: expanded\n> from macro 'unw_getcontext'\n>                                         ^\n> /usr/include/arm-linux-gnueabihf/libunwind-arm.h:270:5: note: expanded\n> from macro 'unw_tdep_getcontext'\n>     \"stmia %[base], {r0-r15}\"                                           \\\n>     ^\n> <inline asm>:1:2: note: instantiated into assembly here\n>         stmia r0, {r0-r15}\n> --------------------\n>\n> Suppress this compilation error with a clang-specific pragma around the\n> offending statements.\n>\n> Further information about this error can be found at\n> https://github.com/dotnet/runtime/issues/38652\n\n\nAs mentioned in the last email, I did mean to refer to\nhttps://github.com/dotnet/runtime/issues/5595\n\nBut your link is also related, so happy to keep it (or both).\n\n\n>\n>\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=136\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Tested-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n\nReviewed-by: Naushir Patuck <naush@rasbperrypi.com>\nTested-by: Naushir Patuck <naush@rasbperrypi.com>\n\n\n> ---\n>  src/libcamera/base/backtrace.cpp | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n>\n> diff --git a/src/libcamera/base/backtrace.cpp\n> b/src/libcamera/base/backtrace.cpp\n> index 483492c390c3..be30589d255e 100644\n> --- a/src/libcamera/base/backtrace.cpp\n> +++ b/src/libcamera/base/backtrace.cpp\n> @@ -191,10 +191,22 @@ __attribute__((__noinline__))\n>  bool Backtrace::unwindTrace()\n>  {\n>  #if HAVE_UNWIND\n> +/*\n> + * unw_getcontext() for ARM32 is an inline assembly function using the\n> stmia\n> + * instruction to store SP and PC. This is considered by clang-11 as\n> deprecated,\n> + * and generates a warning.\n> + */\n> +#ifdef __clang__\n> +#pragma clang diagnostic push\n> +#pragma clang diagnostic ignored \"-Winline-asm\"\n> +#endif\n>         unw_context_t uc;\n>         int ret = unw_getcontext(&uc);\n>         if (ret)\n>                 return false;\n> +#ifdef __clang__\n> +#pragma clang diagnostic pop\n> +#endif\n>\n>         unw_cursor_t cursor;\n>         ret = unw_init_local(&cursor, &uc);\n>\n> base-commit: ba6435930f08e802cffc688d90f156a8959a0f86\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3477CBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Jul 2022 07:33:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9420463311;\n\tWed, 13 Jul 2022 09:33:37 +0200 (CEST)","from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com\n\t[IPv6:2a00:1450:4864:20::22e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 700B16330A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Jul 2022 09:33:36 +0200 (CEST)","by mail-lj1-x22e.google.com with SMTP id bn33so12486444ljb.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Jul 2022 00:33:36 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657697617;\n\tbh=N8OzMcW5TZldnSb8jw/FENX0FBby3YlfAKInH+MXL6M=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=LCsMFkGq6p9bct+xqHI0qxbQvpPtteX20TqrE50lxUtO8f6RbDfbxjvlc32+ZALh2\n\tJtvzC1NauKe6T1G/2U7cVb+UMwnbQZx935vUAoUWdf/6wMJfMmjAMM961tL1VMU2Kq\n\tbv3urrrxBnI6UUfFm1RixcHpFVgKW9VGdy25R5ZOP15LrHp1UrbZnCPzKWSoD05VF8\n\tIMZio6iK31i4n9ZX/SPWc1bG89nDPnOgO6JIPOh2oGxRPc1QOkX4KknSP4wwFW6WRN\n\tuBslun7poTMKz1nuCFBjb7DE+snJp88whVgIh1z1AlDB+5096KD5mcLcT9pK80xLRM\n\t98ppRV7glaiew==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=DpcuwozGn6mhODKOmKHXxK2pCu3TLN50jIIisiHnV5o=;\n\tb=cRFN3VzT5UPkJyZwTvSZU/epbdrzZWR7pb0hqNZEREx6o1eqxD7zIy9OoaJO9jcmzd\n\tAy8mjSOaIkxnoBOam3Kri2x3Vw/pY0IwWx8PmzWymMdbndpbzhFAgKxvaF2C4bkGDMg6\n\tnUZ8lhAqNSR+vzMe/qHAVI3r6uQ06tcR/WugMZCgOsqUjqMsIQZRCXcUrhvKZJgwvHOz\n\ts1yHklOshUcUpESmWJD5RRrYTMAzLg1ZoHTuYLjg/yxmghL1qnPVfBtfW3aIFeUZW/qg\n\t18Iz91+ta6B8gwGHOzUg4Se9zalWRshLYi1t6IYzyD/miNXFulBoxZ6UKrxMu42s3jOC\n\t0yZg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"cRFN3VzT\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=DpcuwozGn6mhODKOmKHXxK2pCu3TLN50jIIisiHnV5o=;\n\tb=cre4IB9E96P/FEf9yJLM54qDFcQSeRKFL6y1Q3v3alz5zMTR5dAGauZIXhYQReKA90\n\ttBKpQCCMj6p92R3OzLXWRABkKCm8UXDBxzK1VhpbuoE8soypUF2ycK3QiQj+7Yjvuyqj\n\tZ8azBbTuz2Z4Xm8p9efoP8JOUjdOEtZdiOxMtTTzFb6Jc/zGmhqnWOxJelkktM9e05S6\n\t9FtLnQQPOP66Ii7Q2RELXdk1xR1/jGXN1YiOuRvPaeXSNegJuwL0anGmRQjt8+HD8Cus\n\t2dm4TE8KfW/Ye690eOMZVauAVRIn3MEmTq+QFb8u66ae14hDLOqA47xwkDXJFDVI8fOM\n\ti0BQ==","X-Gm-Message-State":"AJIora9vViVmJTzYo1MD4ioc41Tkrk/ZwTQz533oWv2zrgyg2YHnKRwX\n\ts8AGw4TEYTGyBOG4do5W8XLrKf2Oj0uOWYj70L8u9A==","X-Google-Smtp-Source":"AGRyM1vDGNA5Bo8RwNfyIKH6k9/0MAXNSyCQrxggJKk0KsopC9vP0mnIl3mdEG6+OIUPfNBu7wBpqPpjgxvalK9XVwg=","X-Received":"by 2002:a2e:a303:0:b0:25d:644c:9d7a with SMTP id\n\tl3-20020a2ea303000000b0025d644c9d7amr933608lje.426.1657697615762;\n\tWed, 13 Jul 2022 00:33:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20220713020320.19636-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220713020320.19636-1-laurent.pinchart@ideasonboard.com>","Date":"Wed, 13 Jul 2022 08:33:29 +0100","Message-ID":"<CAEmqJPqCQRhV20wqpbkqTDkrs1vNLYr4_LxxDoH=fdNA+L6WHA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000886a1205e3aacddf\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: base: Suppress clang-11\n\tcompile error on ARM32","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]