From patchwork Thu Dec 9 01:07:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 1565563 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=rrddu6cf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::73b; helo=mail-qk1-x73b.google.com; envelope-from=swupdate+bncbcwivbv7sugrbqvnywgqmgqegchrqka@googlegroups.com; receiver=) Received: from mail-qk1-x73b.google.com (mail-qk1-x73b.google.com [IPv6:2607:f8b0:4864:20::73b]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4J8bVF5k3wz9sRK for ; Thu, 9 Dec 2021 12:07:17 +1100 (AEDT) Received: by mail-qk1-x73b.google.com with SMTP id o19-20020a05620a22d300b0046754380e8asf5264410qki.13 for ; Wed, 08 Dec 2021 17:07:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639012035; cv=pass; d=google.com; s=arc-20160816; b=i0EIyqNYkx/+NsijNkXJIktG3UNWCsSz6vWYDN+BAonEl8JmRTxmg769Sf2WgDfiPr qoOj63mPoL5LFYRyXec9iiz+QuSl5f2WN55wV0U7rx7k3egHycjHLkS1hhNstKNiPNrG s7+LHSisE5OXznK3GEmH24E9x/24VWXxM2ih40Ty6mkrXi6FOUYkpm8dMLM02RbyluZz vjdLyf+86qsWYQhgJNgFhNaGEnFATQSThAS49inetKmY2EB6Ii+H071AXfpwZ4aVjoSJ Ict0smRHuMsAbPMsvz/sTbqhwjzZEvaUiJDs0neeewBr7Uwz+gxh7GH1q78xs3UxKTOi X9Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=k645wSF8VHZhImcCp0vGz+DET7X39ScmaEC+RKTG1cc=; b=A3oQLFvHNKH+cwB9qbLGulREN7fFN9NDtQfInzPYMe8YUVbVvk5KBgcU2HsIIwJMvy TGLG1KAKHVQphnYG/t/Z8jzkrCe/Tgknye0N6Wv05avS1zcaynb8p54tU7sXLGuhnLVU kzmwuELSZ6f0iOO6iUJute6dcg76+YFQeRJJxKTGQswth75PNvSqN0D1W1+dKyt/Yn6/ P4h7w5vsdgGfdTbiG4ia4ArDEs7IJRdQDVQ0rq7dwtVFIU7sd9UrOpF8SPjesATP6bFT UlGLZzzB6AJCCi3eY7jRNNPzEY/maToqY1p5nOS99OxWTF1ii6Zk5xxZmncpDS5MGV+W 716g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=k645wSF8VHZhImcCp0vGz+DET7X39ScmaEC+RKTG1cc=; b=rrddu6cf/Jb6w4aLvwzHSR297HOqXOGghkt3LwC9Vw6DbhzTlNaxOggCSM5ciHj+jv 3Vy+yFzT1lcWNPPxs2pa76saDDSW40OeAUWFx2ACI+joVQqGN2PwME19MmM8KfQ0JJhJ Cv8IqpzJt7XBSZc3wdsH01/peYPo+tUeVrHcCtRlrjPV0b4Y6kXcghlwIXep8XXwZkow raOGZF4FNlkAs0hKPh3WYe7a2hjTeuNiSH0MprwVaEVSahjbfGDYEC2pk6e6nPK43eDJ RyATAihW9jX1Pz4JNV2xseFmggDcCL6jc9pbimVi+qJyDmpManH/vZtOswgsOmXDgdNE FjTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=k645wSF8VHZhImcCp0vGz+DET7X39ScmaEC+RKTG1cc=; b=zN6wwT7h5uzVZDyYK9BYxzS+ldRAev0dPHX4YNE5RBwd7R/Y4btU/FWE4NRXn6lGBN fQxGEkfCezOxn6ViaKLAIzQ1x/u09jiAyRI9H/+7ToNFispkX5J/c2+2FfBWn4HHTVJz VWMBaoMoAAh12npwesCejAWBE70wZw05R4W7q4odNQDkU7y72atuzllNqIjZVyxIRQUH zmBFFTJZpFHsRpa11EVjuaRXMacuiBr0xbJuCRU/Kq9YxJX0R0IVjtVOC0dASX6H5mPC r+++Kx94KTeBydUcUFk1JXIP1Dl3t/VciQl7IcG9Q1vmRaNIx0Edbr0UH+fWjGRZCTtS J4Fw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533uJjqSqE7/g+Q/bDS3XLEOkgRQmu/2UK9lodkfpnu7PSxRFTPV SWC+ecgytuCuXehOCKYz9QI= X-Google-Smtp-Source: ABdhPJx6K1eTH+SxCqslk61QGiZ0zrz5s9lpGGSnFaarQbrRO/q+998Z1mghxgccKljOf21PnmoshQ== X-Received: by 2002:a05:622a:1745:: with SMTP id l5mr12438257qtk.169.1639012034975; Wed, 08 Dec 2021 17:07:14 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a0c:f2c1:: with SMTP id c1ls2134485qvm.10.gmail; Wed, 08 Dec 2021 17:07:14 -0800 (PST) X-Received: by 2002:a05:6214:1c84:: with SMTP id ib4mr11964288qvb.68.1639012034529; Wed, 08 Dec 2021 17:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639012034; cv=none; d=google.com; s=arc-20160816; b=eIyn5VoUtKfH/SsqABJytkIdb/S5UaiXESXwmjADDzpWoMkET2PrRk2DEcgF5EwbiA dqR7u6ilT6UOSy4XKYe4D4IzZtp8/BkZ9gSZn6L0C9ORPRcv6M0h1ZX7spHtZx0OSmg8 VTePZ/rF2Lbibq2/Kg5rMTOxSq5gsGOvfoZxNebPOUkLYO5GEKIj/IDWaKDKfm57m9zB CP06EXX2/Tgmmi22zsrUngf7W5i08E9kRyRp1EOHpkv4e3rh+eiBYhkrwmJ03O80eFTC TeRv4QQbLHaM1JfJQLQakbRHXMcSJSj/BRPoE3qPQmXTFcM2TEW6W3h6gZsg+TpCPBLP u7qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=kIIGFrgwuH68degZb1IONuaIdzkP3qUr/I/hZZ/C/vk=; b=a3WR64VtBhfXf0FRVfByTtWaG+ACLCrTo8wMRQZYcfze/9P/sD62EaM1+3gszEh6ld HK7+xSeqWPcUCPE/0OeRGbB3v+hf+1KMdfzJMe9KFDhGCEF9tR2uaAiAiEXnxgWdG3jN /7uqwsqpch5pWNMoMNK1deK98vxrrZpfnnppO2L/V1wQ0iV4Sm+42FhVqYaaHW+5St+P 4I1HuEpQyLa3Cd4uBw6KJGrSOG2oSbYzvbSdEC6ICdi2Tg3K9+eG9NMSENW7mz+mUmz+ Pdu4KIJYOW1kg0WfqshQPsF20cdHXXiJF2hkSYUMRfqPyP1jpGb+I+A0KJS8FrRp/1U3 +xEw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com Received: from gw2.atmark-techno.com (gw2.atmark-techno.com. [35.74.137.57]) by gmr-mx.google.com with ESMTP id b8si806012qtg.5.2021.12.08.17.07.14 for ; Wed, 08 Dec 2021 17:07:14 -0800 (PST) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) client-ip=35.74.137.57; Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id 00E2520D37 for ; Thu, 9 Dec 2021 10:07:13 +0900 (JST) Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by gw2.atmark-techno.com (Postfix) with ESMTPS id E1B0B20D37 for ; Thu, 9 Dec 2021 10:07:12 +0900 (JST) Received: by mail-pl1-f197.google.com with SMTP id p24-20020a170902a41800b001438d6c7d71so1523376plq.7 for ; Wed, 08 Dec 2021 17:07:12 -0800 (PST) X-Received: by 2002:a17:902:e749:b0:141:edaa:fde1 with SMTP id p9-20020a170902e74900b00141edaafde1mr64033455plf.72.1639012031785; Wed, 08 Dec 2021 17:07:11 -0800 (PST) X-Received: by 2002:a17:902:e749:b0:141:edaa:fde1 with SMTP id p9-20020a170902e74900b00141edaafde1mr64033437plf.72.1639012031535; Wed, 08 Dec 2021 17:07:11 -0800 (PST) Received: from pc-0115 (76.125.194.35.bc.googleusercontent.com. [35.194.125.76]) by smtp.gmail.com with ESMTPSA id lp12sm3924238pjb.24.2021.12.08.17.07.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Dec 2021 17:07:11 -0800 (PST) Received: from martinet by pc-0115 with local (Exim 4.95) (envelope-from ) id 1mv7tu-0032Wj-4E; Thu, 09 Dec 2021 10:07:10 +0900 From: Dominique Martinet To: swupdate@googlegroups.com Cc: Dominique Martinet Subject: [swupdate] [PATCH v2] kbuild: respect pkg-config-provided lua -L flags Date: Thu, 9 Dec 2021 10:07:09 +0900 Message-Id: <20211209010709.724674-1-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , - KBUILD_LIBS was set but unused - (pkg-config)_LIBS was also unused, replace it to get only the -L flags - remember the -L flags in EXTRA_LDFLAGS - also pass EXTRA_LDFLAGS to tests so they can find the lib Signed-off-by: Dominique Martinet --- v2: trivial rebase on master This is required on alpine with lua-5.3, and can be tested by setting CONFIG_LUAPKG="lua5.3" in .config Using the default lua version (5.1) does not require this as liblua.so is populated in /usr/lib then. Makefile | 2 +- Makefile.flags | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 932330c829cd..88ece9d40099 100644 --- a/Makefile +++ b/Makefile @@ -495,7 +495,7 @@ acceptance-tests: swupdate ${tools-bins} FORCE PHONY += test test: - $(Q)$(MAKE) $(build)=test SWOBJS="$(swupdate-objs)" SWLIBS="$(swupdate-libs) ${swupdate-ipc-lib}" LDLIBS="$(LDLIBS)" tests + $(Q)$(MAKE) $(build)=test SWOBJS="$(swupdate-objs)" SWLIBS="$(swupdate-libs) ${swupdate-ipc-lib}" EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" LDLIBS="$(LDLIBS)" tests # The actual objects are generated when descending, # make sure no implicit rule kicks in diff --git a/Makefile.flags b/Makefile.flags index 019ef777de75..1a3f6e712cc2 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -89,7 +89,7 @@ endif # Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES)) define pkg_check_modules $(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2)) -$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2)) +$(1)_LDFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs-only-L $(2)) $(1)_LDLIBS := $(patsubst -l%,%,$(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs-only-l $(2))) endef @@ -112,7 +112,7 @@ ifneq ($(CONFIG_LUA),) LDFLAGS_swupdate += -Wl,-E $(eval $(call pkg_check_modules, LUABUILD, ${CONFIG_LUAPKG})) KBUILD_CFLAGS += $(LUABUILD_CFLAGS) -KBUILD_LIBS += $(LUABUILD_LIBS) +EXTRA_LDFLAGS += $(LUABUILD_LDFLAGS) LDLIBS += $(LUABUILD_LDLIBS) LUAVER := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --modversion ${CONFIG_LUAPKG} | cut -d'.' -f1,2) endif