From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbdF3LB5 (ORCPT ); Fri, 30 Jun 2017 07:01:57 -0400 Received: from ozlabs.org ([103.22.144.67]:47325 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdF3LBQ (ORCPT ); Fri, 30 Jun 2017 07:01:16 -0400 From: Michael Ellerman To: Fathi Boudra Cc: linux-kselftest@vger.kernel.org, Shuah Khan , "linux-kernel\@vger.kernel.org" , Bamvor Jian Zhang Subject: Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS In-Reply-To: References: <20170629065802.24062-1-fathi.boudra@linaro.org> <87shij9nhl.fsf@concordia.ellerman.id.au> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Fri, 30 Jun 2017 21:01:14 +1000 Message-ID: <87shihpwn9.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fathi Boudra writes: > On 29 June 2017 at 12:01, Michael Ellerman wrote: >> Fathi Boudra writes: >> >>> Fix hardcoded and misplaced libmount headers. Use pkg-config instead to >>> figure out CFLAGS/LDLIBS, fixing also their value for cross-compilation. >> >> Can you explain how it fixes the values for cross-compilation? > > When pkg-config is invoked in a cross-build environment, it will > return your sysroot headers path instead of the hardcoded > -I/usr/include/libmount > > For example in my oe environment, when I invoke "pkg-config --cflags > mount", it returns: > -I/build/tmp-rpb-glibc/sysroots/hikey/usr/include/libmount Right, presumably because OE is setting PKG_CONFIG_SYSROOT_DIR etc. So for folks doing it by hand it doesn't really help with cross compiling, but I guess it doesn't hurt either. cheers