From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B49BC433EF for ; Sun, 23 Jan 2022 11:36:28 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nBbAP-0006b0-Eg; Sun, 23 Jan 2022 06:36:17 -0500 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.94.2) (envelope-from ) id 1nBbAN-0006as-2i for kernelnewbies@kernelnewbies.org; Sun, 23 Jan 2022 06:36:15 -0500 Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 23 Jan 2022 20:36:10 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send002-relay.gov-dooray.com with SMTP id bf25181161ed3daa; Sun, 23 Jan 2022 20:36:10 +0900 DKIM-Signature: a=rsa-sha256; b=HslQIULugjjMqXsbhN/RMU6tyfpwMo/gaylIKMrZiPnIby4hkySBzOqo7UHlkjv09h3E4PoAwf rTpt939A4QWcLgBVIHKDegyuCKnG71BXFITCbuJo3fr7PDfT6OvsDWl3y6P0Pee1Dv8rKSHKKmWi uGc3IlGBIs3a9eQ0Zv8e8s9PoZ61MgrhbmlgNO1owzcrYgpABIesmLMdaNDs34PBwLQr7WjdY6u1 PCd6PHWTahZDvl44icXmPUe4v4/bsYJPs2IvPyVO3R3drqgKJrgRbKAdBL8RakQHPgFcb3a0jSu8 TpeTDGO7Iexxj2XFCY9FEmDgUVNtKNN2N6giqH9w==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=rwS49xjan/Wbj8OmpyciUnsyCTq9ro+3nmATxwlPJNE=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id 6db1b8af61ed3daa; Sun, 23 Jan 2022 20:36:10 +0900 From: "Chan Kim" To: References: <03ae01d8104b$9e579080$db06b180$@etri.re.kr> In-Reply-To: <03ae01d8104b$9e579080$db06b180$@etri.re.kr> Subject: RE: adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed) Date: Sun, 23 Jan 2022 20:36:09 +0900 Message-ID: <03c001d8104d$6af64400$40e2cc00$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHbcahUXcYFXyqTbQFX+cpNC3/fwqxpts1g Content-Language: ko X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1516117147274559673==" Errors-To: kernelnewbies-bounces@kernelnewbies.org This is a multipart message in MIME format. --===============1516117147274559673== Content-Type: multipart/alternative; boundary="----=_NextPart_000_03C1_01D81098.DADEFD70" Content-Language: ko This is a multipart message in MIME format. ------=_NextPart_000_03C1_01D81098.DADEFD70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I found adding the same #pragma directives warp to #include makes the compiler error go away! #pragma GCC push_options #pragma GCC optimize ("O0") #include #pragma GCC pop_option Chan From: Chan Kim Sent: Sunday, January 23, 2022 8:23 PM To: kernelnewbies@kernelnewbies.org Subject: adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed) Hello all, In linux 5.4.21, when tell the compiler to use no optimzation for function early_fixmap_init as below, (I need to compile with O0 to follow what's happening here using gdb.) #pragma GCC push_options #pragma GCC optimze ("O0") void __init early_fixmap_init(void) { ... } #pragma GCC pop_options I get this compiler error below. (make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- Image -j24) CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC arch/arm64/mm/mmu.o CC drivers/irqchip/irq-gic-v3.o In file included from ./include/linux/build_bug.h:5, from ./arch/arm64/include/asm/sysreg.h:758, from ./arch/arm64/include/asm/cputype.h:126, from ./arch/arm64/include/asm/cache.h:8, from ./include/linux/cache.h:6, from arch/arm64/mm/mmu.c:9: ./arch/arm64/include/asm/pgalloc.h: In function '__pgd_populate.constprop': ./include/linux/compiler.h:350:38: error: call to '__compiletime_assert_88' declared with attribute error: BUILD_BUG failed 350 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | ^ ./include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert' 331 | prefix ## suffix(); \ | ^~~~~~ ./include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert' 350 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | ^~~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^~~~~~~~~~~~~~~~ ./arch/arm64/include/asm/pgalloc.h:88:2: note: in expansion of macro 'BUILD_BUG' 88 | BUILD_BUG(); | ^~~~~~~~~ make[2]: *** [scripts/Makefile.build:265: arch/arm64/mm/mmu.o] Error 1 make[1]: *** [scripts/Makefile.build:509: arch/arm64/mm] Error 2 make: *** [Makefile:1652: arch/arm64] Error 2 make: *** Waiting for unfinished jobs.... AR drivers/irqchip/built-in.a AR drivers/built-in. What does this mean and what should I do? Thanks! Chan Kim ------=_NextPart_000_03C1_01D81098.DADEFD70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I found adding the same #pragma = directives warp to #include <linux/cache.h> makes the compiler = error go away!

 

#pragma GCC push_options

#pragma GCC optimize = ("O0")

#include <linux/cache.h>

#pragma GCC = pop_option

 

Chan

 

From:<= /b> Chan Kim = <ckim@etri.re.kr>
Sent: Sunday, January 23, 2022 8:23 = PM
To: kernelnewbies@kernelnewbies.org
Subject: = adding GCC optimze O0 to early_fixmap_init causes compiler error = (BUILD_BUG failed)

 

Hello all,

In linux 5.4.21, when tell the compiler to use no = optimzation for function early_fixmap_init as = below,

(I = need to compile with O0 to follow whats = happening here using gdb.)

#pragma GCC push_options

#pragma GCC optimze = ("O0")

void __init early_fixmap_init(void) =

{

...

}

#pragma GCC pop_options

 

I get this compiler error below. = (make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-none-elf- Image = -j24)

CALL    = scripts/atomic/check-atomics.sh

  CALL    = scripts/checksyscalls.sh

  CHK     = include/generated/compile.h

  CC      = arch/arm64/mm/mmu.o

  CC      = drivers/irqchip/irq-gic-v3.o

In file included from = ./include/linux/build_bug.h:5,

          =        from = ./arch/arm64/include/asm/sysreg.h:758,

          =        from = ./arch/arm64/include/asm/cputype.h:126,

          =        from = ./arch/arm64/include/asm/cache.h:8,

          =        from = ./include/linux/cache.h:6,

          =        from = arch/arm64/mm/mmu.c:9:

./arch/arm64/include/asm/pgalloc.h: In function = '__pgd_populate.constprop':

./include/linux/compiler.h:350:38: error: call to = '__compiletime_assert_88' declared with attribute error: BUILD_BUG = failed

  350 |  _compiletime_assert(condition, msg, = __compiletime_assert_, __LINE__)

      = |            =             &= nbsp;           &n= bsp; ^

./include/linux/compiler.h:331:4: note: in definition of = macro '__compiletime_assert'

  331 |    prefix ## = suffix();    \

      |    = ^~~~~~

./include/linux/compiler.h:350:2: note: in expansion of = macro '_compiletime_assert'

  350 |  _compiletime_assert(condition, msg, = __compiletime_assert_, __LINE__)

      |  = ^~~~~~~~~~~~~~~~~~~

./include/linux/build_bug.h:39:37: note: in expansion of = macro 'compiletime_assert'

   39 | #define BUILD_BUG_ON_MSG(cond, msg) = compiletime_assert(!(cond), msg)

      = |            =             &= nbsp;            = ^~~~~~~~~~~~~~~~~~

./include/linux/build_bug.h:59:21: note: in expansion of = macro 'BUILD_BUG_ON_MSG'

   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, = "BUILD_BUG failed")

      = |            =          = ^~~~~~~~~~~~~~~~

./arch/arm64/include/asm/pgalloc.h:88:2: note: in expansion = of macro 'BUILD_BUG'

   88 |  = BUILD_BUG();

      |  = ^~~~~~~~~

make[2]: *** [scripts/Makefile.build:265: = arch/arm64/mm/mmu.o] Error 1

make[1]: *** [scripts/Makefile.build:509: arch/arm64/mm] = Error 2

make: *** [Makefile:1652: arch/arm64] Error = 2

make: *** Waiting for unfinished = jobs....

  AR      = drivers/irqchip/built-in.a

AR      = drivers/built-in.

 

What does this mean and what should I = do?

Thanks!

Chan Kim

 

------=_NextPart_000_03C1_01D81098.DADEFD70-- --===============1516117147274559673== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============1516117147274559673==--