Message ID | tencent_3D7B0D368482B2602EC7559A5E1546171009@qq.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1399329wrn; Fri, 16 Dec 2022 23:33:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ogzJq114RBze6AkspHVyOoLa8nozz5sQ/zFyXSJmD3Jh2iJ3cZ4mF2xFQ6oP2auOsmC2Y X-Received: by 2002:a05:6a00:bd8:b0:576:65f5:c60a with SMTP id x24-20020a056a000bd800b0057665f5c60amr31185429pfu.27.1671262418986; Fri, 16 Dec 2022 23:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671262418; cv=none; d=google.com; s=arc-20160816; b=nxmasws4wzm5/Kf7HXJj+KUUUoiIJDtk6M6A/jZ/66LGZ+YXXfxL80FcO8BOveti6L TrueRk1cZlt6BynWy7BXE6IpjwUjHXSpRPAYFReMLUSJ4E+2SQgQAqXD3+F61WAduI5Q vOY2DCtn+6D13WTKx10HRCe/nI7GsSoFu4AQJmxpb7cJrE6mGZdSQt/Xy41+AKOAZ/2D QadRDAI68aRcfxZJBX6X71+9efzc9bdtSapd736p7Xu43hRFnOiqUmA7/VAB/Yr0M78a MRRofaqZRscQfQcO9rB3vmiikP+X6dgOyl3tdp0aPIlDfRlXLQcAigP5N+TF8IfyUjve DwtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:cc:to:from:message-id:dkim-signature; bh=qNPme23sRfuoZh5wT71WmCg74RkrBQR8L1HFucUJqQg=; b=WKWErVxDuN4WGtkzrHzC8WEv0Ascl0a2uELeeOZav6C4VESigY2q5rsPYsCLC52wpP uXNn81padk74RMTuNrLWt8rT4SFVqL6C04VXEXWjRULnfBgO4I6cuhYblexS8qn85OgR nT0gQKWJWgkCoe2Y/MaiXx2zElAjGHUdqNUF1wMWNfco3SZw+sNymId7aLlXgjuuXLsC faaFfpPoSrNfxUMxgX78OXbbUfsWq3XTNiPxf/7PHDTM10ssQd772Fs82TtB8xnW0fh5 7Yt5YN9kTkJy5OnfWNJbuJlzGsT+vLpKQgW6BCZlEmG/r0k0ZXxImSIuwmB4e8fkKt+e mjlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=KxSV7Rou; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b22-20020a056a000a9600b0057834955b50si4564515pfl.180.2022.12.16.23.33.12; Fri, 16 Dec 2022 23:33:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=KxSV7Rou; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbiLQHHB (ORCPT <rfc822;markus.c.watson@gmail.com> + 99 others); Sat, 17 Dec 2022 02:07:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbiLQHG7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 17 Dec 2022 02:06:59 -0500 Received: from out162-62-57-64.mail.qq.com (out162-62-57-64.mail.qq.com [162.62.57.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A40EC3B9FC for <linux-kernel@vger.kernel.org>; Fri, 16 Dec 2022 23:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1671260811; bh=qNPme23sRfuoZh5wT71WmCg74RkrBQR8L1HFucUJqQg=; h=From:To:Cc:Subject:Date; b=KxSV7RouGnBGIBn030RaXFw/DrdQ8xtwR4NbKP+Z2ItkaYrNCajP/uO4YpJEVI+mn H+ZFeXxLH1ghAfx62qQ69tMWlEalDS9Grez6QMT7iNm0zrqdfoXYhalQXyuJS+V4z6 agRm/mtPFkWW2vSd+4Zu6SjtvvnmcAbYMjml8Iqo= Received: from rtoax.. ([111.199.188.149]) by newxmesmtplogicsvrsza12-0.qq.com (NewEsmtp) with SMTP id DCB7CC9; Sat, 17 Dec 2022 15:03:28 +0800 X-QQ-mid: xmsmtpt1671260608t8uzpjr6z Message-ID: <tencent_3D7B0D368482B2602EC7559A5E1546171009@qq.com> X-QQ-XMAILINFO: Mm/8i8/T4yne7jDl1XJl/TzZjZik7sj8e1EHqrLVkaLp4DVV33nWJ6iwpCMpUh azceIv7JFW8GnKjG3GeU/09D0/P47r43xawCn9CVCqwOy3SaZ4LJtZCFTyyHPI/LijsQikeOHwWs AYnMLcNl+UkrzaaDThXSh3bxQVXbwnlNrSfQsGLfKIIl4nKjI/J2Ja12/RIqn10jnjpjOpPmTiMP WG/wLgLxB3el4y87Rx0yPRImgDYm3hIJuoj9UpD5ZIyh8896T1Go479yovAElJsKDE4reGigHQSV M+VhAorZoYuh3am1j+wVHYLkLnmAKAo8y5kl0MgQRz26lr7eZfQ1RuiVK+Gr4Qt8/qpe6FCIdyaU K7S/SRSesAEvCk9lCu7gFSBJpkjgiQSS43trnyEHDh6aK7tpHF4MtMOep+jHwXati8mlspBbl9rw UQLBePJvflbZ7Wi/hafU+4gFD9fh1u2WetzoQBdXiGSVgKBharQy4OEXkDtnQHzS+AU4H6AFfb9A GnBkCt6XCT0i61pdjXAyQrqu0pEOHPDw5wblLHRZ5NhmyjN3F9id8FznvVdG2/Kbr0NmbkuBQvLL EgLlci8v3ONPa7Fvx/PdPAKg4cz6/EZd8T0dPFfZZTkjCy7QQCHGPi78VOo2yg4Py7qLMNuebRZ/ 10r55qnz+SA8dAtno09cK4meNvy3sSfzSm5G0as+XtZRTR4Ybv0hVigOO7KvfB0fRRZaYBUdHv+S vZzn29h8LNp/JgnXIu6JHR9yWcTQe7znhxVnnI2q3SVo5+bCofKbvYh6Or6eT3s7qqftbwbVb27i hyR1QpNW9EJUZEvoI+cWeGlGtSoz+/x4FjNqnzj0chR3rY7JoV7Q7d13q/08Bpkn0E0XgmB38Xdu sBVpyLBAagW/rQ3vd9Pmj/UfwkPj7x0whVdhuQstzx3bDoxbtEd2mGEfC0tfBFEVnnzeifKsSEvQ Cdq0QHk1bU5kToBdBcakwEJhPEhQXNGTKUIUA+nStgCA8kPtJ00w== From: Rong Tao <rtoax@foxmail.com> To: masahiroy@kernel.org Cc: linux-kbuild@vger.kernel.org, Rong Tao <rongtao@cestc.cn>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, linux-kernel@vger.kernel.org (open list), bpf@vger.kernel.org (open list:BPF [MISC]) Subject: [PATCH] kbuild: Fix compilation error Date: Sat, 17 Dec 2022 15:03:18 +0800 X-OQ-MSGID: <20221217070319.18331-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752445662667812607?= X-GMAIL-MSGID: =?utf-8?q?1752445662667812607?= |
Series |
kbuild: Fix compilation error
|
|
Commit Message
Rong Tao
Dec. 17, 2022, 7:03 a.m. UTC
From: Rong Tao <rongtao@cestc.cn> In the absence of a CONFIG_FUNCTION_ALIGNMENT defined, -falign-functions= will be given a null value, which results in a compilation error, as follows: $ make -C samples/bpf/ ... CC /home/sdb/Git/linux/samples/bpf/syscall_nrs.s gcc: error: missing argument to ‘-falign-functions=’ make[2]: *** [scripts/Makefile.build:118: /home/sdb/Git/linux/samples /bpf/syscall_nrs.s] Error 1 make[1]: *** [Makefile:1996: /home/sdb/Git/linux/samples/bpf] Error 2 make[1]: Leaving directory '/home/sdb/Git/linux' make: *** [Makefile:269: all] Error 2 Signed-off-by: Rong Tao <rongtao@cestc.cn> --- Makefile | 2 ++ 1 file changed, 2 insertions(+)
Comments
On Sat, Dec 17, 2022 at 4:07 PM Rong Tao <rtoax@foxmail.com> wrote: > > From: Rong Tao <rongtao@cestc.cn> > > In the absence of a CONFIG_FUNCTION_ALIGNMENT defined, Does it happen in the mainline kernel? CONFIG_FUNCTION_ALIGNMENT is always defined as far as I understood arch/Kconfig. > -falign-functions= > will be given a null value, which results in a compilation error, as > follows: > > $ make -C samples/bpf/ > ... > CC /home/sdb/Git/linux/samples/bpf/syscall_nrs.s > gcc: error: missing argument to ‘-falign-functions=’ > make[2]: *** [scripts/Makefile.build:118: /home/sdb/Git/linux/samples > /bpf/syscall_nrs.s] Error 1 > make[1]: *** [Makefile:1996: /home/sdb/Git/linux/samples/bpf] Error 2 > make[1]: Leaving directory '/home/sdb/Git/linux' > make: *** [Makefile:269: all] Error 2 > > Signed-off-by: Rong Tao <rongtao@cestc.cn> > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 6aa709df6bde..57cce4c8f8a2 100644 > --- a/Makefile > +++ b/Makefile > @@ -1006,9 +1006,11 @@ KBUILD_CFLAGS += $(CC_FLAGS_CFI) > export CC_FLAGS_CFI > endif > > +ifdef CONFIG_FUNCTION_ALIGNMENT > ifneq ($(CONFIG_FUNCTION_ALIGNMENT),0) > KBUILD_CFLAGS += -falign-functions=$(CONFIG_FUNCTION_ALIGNMENT) > endif > +endif > > # arch Makefile may override CC so keep this after arch Makefile is included > NOSTDINC_FLAGS += -nostdinc > -- > 2.38.1 >
Yes, It's happen in the mainline kernel. I pulled the latest code and habitually compiled samples/bpf, $ git remote get-url origin git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $ make -C samples/bpf and the compilation error occurred. I applied this patch and can fix this compilation error.
On Sat, Dec 17, 2022 at 5:11 PM Rong Tao <rtoax@foxmail.com> wrote: > > Yes, It's happen in the mainline kernel. > > I pulled the latest code and habitually compiled samples/bpf, > > $ git remote get-url origin > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > $ make -C samples/bpf > > and the compilation error occurred. I applied this patch and can > fix this compilation error. I want you to describe the steps to reproduce the issue from the pristine source tree instead of printing the URL of your origin. I prepared a template for you. Please fill the following 3 square brackets. $ git log --oneline -1 [ Fill the commit hash you are working on ] $ git clean -dfx [ Fill steps between "git clean -dfx" and "make -C samples/bpf" ] $ make -C samples/bpf [ Fill the error message you get ]
Thanks, Masahiro Yamada, I compile again from scrach. the compilation error not happen anymore. I think i miss 'make menuconfig' before. Thanks again! $ git log --oneline -1 77856d911a8c $ git clean -dfx $ make menuconfig <<== Which i miss $ make -j8 $ make -C samples/bpf
diff --git a/Makefile b/Makefile index 6aa709df6bde..57cce4c8f8a2 100644 --- a/Makefile +++ b/Makefile @@ -1006,9 +1006,11 @@ KBUILD_CFLAGS += $(CC_FLAGS_CFI) export CC_FLAGS_CFI endif +ifdef CONFIG_FUNCTION_ALIGNMENT ifneq ($(CONFIG_FUNCTION_ALIGNMENT),0) KBUILD_CFLAGS += -falign-functions=$(CONFIG_FUNCTION_ALIGNMENT) endif +endif # arch Makefile may override CC so keep this after arch Makefile is included NOSTDINC_FLAGS += -nostdinc