From patchwork Thu Jun 17 12:19:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Ziegler X-Patchwork-Id: 1493435 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Lk32HL8z9sW7 for ; Thu, 17 Jun 2021 22:20:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CADD083DEB; Thu, 17 Jun 2021 12:20:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h9ZrG9BG6yf1; Thu, 17 Jun 2021 12:20:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 27EEF83DE7; Thu, 17 Jun 2021 12:20:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 69B9C1BF280 for ; Thu, 17 Jun 2021 12:20:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5907C40586 for ; Thu, 17 Jun 2021 12:20:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PNK-90eNbHke for ; Thu, 17 Jun 2021 12:20:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from serv15.avernis.de (serv15.avernis.de [176.9.89.163]) by smtp2.osuosl.org (Postfix) with ESMTPS id E98FC400D2 for ; Thu, 17 Jun 2021 12:20:34 +0000 (UTC) Received: from localhost.localdomain (unknown [151.37.142.239]) by serv15.avernis.de (Postfix) with ESMTPSA id BEC96C207C4E; Thu, 17 Jun 2021 14:20:31 +0200 (CEST) From: Andreas Ziegler To: buildroot@buildroot.org Date: Thu, 17 Jun 2021 14:19:43 +0200 Message-Id: <20210617121943.800180-1-br015@umbiko.net> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.2 at serv15.avernis.de X-Virus-Status: Clean Subject: [Buildroot] [PATCH 1/1] package/gcc: undefine NDEBUG directive X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Andreas Ziegler , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" GCC performs internal consistency checks that can be controlled with --enable-checking, but not completely removed for all stages of the build. One of these checks uses the assert macro from Defining NDEBUG removes the assertion code, which is not anticipated in the gcc code. Undefine the NDEBUG flag for package/gcc to preserve assertions. This fixes the following error during build of GCC 10: ../../../libgomp/target.c: In function ‘gomp_unmap_vars_internal’: ../../../libgomp/target.c:1474:9: error: unused variable ‘is_tgt_unmapped’ [-Werror=unused-variable] 1474 | bool is_tgt_unmapped = gomp_remove_var (devicep, k); | ^~~~~~~~~~~~~~~ ../../../libgomp/target.c:1473:28: error: unused variable ‘k_tgt’ [-Werror=unused-variable] 1473 | struct target_mem_desc *k_tgt = k->tgt; | ^~~~~ Signed-off-by: Andreas Ziegler --- package/gcc/gcc.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index ed9b93e50f..4ee32c03a7 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -90,7 +90,8 @@ HOST_GCC_COMMON_CONF_OPTS = \ HOST_GCC_COMMON_CONF_ENV = \ MAKEINFO=missing -GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS) +# gcc should not be built with NDEBUG enabled +GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS) -UNDEBUG GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS) # used to fix ../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized]