From patchwork Wed Jun 5 12:13:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1110448 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=micronovasrl.com Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=micronovasrl.com header.i=@micronovasrl.com header.b="MH4E5f+e"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Jnl65RrGz9sBb for ; Wed, 5 Jun 2019 22:13:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8D9D287E60; Wed, 5 Jun 2019 12:13:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8nMcLN-gel8x; Wed, 5 Jun 2019 12:13:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 58D3687E5B; Wed, 5 Jun 2019 12:13:45 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 78AAC1BF963 for ; Wed, 5 Jun 2019 12:13:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7449C86DEB for ; Wed, 5 Jun 2019 12:13:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dBnCpn04PBbu for ; Wed, 5 Jun 2019 12:13:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10]) by whitealder.osuosl.org (Postfix) with ESMTP id B833C86DFC for ; Wed, 5 Jun 2019 12:13:41 +0000 (UTC) Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 4FDFEB013D7 for ; Wed, 5 Jun 2019 14:13:39 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1559736818; x=1560600819; bh=82 Hg02LaJtGYPZdiNDXxgR2bgLUPFYOAijZuYP8SiIg=; b=MH4E5f+e5v7IdT6Y3x l/8os5L7P5S/pZihbKQ6R8LUnb5TwX97/S/gOACpvld2u/n75wT7dB/ett1UK2Ba zxDoVVmV53OINzRFPhFDCRbLrQHAiVc5Rv87jCy4hSZkApZSb6YcmzfsKXplc2pd a7Tw0Ta60cX/nDlnE8Poee1sM= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mJOiYUrQd-j2 for ; Wed, 5 Jun 2019 14:13:38 +0200 (CEST) Received: from ubuntu.localdomain (benettig-pc.dominio.micronovasrl.com [192.168.123.215]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 0B944B00A6B; Wed, 5 Jun 2019 14:13:38 +0200 (CEST) From: Giulio Benetti To: buildroot@buildroot.org Date: Wed, 5 Jun 2019 14:13:35 +0200 Message-Id: <20190605121336.2512-1-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190524231547.35975ecf@windsurf> References: <20190524231547.35975ecf@windsurf> Subject: [Buildroot] [PATCH 1/2] package/libnss: use correct CFLAGS and LDFLAGS 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: Joseph Kogut MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Actually libnss is configure with BUILD_OPT=1 that doesn't take into account TARGET_CFLAGS nor TARGET_LDFLAGS resulting in pre-chosen optimizations and debugging symbols. Can't pass TARGET_CFLAGS through CFLAGS or similar otherwise other iternal libnss will be overwritten(i.e. -fPIC), so prefer to append TARGET_CFLAGS at the end of Linux.mk as well as TARGET_LDFLAGS according to internal libnss Makefile system's names. And obviously remove BUILD_OPT=1 from BUILD_VARS. Signed-off-by: Giulio Benetti --- package/libnss/libnss.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk index 89d614fe1c..484c79e9da 100644 --- a/package/libnss/libnss.mk +++ b/package/libnss/libnss.mk @@ -13,6 +13,14 @@ LIBNSS_DEPENDENCIES = libnspr sqlite zlib LIBNSS_LICENSE = MPL-2.0 LIBNSS_LICENSE_FILES = nss/COPYING +# Need to pass down TARGET_CFLAGS and TARGET_LDFLAGS +define LIBNSS_FIXUP_LINUX_MK + echo 'OS_CFLAGS += ${TARGET_CFLAGS}' >> $(@D)/nss/coreconf/Linux.mk + echo 'LDFLAGS += ${TARGET_LDFLAGS}' >> $(@D)/nss/coreconf/Linux.mk +endef + +LIBNSS_PRE_CONFIGURE_HOOKS += LIBNSS_FIXUP_LINUX_MK + # --gc-sections triggers binutils ld segfault # https://sourceware.org/bugzilla/show_bug.cgi?id=21180 ifeq ($(BR2_microblaze),y) @@ -33,7 +41,6 @@ LIBNSS_BUILD_VARS = \ MOZILLA_CLIENT=1 \ NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \ NSPR_LIB_DIR=$(STAGING_DIR)/usr/lib \ - BUILD_OPT=1 \ NS_USE_GCC=1 \ NSS_DISABLE_GTESTS=1 \ NSS_USE_SYSTEM_SQLITE=1 \ @@ -102,7 +109,6 @@ HOST_LIBNSS_BUILD_VARS = \ MOZILLA_CLIENT=1 \ NSPR_INCLUDE_DIR=$(HOST_DIR)/include/nspr \ NSPR_LIB_DIR=$(HOST_DIR)/lib \ - BUILD_OPT=1 \ NS_USE_GCC=1 \ NSS_DISABLE_GTESTS=1 \ NSS_USE_SYSTEM_SQLITE=1 \ From patchwork Wed Jun 5 12:13:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1110447 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=micronovasrl.com Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=micronovasrl.com header.i=@micronovasrl.com header.b="XSK9xvfN"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Jnl01lQ8z9s6w for ; Wed, 5 Jun 2019 22:13:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6A29820433; Wed, 5 Jun 2019 12:13:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tQuSrmAeJa8Z; Wed, 5 Jun 2019 12:13:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6D4AC1FFFF; Wed, 5 Jun 2019 12:13:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 512F71BF2A9 for ; Wed, 5 Jun 2019 12:13:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4DF0286E1D for ; Wed, 5 Jun 2019 12:13:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fqjUI0cpZL-X for ; Wed, 5 Jun 2019 12:13:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10]) by whitealder.osuosl.org (Postfix) with ESMTP id C025B86DEB for ; Wed, 5 Jun 2019 12:13:40 +0000 (UTC) Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 10C58B0129B for ; Wed, 5 Jun 2019 14:13:39 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1559736818; x=1560600819; bh=Vo 9Zsm6LDfpcmXA9ui6487EAzDkCgcWCgwkUQMeDbpg=; b=XSK9xvfNtByX7e9Nk6 rwwGy0PcbInvkeRzkV6T/K5xrm0+NgIQcFr2ucPo60UV5zqtE48zw3lYYNgLICC6 WT/di/j3g4tOsv1w4gYQRHJ69VM2E1Dm9cETnMLVWEz9Oy3Ri1hMeXy7jEBaLuVN PFazHLAbeopXzWEUm+NjT0sTA= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 34wjLFEkrgsq for ; Wed, 5 Jun 2019 14:13:38 +0200 (CEST) Received: from ubuntu.localdomain (benettig-pc.dominio.micronovasrl.com [192.168.123.215]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 168A6B012BF; Wed, 5 Jun 2019 14:13:38 +0200 (CEST) From: Giulio Benetti To: buildroot@buildroot.org Date: Wed, 5 Jun 2019 14:13:36 +0200 Message-Id: <20190605121336.2512-2-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605121336.2512-1-giulio.benetti@micronovasrl.com> References: <20190524231547.35975ecf@windsurf> <20190605121336.2512-1-giulio.benetti@micronovasrl.com> Subject: [Buildroot] [PATCH 2/2] package/libnss: re-enable package on microblaze 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: Joseph Kogut MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" With Microblaze Gcc version < 8.x the build hangs due to bug 85862: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85862 To avoid this, the libnss package has a !BR2_TOOLCHAIN_HAS_GCC_BUG_85862 dependency. However, gcc bug 85862 only triggers when optimization is enabled, so we can work around the issue by passing -O0, which is what we do in other Buildroot packages to work around this bug. Signed-off-by: Giulio Benetti --- package/libnss/Config.in | 4 ---- package/libnss/libnss.mk | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package/libnss/Config.in b/package/libnss/Config.in index 34ddb91dfa..599c9a6536 100644 --- a/package/libnss/Config.in +++ b/package/libnss/Config.in @@ -3,7 +3,6 @@ config BR2_PACKAGE_LIBNSS depends on BR2_TOOLCHAIN_HAS_THREADS # libnspr depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # libnspr depends on !BR2_STATIC_LIBS - depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_85862 select BR2_PACKAGE_LIBNSPR select BR2_PACKAGE_SQLITE select BR2_PACKAGE_ZLIB @@ -19,6 +18,3 @@ config BR2_PACKAGE_LIBNSS comment "libnss needs a toolchain w/ threads, dynamic library" depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS - -comment "libnss needs a toolchain not affected by GCC bug 85862" - depends on BR2_TOOLCHAIN_HAS_GCC_BUG_85862 diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk index 484c79e9da..893ff80154 100644 --- a/package/libnss/libnss.mk +++ b/package/libnss/libnss.mk @@ -13,9 +13,15 @@ LIBNSS_DEPENDENCIES = libnspr sqlite zlib LIBNSS_LICENSE = MPL-2.0 LIBNSS_LICENSE_FILES = nss/COPYING +LIBNSS_CFLAGS = $(TARGET_CFLAGS) + +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85862),y) +LIBNSS_CFLAGS += -O0 +endif + # Need to pass down TARGET_CFLAGS and TARGET_LDFLAGS define LIBNSS_FIXUP_LINUX_MK - echo 'OS_CFLAGS += ${TARGET_CFLAGS}' >> $(@D)/nss/coreconf/Linux.mk + echo 'OS_CFLAGS += ${LIBNSS_CFLAGS}' >> $(@D)/nss/coreconf/Linux.mk echo 'LDFLAGS += ${TARGET_LDFLAGS}' >> $(@D)/nss/coreconf/Linux.mk endef