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 \