All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
@ 2016-10-29  8:47 Khem Raj
  2016-10-30 13:34 ` Andreas Müller
  2016-11-01 18:28 ` Andre McCurdy
  0 siblings, 2 replies; 11+ messages in thread
From: Khem Raj @ 2016-10-29  8:47 UTC (permalink / raw)
  To: openembedded-core

This has been cause of issue where we were getting both usr/include
dirs ( from target as well as native sysroot) added to compiler
flags.

CXX_INCLUDES in final flags.cmake would include
-I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
most of the time it would work since headers are mostly
common but netflix package failed to compile since one of
the headers was including curl headers which it could not
find in target sysroot and it went to next include path
and found it in native sysroot which is not what we want
when doing cross compile.

As per https://cmake.org/Wiki/CMake_Cross_Compiling
never search for programs in target sysroot but search
for packages,libs,includes only.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/cmake.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 3e762de..3e8df37 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
 OECMAKE_EXTRA_ROOT_PATH ?= ""
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
 
 EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
@@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
 
 # only search in the paths provided so cmake doesnt pick
 # up libraries and tools from the native build machine
-set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
 set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
-- 
2.10.1



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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-29  8:47 [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH Khem Raj
@ 2016-10-30 13:34 ` Andreas Müller
  2016-10-30 17:38   ` Khem Raj
  2016-11-01 18:28 ` Andre McCurdy
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2016-10-30 13:34 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
> This has been cause of issue where we were getting both usr/include
> dirs ( from target as well as native sysroot) added to compiler
> flags.
>
> CXX_INCLUDES in final flags.cmake would include
> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
> most of the time it would work since headers are mostly
> common but netflix package failed to compile since one of
> the headers was including curl headers which it could not
> find in target sysroot and it went to next include path
> and found it in native sysroot which is not what we want
> when doing cross compile.
>
> As per https://cmake.org/Wiki/CMake_Cross_Compiling
> never search for programs in target sysroot but search
> for packages,libs,includes only.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/cmake.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index 3e762de..3e8df37 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>
>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
^ Split this into a second patch please you are changing two more or
less unrelated settings in one patch.
>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>
>  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>
>  # only search in the paths provided so cmake doesnt pick
>  # up libraries and tools from the native build machine
> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
^ Are you sure this doesn't break native builds? I am a bit scared: In
meta-qt5-extra I have lot's of native builds for build-helpers. KDE
guys seem to prefer this over shell scripts...

Andreas


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-30 13:34 ` Andreas Müller
@ 2016-10-30 17:38   ` Khem Raj
  2016-10-30 20:07     ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2016-10-30 17:38 UTC (permalink / raw)
  To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer

On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
<schnitzeltony@googlemail.com> wrote:
> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>> This has been cause of issue where we were getting both usr/include
>> dirs ( from target as well as native sysroot) added to compiler
>> flags.
>>
>> CXX_INCLUDES in final flags.cmake would include
>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>> most of the time it would work since headers are mostly
>> common but netflix package failed to compile since one of
>> the headers was including curl headers which it could not
>> find in target sysroot and it went to next include path
>> and found it in native sysroot which is not what we want
>> when doing cross compile.
>>
>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>> never search for programs in target sysroot but search
>> for packages,libs,includes only.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/classes/cmake.bbclass | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>> index 3e762de..3e8df37 100644
>> --- a/meta/classes/cmake.bbclass
>> +++ b/meta/classes/cmake.bbclass
>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>>
>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
> ^ Split this into a second patch please you are changing two more or
> less unrelated settings in one patch.

These changes are related and should stay together in same patch
otherwise it will break.

>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>
>>  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>
>>  # only search in the paths provided so cmake doesnt pick
>>  # up libraries and tools from the native build machine
>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
> ^ Are you sure this doesn't break native builds? I am a bit scared: In
> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
> guys seem to prefer this over shell scripts...

It hasnt broken anything for my world builds thus far. I dont use
meta-qt5-extras though. So testing help is welcome.


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-30 17:38   ` Khem Raj
@ 2016-10-30 20:07     ` Andreas Müller
  2016-10-31 12:48       ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2016-10-30 20:07 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Sun, Oct 30, 2016 at 6:38 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
> <schnitzeltony@googlemail.com> wrote:
>> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>> This has been cause of issue where we were getting both usr/include
>>> dirs ( from target as well as native sysroot) added to compiler
>>> flags.
>>>
>>> CXX_INCLUDES in final flags.cmake would include
>>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>>> most of the time it would work since headers are mostly
>>> common but netflix package failed to compile since one of
>>> the headers was including curl headers which it could not
>>> find in target sysroot and it went to next include path
>>> and found it in native sysroot which is not what we want
>>> when doing cross compile.
>>>
>>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>>> never search for programs in target sysroot but search
>>> for packages,libs,includes only.
>>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>>  meta/classes/cmake.bbclass | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>> index 3e762de..3e8df37 100644
>>> --- a/meta/classes/cmake.bbclass
>>> +++ b/meta/classes/cmake.bbclass
>>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>>>
>>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>> ^ Split this into a second patch please you are changing two more or
>> less unrelated settings in one patch.
>
> These changes are related and should stay together in same patch
> otherwise it will break.
>
>>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>>
>>>  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>>
>>>  # only search in the paths provided so cmake doesnt pick
>>>  # up libraries and tools from the native build machine
>>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>> ^ Are you sure this doesn't break native builds? I am a bit scared: In
>> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
>> guys seem to prefer this over shell scripts...
>
> It hasnt broken anything for my world builds thus far. I dont use
> meta-qt5-extras though. So testing help is welcome.
I'll give it a meta-qt5-extra world build and let you know

Andreas


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-30 20:07     ` Andreas Müller
@ 2016-10-31 12:48       ` Andreas Müller
  2016-10-31 16:25         ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2016-10-31 12:48 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Sun, Oct 30, 2016 at 9:07 PM, Andreas Müller
<schnitzeltony@googlemail.com> wrote:
> On Sun, Oct 30, 2016 at 6:38 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
>> <schnitzeltony@googlemail.com> wrote:
>>> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>>> This has been cause of issue where we were getting both usr/include
>>>> dirs ( from target as well as native sysroot) added to compiler
>>>> flags.
>>>>
>>>> CXX_INCLUDES in final flags.cmake would include
>>>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>>>> most of the time it would work since headers are mostly
>>>> common but netflix package failed to compile since one of
>>>> the headers was including curl headers which it could not
>>>> find in target sysroot and it went to next include path
>>>> and found it in native sysroot which is not what we want
>>>> when doing cross compile.
>>>>
>>>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>>>> never search for programs in target sysroot but search
>>>> for packages,libs,includes only.
>>>>
>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> ---
>>>>  meta/classes/cmake.bbclass | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>>> index 3e762de..3e8df37 100644
>>>> --- a/meta/classes/cmake.bbclass
>>>> +++ b/meta/classes/cmake.bbclass
>>>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>>>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>>>>
>>>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>>>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>>> ^ Split this into a second patch please you are changing two more or
>>> less unrelated settings in one patch.
>>
>> These changes are related and should stay together in same patch
>> otherwise it will break.
>>
>>>>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>>>
>>>>  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>>>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>>>
>>>>  # only search in the paths provided so cmake doesnt pick
>>>>  # up libraries and tools from the native build machine
>>>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>> ^ Are you sure this doesn't break native builds? I am a bit scared: In
>>> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
>>> guys seem to prefer this over shell scripts...
>>
>> It hasnt broken anything for my world builds thus far. I dont use
>> meta-qt5-extras though. So testing help is welcome.
> I'll give it a meta-qt5-extra world build and let you know
>
Huge fallout:

  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/karchive/karchive.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier2/kdoctools/kdoctools-native.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwindowsystem/kwindowsystem.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcodecs/kcodecs.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kconfig/kconfig.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kguiaddons/kguiaddons.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdbusaddons/kdbusaddons.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kitemviews/kitemviews.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/attica/attica.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/sonnet/sonnet.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcoreaddons/kcoreaddons-native.bb:do_compile
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kidletime/kidletime.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwayland/kwayland.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/libqtxdg/libqtxdg_git.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/threadweaver/threadweaver.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/networkmanager-qt/networkmanager-qt.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdnssd/kdnssd.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/modemmanager-qt/modemmanager-qt.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/projectm/projectm_git.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kplotting/kplotting.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/breeze-icons/breeze-icons.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/compton-conf/compton-conf_git.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/qterminal/qterminal_git.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/obconf-qt/obconf-qt_git.bb:do_configure
  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb:do_compile

so please don't apply this one

Andreas


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-31 12:48       ` Andreas Müller
@ 2016-10-31 16:25         ` Khem Raj
  2016-10-31 17:49           ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2016-10-31 16:25 UTC (permalink / raw)
  To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 6381 bytes --]


> On Oct 31, 2016, at 5:48 AM, Andreas Müller <schnitzeltony@googlemail.com> wrote:
> 
> On Sun, Oct 30, 2016 at 9:07 PM, Andreas Müller
> <schnitzeltony@googlemail.com> wrote:
>> On Sun, Oct 30, 2016 at 6:38 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
>>> <schnitzeltony@googlemail.com> wrote:
>>>> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>> This has been cause of issue where we were getting both usr/include
>>>>> dirs ( from target as well as native sysroot) added to compiler
>>>>> flags.
>>>>> 
>>>>> CXX_INCLUDES in final flags.cmake would include
>>>>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>>>>> most of the time it would work since headers are mostly
>>>>> common but netflix package failed to compile since one of
>>>>> the headers was including curl headers which it could not
>>>>> find in target sysroot and it went to next include path
>>>>> and found it in native sysroot which is not what we want
>>>>> when doing cross compile.
>>>>> 
>>>>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>>>>> never search for programs in target sysroot but search
>>>>> for packages,libs,includes only.
>>>>> 
>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>>> ---
>>>>> meta/classes/cmake.bbclass | 3 ++-
>>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>> 
>>>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>>>> index 3e762de..3e8df37 100644
>>>>> --- a/meta/classes/cmake.bbclass
>>>>> +++ b/meta/classes/cmake.bbclass
>>>>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>>>> OECMAKE_EXTRA_ROOT_PATH ?= ""
>>>>> 
>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>>>>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>>>> ^ Split this into a second patch please you are changing two more or
>>>> less unrelated settings in one patch.
>>> 
>>> These changes are related and should stay together in same patch
>>> otherwise it will break.
>>> 
>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>>>> 
>>>>> EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>>>>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>>>> 
>>>>> # only search in the paths provided so cmake doesnt pick
>>>>> # up libraries and tools from the native build machine
>>>>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>> ^ Are you sure this doesn't break native builds? I am a bit scared: In
>>>> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
>>>> guys seem to prefer this over shell scripts...
>>> 
>>> It hasnt broken anything for my world builds thus far. I dont use
>>> meta-qt5-extras though. So testing help is welcome.
>> I'll give it a meta-qt5-extra world build and let you know
>> 
> Huge fallout:
> 
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/karchive/karchive.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier2/kdoctools/kdoctools-native.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwindowsystem/kwindowsystem.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcodecs/kcodecs.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kconfig/kconfig.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kguiaddons/kguiaddons.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdbusaddons/kdbusaddons.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kitemviews/kitemviews.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/attica/attica.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/sonnet/sonnet.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcoreaddons/kcoreaddons-native.bb:do_compile
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kidletime/kidletime.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwayland/kwayland.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/libqtxdg/libqtxdg_git.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/threadweaver/threadweaver.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/networkmanager-qt/networkmanager-qt.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdnssd/kdnssd.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/modemmanager-qt/modemmanager-qt.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/projectm/projectm_git.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kplotting/kplotting.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/breeze-icons/breeze-icons.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/compton-conf/compton-conf_git.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/qterminal/qterminal_git.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/obconf-qt/obconf-qt_git.bb:do_configure
>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb:do_compile


> 
> so please don't apply this one

Not yet, but specify both native includedir and target includedir while building something is broken at core
that must be fixed in anycase. May be these fallouts are just latent issues that were papered over in past.
Can you upload the logs somewhere ?

> 
> Andreas


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-31 16:25         ` Khem Raj
@ 2016-10-31 17:49           ` Andreas Müller
  2016-10-31 17:51             ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2016-10-31 17:49 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Mon, Oct 31, 2016 at 5:25 PM, Khem Raj <raj.khem@gmail.com> wrote:
>
>> On Oct 31, 2016, at 5:48 AM, Andreas Müller <schnitzeltony@googlemail.com> wrote:
>>
>> On Sun, Oct 30, 2016 at 9:07 PM, Andreas Müller
>> <schnitzeltony@googlemail.com> wrote:
>>> On Sun, Oct 30, 2016 at 6:38 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>> On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
>>>> <schnitzeltony@googlemail.com> wrote:
>>>>> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>> This has been cause of issue where we were getting both usr/include
>>>>>> dirs ( from target as well as native sysroot) added to compiler
>>>>>> flags.
>>>>>>
>>>>>> CXX_INCLUDES in final flags.cmake would include
>>>>>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>>>>>> most of the time it would work since headers are mostly
>>>>>> common but netflix package failed to compile since one of
>>>>>> the headers was including curl headers which it could not
>>>>>> find in target sysroot and it went to next include path
>>>>>> and found it in native sysroot which is not what we want
>>>>>> when doing cross compile.
>>>>>>
>>>>>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>>>>>> never search for programs in target sysroot but search
>>>>>> for packages,libs,includes only.
>>>>>>
>>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>>>> ---
>>>>>> meta/classes/cmake.bbclass | 3 ++-
>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>>>>> index 3e762de..3e8df37 100644
>>>>>> --- a/meta/classes/cmake.bbclass
>>>>>> +++ b/meta/classes/cmake.bbclass
>>>>>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>>>>> OECMAKE_EXTRA_ROOT_PATH ?= ""
>>>>>>
>>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>>>>>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>>>>> ^ Split this into a second patch please you are changing two more or
>>>>> less unrelated settings in one patch.
>>>>
>>>> These changes are related and should stay together in same patch
>>>> otherwise it will break.
>>>>
>>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>>>>>
>>>>>> EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>>>>>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>>>>>
>>>>>> # only search in the paths provided so cmake doesnt pick
>>>>>> # up libraries and tools from the native build machine
>>>>>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>>>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>>> ^ Are you sure this doesn't break native builds? I am a bit scared: In
>>>>> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
>>>>> guys seem to prefer this over shell scripts...
>>>>
>>>> It hasnt broken anything for my world builds thus far. I dont use
>>>> meta-qt5-extras though. So testing help is welcome.
>>> I'll give it a meta-qt5-extra world build and let you know
>>>
>> Huge fallout:
>>
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/karchive/karchive.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier2/kdoctools/kdoctools-native.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwindowsystem/kwindowsystem.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcodecs/kcodecs.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kconfig/kconfig.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kguiaddons/kguiaddons.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdbusaddons/kdbusaddons.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kitemviews/kitemviews.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/attica/attica.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/sonnet/sonnet.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcoreaddons/kcoreaddons-native.bb:do_compile
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kidletime/kidletime.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwayland/kwayland.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/libqtxdg/libqtxdg_git.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/threadweaver/threadweaver.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/networkmanager-qt/networkmanager-qt.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdnssd/kdnssd.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/modemmanager-qt/modemmanager-qt.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/projectm/projectm_git.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kplotting/kplotting.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/breeze-icons/breeze-icons.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/compton-conf/compton-conf_git.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/qterminal/qterminal_git.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/obconf-qt/obconf-qt_git.bb:do_configure
>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb:do_compile
>
>
>>
>> so please don't apply this one
>
> Not yet, but specify both native includedir and target includedir while building something is broken at core
> that must be fixed in anycase. May be these fallouts are just latent issues that were papered over in past.
> Can you upload the logs somewhere ?
>
Sorry I killed them - my harddisk is not able to keep much more than 2
tmpdirs and I lost 1 day for this test already. I think the problem is
that you want to kill references to includedir but you kill all
references even those to native binaries addressed and required by
cmake. These native binaries cannot be addressed anymore without
searching in native sysroot and there is nothing wrong about it.

Andreas


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-31 17:49           ` Andreas Müller
@ 2016-10-31 17:51             ` Andreas Müller
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Müller @ 2016-10-31 17:51 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Mon, Oct 31, 2016 at 6:49 PM, Andreas Müller
<schnitzeltony@googlemail.com> wrote:
> On Mon, Oct 31, 2016 at 5:25 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>> On Oct 31, 2016, at 5:48 AM, Andreas Müller <schnitzeltony@googlemail.com> wrote:
>>>
>>> On Sun, Oct 30, 2016 at 9:07 PM, Andreas Müller
>>> <schnitzeltony@googlemail.com> wrote:
>>>> On Sun, Oct 30, 2016 at 6:38 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>> On Sun, Oct 30, 2016 at 6:34 AM, Andreas Müller
>>>>> <schnitzeltony@googlemail.com> wrote:
>>>>>> On Sat, Oct 29, 2016 at 10:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>> This has been cause of issue where we were getting both usr/include
>>>>>>> dirs ( from target as well as native sysroot) added to compiler
>>>>>>> flags.
>>>>>>>
>>>>>>> CXX_INCLUDES in final flags.cmake would include
>>>>>>> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>>>>>>> most of the time it would work since headers are mostly
>>>>>>> common but netflix package failed to compile since one of
>>>>>>> the headers was including curl headers which it could not
>>>>>>> find in target sysroot and it went to next include path
>>>>>>> and found it in native sysroot which is not what we want
>>>>>>> when doing cross compile.
>>>>>>>
>>>>>>> As per https://cmake.org/Wiki/CMake_Cross_Compiling
>>>>>>> never search for programs in target sysroot but search
>>>>>>> for packages,libs,includes only.
>>>>>>>
>>>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>>>>> ---
>>>>>>> meta/classes/cmake.bbclass | 3 ++-
>>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>>>>>> index 3e762de..3e8df37 100644
>>>>>>> --- a/meta/classes/cmake.bbclass
>>>>>>> +++ b/meta/classes/cmake.bbclass
>>>>>>> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>>>>>>> OECMAKE_EXTRA_ROOT_PATH ?= ""
>>>>>>>
>>>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>>>>>>> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>>>>>> ^ Split this into a second patch please you are changing two more or
>>>>>> less unrelated settings in one patch.
>>>>>
>>>>> These changes are related and should stay together in same patch
>>>>> otherwise it will break.
>>>>>
>>>>>>> OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>>>>>>>
>>>>>>> EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>>>>>>> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>>>>>>>
>>>>>>> # only search in the paths provided so cmake doesnt pick
>>>>>>> # up libraries and tools from the native build machine
>>>>>>> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>>>>> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>>>>>> ^ Are you sure this doesn't break native builds? I am a bit scared: In
>>>>>> meta-qt5-extra I have lot's of native builds for build-helpers. KDE
>>>>>> guys seem to prefer this over shell scripts...
>>>>>
>>>>> It hasnt broken anything for my world builds thus far. I dont use
>>>>> meta-qt5-extras though. So testing help is welcome.
>>>> I'll give it a meta-qt5-extra world build and let you know
>>>>
>>> Huge fallout:
>>>
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/karchive/karchive.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier2/kdoctools/kdoctools-native.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwindowsystem/kwindowsystem.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcodecs/kcodecs.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kconfig/kconfig.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kguiaddons/kguiaddons.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdbusaddons/kdbusaddons.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kitemviews/kitemviews.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/attica/attica.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/sonnet/sonnet.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kcoreaddons/kcoreaddons-native.bb:do_compile
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kidletime/kidletime.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kwayland/kwayland.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/libqtxdg/libqtxdg_git.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/threadweaver/threadweaver.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/networkmanager-qt/networkmanager-qt.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kdnssd/kdnssd.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/modemmanager-qt/modemmanager-qt.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/projectm/projectm_git.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/kplotting/kplotting.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-kde/kf5/tier1/breeze-icons/breeze-icons.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/compton-conf/compton-conf_git.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/qterminal/qterminal_git.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-lxqt/obconf-qt/obconf-qt_git.bb:do_configure
>>>  /home/superandy/data/oe-core/sources/meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb:do_compile
>>
>>
>>>
>>> so please don't apply this one
>>
>> Not yet, but specify both native includedir and target includedir while building something is broken at core
>> that must be fixed in anycase. May be these fallouts are just latent issues that were papered over in past.
>> Can you upload the logs somewhere ?
>>
> Sorry I killed them - my harddisk is not able to keep much more than 2
> tmpdirs and I lost 1 day for this test already. I think the problem is
> that you want to kill references to includedir but you kill all
> references even those to native binaries addressed and required by
> cmake. These native binaries cannot be addressed anymore without
> searching in native sysroot and there is nothing wrong about it.
I was not precise enough: replace native binaries by native executables.

Andreas


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-10-29  8:47 [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH Khem Raj
  2016-10-30 13:34 ` Andreas Müller
@ 2016-11-01 18:28 ` Andre McCurdy
  2016-11-01 18:33   ` Khem Raj
  1 sibling, 1 reply; 11+ messages in thread
From: Andre McCurdy @ 2016-11-01 18:28 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Sat, Oct 29, 2016 at 1:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
> This has been cause of issue where we were getting both usr/include
> dirs ( from target as well as native sysroot) added to compiler
> flags.
>
> CXX_INCLUDES in final flags.cmake would include
> -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
> most of the time it would work since headers are mostly
> common but netflix package failed to compile since one of
> the headers was including curl headers which it could not
> find in target sysroot and it went to next include path
> and found it in native sysroot which is not what we want
> when doing cross compile.
>
> As per https://cmake.org/Wiki/CMake_Cross_Compiling
> never search for programs in target sysroot but search
> for packages,libs,includes only.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/cmake.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index 3e762de..3e8df37 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>
>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"

Using the _class-target over-ride looks odd. Perhaps making "NEVER"
the default and adding over-rides for the classes which need "ONLY"
(if there are any?) would make this clearer?

>  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>
>  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
> @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>
>  # only search in the paths provided so cmake doesnt pick
>  # up libraries and tools from the native build machine
> -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
> +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>  set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
>  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
>  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
> --
> 2.10.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-11-01 18:28 ` Andre McCurdy
@ 2016-11-01 18:33   ` Khem Raj
  2016-11-05 16:39     ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2016-11-01 18:33 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2830 bytes --]

On Nov 1, 2016 11:28 AM, "Andre McCurdy" <armccurdy@gmail.com> wrote:
>
> On Sat, Oct 29, 2016 at 1:47 AM, Khem Raj <raj.khem@gmail.com> wrote:
> > This has been cause of issue where we were getting both usr/include
> > dirs ( from target as well as native sysroot) added to compiler
> > flags.
> >
> > CXX_INCLUDES in final flags.cmake would include
> > -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
> > most of the time it would work since headers are mostly
> > common but netflix package failed to compile since one of
> > the headers was including curl headers which it could not
> > find in target sysroot and it went to next include path
> > and found it in native sysroot which is not what we want
> > when doing cross compile.
> >
> > As per https://cmake.org/Wiki/CMake_Cross_Compiling
> > never search for programs in target sysroot but search
> > for packages,libs,includes only.
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/classes/cmake.bbclass | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> > index 3e762de..3e8df37 100644
> > --- a/meta/classes/cmake.bbclass
> > +++ b/meta/classes/cmake.bbclass
> > @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
> >  OECMAKE_EXTRA_ROOT_PATH ?= ""
> >
> >  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
> > +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>
> Using the _class-target over-ride looks odd. Perhaps making "NEVER"
> the default and adding over-rides for the classes which need "ONLY"
> (if there are any?) would make this clearer?
>

Yeah I plan to rework this a bit in that direction
> >  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
> >
> >  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
> > @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}"
CACHE STRING "LDFLAGS" )
> >
> >  # only search in the paths provided so cmake doesnt pick
> >  # up libraries and tools from the native build machine
> > -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE}
${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH}
${EXTERNAL_TOOLCHAIN})
> > +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR}
${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
> >  set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
> >  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
> >  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
> > --
> > 2.10.1
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 3911 bytes --]

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

* Re: [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH
  2016-11-01 18:33   ` Khem Raj
@ 2016-11-05 16:39     ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2016-11-05 16:39 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer



On 11/1/16 11:33 AM, Khem Raj wrote:
> On Nov 1, 2016 11:28 AM, "Andre McCurdy" <armccurdy@gmail.com
> <mailto:armccurdy@gmail.com>> wrote:
>>
>> On Sat, Oct 29, 2016 at 1:47 AM, Khem Raj <raj.khem@gmail.com
> <mailto:raj.khem@gmail.com>> wrote:
>> > This has been cause of issue where we were getting both usr/include
>> > dirs ( from target as well as native sysroot) added to compiler
>> > flags.
>> >
>> > CXX_INCLUDES in final flags.cmake would include
>> > -I<target-sysroot>/usr/include -I<native-sysroot>/usr/include
>> > most of the time it would work since headers are mostly
>> > common but netflix package failed to compile since one of
>> > the headers was including curl headers which it could not
>> > find in target sysroot and it went to next include path
>> > and found it in native sysroot which is not what we want
>> > when doing cross compile.
>> >
>> > As per https://cmake.org/Wiki/CMake_Cross_Compiling
>> > never search for programs in target sysroot but search
>> > for packages,libs,includes only.
>> >
>> > Signed-off-by: Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>>
>> > ---
>> >  meta/classes/cmake.bbclass | 3 ++-
>> >  1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>> > index 3e762de..3e8df37 100644
>> > --- a/meta/classes/cmake.bbclass
>> > +++ b/meta/classes/cmake.bbclass
>> > @@ -25,6 +25,7 @@ OECMAKE_PERLNATIVE_DIR ??= ""
>> >  OECMAKE_EXTRA_ROOT_PATH ?= ""
>> >
>> >  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
>> > +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-target = "NEVER"
>>
>> Using the _class-target over-ride looks odd. Perhaps making "NEVER"
>> the default and adding over-rides for the classes which need "ONLY"
>> (if there are any?) would make this clearer?
>>
> 
> Yeah I plan to rework this a bit in that direction

thinking a bit more about this problem. It doesn't seem to be solvable
with the current limitations that we have for cross compiling with cmake
in OE environment.

What we want is

1. When compiling target packages that we should be able to use binaries and
programs from native sysroot but not libraries, packages and includes

This is not possible since for this we have to add both native and target
sysroots to CMAKE_FIND_ROOT_PATH, but there is no fine grained selection
method for expressive the requirement 1 above. We only have options
ONLY - Look for files only in paths specified in CMAKE_FIND_ROOT_PATH
BOTH - Along with above also look into build hosts root dir
NEVER - Only look for files in build hosts root dir

so we can not set CMAKE_FIND_ROOT_PATH dynamically according to MODE variables
and hence the problem persists.

cmake does not cater to OE usecase where we have native sysroot along with
host to complement native packages. It only assumes there is build host and
the target sysroot.

>> >  OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
>> >
>> >  EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
>> > @@ -60,7 +61,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}"
> CACHE STRING "LDFLAGS" )
>> >
>> >  # only search in the paths provided so cmake doesnt pick
>> >  # up libraries and tools from the native build machine
>> > -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE}
> ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH}
> ${EXTERNAL_TOOLCHAIN})
>> > +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${CROSS_DIR}
> ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
>> >  set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
>> >  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
> ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
>> >  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
>> > --
>> > 2.10.1
>> >
>> > --
>> > _______________________________________________
>> > Openembedded-core mailing list
>> > Openembedded-core@lists.openembedded.org
> <mailto:Openembedded-core@lists.openembedded.org>
>> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 


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

end of thread, other threads:[~2016-11-05 16:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-29  8:47 [PATCH] cmake.bbclass: Exclude native sysroot from CMAKE_FIND_ROOT_PATH Khem Raj
2016-10-30 13:34 ` Andreas Müller
2016-10-30 17:38   ` Khem Raj
2016-10-30 20:07     ` Andreas Müller
2016-10-31 12:48       ` Andreas Müller
2016-10-31 16:25         ` Khem Raj
2016-10-31 17:49           ` Andreas Müller
2016-10-31 17:51             ` Andreas Müller
2016-11-01 18:28 ` Andre McCurdy
2016-11-01 18:33   ` Khem Raj
2016-11-05 16:39     ` Khem Raj

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.