All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib
@ 2019-10-21 12:38 Thomas Preston
  2019-10-21 14:18 ` Thomas Petazzoni
  2020-09-15 20:42 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Preston @ 2019-10-21 12:38 UTC (permalink / raw)
  To: buildroot

Recently, a change to the pkg-config wrapper made it more explicit about
where the system include and library directories are, so that pkgconf
does not print them. See upstream commit 9cc8680.

By default, we configure the pkg-config wrapper for the target sysroot,
however the default system include and library directories are not
reconfigured for the host build environment (they still point at the
target sysroot). Fix this by adding the host system include and library
directories to HOST_MAKE_ENV.

Note: this isn't likely to fix any bugs at present, but the incorrect
configuration may hide an include-order related error which the original
patch was supposed to fix!

Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
---
 package/Makefile.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index 0a7899c852..3ae4d4d4e9 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -309,6 +309,8 @@ HOST_MAKE_ENV = \
 	PATH=$(BR_PATH) \
 	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
 	PKG_CONFIG_SYSROOT_DIR="/" \
+	PKG_CONFIG_SYSTEM_INCLUDE_PATH="/usr/include" \
+	PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/lib" \
 	PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
 	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig"
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib
  2019-10-21 12:38 [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib Thomas Preston
@ 2019-10-21 14:18 ` Thomas Petazzoni
  2019-10-22 19:31   ` Arnout Vandecappelle
  2020-09-15 20:42 ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2019-10-21 14:18 UTC (permalink / raw)
  To: buildroot

On Mon, 21 Oct 2019 13:38:10 +0100
Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> Recently, a change to the pkg-config wrapper made it more explicit about
> where the system include and library directories are, so that pkgconf
> does not print them. See upstream commit 9cc8680.
> 
> By default, we configure the pkg-config wrapper for the target sysroot,
> however the default system include and library directories are not
> reconfigured for the host build environment (they still point at the
> target sysroot). Fix this by adding the host system include and library
> directories to HOST_MAKE_ENV.
> 
> Note: this isn't likely to fix any bugs at present, but the incorrect
> configuration may hide an include-order related error which the original
> patch was supposed to fix!

I think this could potentially fix:

  https://bugs.busybox.net/show_bug.cgi?id=11776
  https://bugs.busybox.net/show_bug.cgi?id=12131

which are precisely include-order related.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib
  2019-10-21 14:18 ` Thomas Petazzoni
@ 2019-10-22 19:31   ` Arnout Vandecappelle
  2019-10-23 12:19     ` Thomas Preston
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2019-10-22 19:31 UTC (permalink / raw)
  To: buildroot



On 21/10/2019 16:18, Thomas Petazzoni wrote:
> On Mon, 21 Oct 2019 13:38:10 +0100
> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
> 
>> Recently, a change to the pkg-config wrapper made it more explicit about
>> where the system include and library directories are, so that pkgconf
>> does not print them. See upstream commit 9cc8680.
>>
>> By default, we configure the pkg-config wrapper for the target sysroot,
>> however the default system include and library directories are not
>> reconfigured for the host build environment (they still point at the
>> target sysroot). Fix this by adding the host system include and library
>> directories to HOST_MAKE_ENV.
>>
>> Note: this isn't likely to fix any bugs at present, but the incorrect
>> configuration may hide an include-order related error which the original
>> patch was supposed to fix!
> 
> I think this could potentially fix:
> 
>   https://bugs.busybox.net/show_bug.cgi?id=11776
>   https://bugs.busybox.net/show_bug.cgi?id=12131
> 
> which are precisely include-order related.

 It's not very likely that a change in HOST_MAKE_ENV will fix an issue when
building a target package...

 However, the recently-applied commit 9cc8680fe5 may indeed do so. I'll do a
test build and update the issues if they're fixed.

 Regards,
 Arnout

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib
  2019-10-22 19:31   ` Arnout Vandecappelle
@ 2019-10-23 12:19     ` Thomas Preston
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Preston @ 2019-10-23 12:19 UTC (permalink / raw)
  To: buildroot

On 22/10/2019 20:31, Arnout Vandecappelle wrote:
> On 21/10/2019 16:18, Thomas Petazzoni wrote:
>> On Mon, 21 Oct 2019 13:38:10 +0100
>> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
>>
>>> Recently, a change to the pkg-config wrapper made it more explicit about
>>> where the system include and library directories are, so that pkgconf
>>> does not print them. See upstream commit 9cc8680.
>>>
>>> By default, we configure the pkg-config wrapper for the target sysroot,
>>> however the default system include and library directories are not
>>> reconfigured for the host build environment (they still point at the
>>> target sysroot). Fix this by adding the host system include and library
>>> directories to HOST_MAKE_ENV.
>>>
>>> Note: this isn't likely to fix any bugs at present, but the incorrect
>>> configuration may hide an include-order related error which the original
>>> patch was supposed to fix!
>>
>> I think this could potentially fix:
>>
>>   https://bugs.busybox.net/show_bug.cgi?id=11776
>>   https://bugs.busybox.net/show_bug.cgi?id=12131
>>
>> which are precisely include-order related.
> 
>  It's not very likely that a change in HOST_MAKE_ENV will fix an issue when
> building a target package...
> 
>  However, the recently-applied commit 9cc8680fe5 may indeed do so. I'll do a
> test build and update the issues if they're fixed.
> 

fwiw I just tested the last posted config [0] based on 37be55a5db (no fix)
and master + HOST_MAKE_ENV fix, and see the same error in both:

	/mnt/output/host/i586-buildroot-linux-gnu/include/c++/9.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
	   75 | #include_next <stdlib.h>

Which suggest these patches don't fix this particular issue.

[0] https://bugs.busybox.net/show_bug.cgi?id=11776#c4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib
  2019-10-21 12:38 [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib Thomas Preston
  2019-10-21 14:18 ` Thomas Petazzoni
@ 2020-09-15 20:42 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-09-15 20:42 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

Sorry for the long delay in getting back to this patch.

On Mon, 21 Oct 2019 13:38:10 +0100
Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> Recently, a change to the pkg-config wrapper made it more explicit about
> where the system include and library directories are, so that pkgconf
> does not print them. See upstream commit 9cc8680.
> 
> By default, we configure the pkg-config wrapper for the target sysroot,
> however the default system include and library directories are not
> reconfigured for the host build environment (they still point at the
> target sysroot). Fix this by adding the host system include and library
> directories to HOST_MAKE_ENV.
> 
> Note: this isn't likely to fix any bugs at present, but the incorrect
> configuration may hide an include-order related error which the original
> patch was supposed to fix!
> 
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
> ---
>  package/Makefile.in | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 0a7899c852..3ae4d4d4e9 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -309,6 +309,8 @@ HOST_MAKE_ENV = \
>  	PATH=$(BR_PATH) \
>  	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
>  	PKG_CONFIG_SYSROOT_DIR="/" \
> +	PKG_CONFIG_SYSTEM_INCLUDE_PATH="/usr/include" \
> +	PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/lib" \

So, today, Peter Korsgaard and me discussed this patch. While I think
we understand the idea of telling pkg-config that it is useless to emit
-I and -L options pointing to the default header/library paths of the
host compiler, the issue is that nothing guarantees that /usr/include
and /usr/lib are really the standard path for the host compiler, and
that these are the only paths.

Since your change was apparently not related to the fix of a specific
issue, and was merely there to improve "correctness", we don't think it
makes sense to have it if it's in fact not really correct for systems
where header/libraries are not in /usr/include and /usr/lib
respectively.

Of course, if you have more details about specific issues that this
patch was solving, let us know.

Thanks a lot,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-15 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 12:38 [Buildroot] [PATCH] pkgconf: Add HOST_MAKE_ENV sytem include and lib Thomas Preston
2019-10-21 14:18 ` Thomas Petazzoni
2019-10-22 19:31   ` Arnout Vandecappelle
2019-10-23 12:19     ` Thomas Preston
2020-09-15 20:42 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.