All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system
@ 2017-03-02 21:03 Yann E. MORIN
  2017-03-02 21:03 ` [Buildroot] [PATCH 1/2] support/cmake: impersonate a Linux system even more Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yann E. MORIN @ 2017-03-02 21:03 UTC (permalink / raw)
  To: buildroot

Hello All!

Some packages rely on the system name to decide whether to
enable/disable features and/or link/not link with some libraries, rather
than using detection... :-(

However, the system name is now Buildroot, because we provide our own
platform description, as was suggested by upstream cmake.

So, we tweak our platform description to change the system name back to
"Linux", so that those packages believe they are on Linux (which is
inherently true!)

Secondly, some packages completely overwrite the module path, like
fastd, rather than appending to it. For now, only fastd is handled;
other offenders will be dealt with as they are detected.


Regards,
Yann E. MORIN.


The following changes since commit 8d1128e8a898e32348618721473b82b09f4a6975

  fontconfig: needs host-gperf (2017-03-02 09:24:35 +0100)


are available in the git repository at:

  git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to dd2c4dbd9c75ecc8838363ff3b21651b6aa55373

  package/fastd: do not overwrite the cmake module path (2017-03-02 22:01:02 +0100)


----------------------------------------------------------------
Yann E. MORIN (2):
      support/cmake: impersonate a Linux system even more
      package/fastd: do not overwrite the cmake module path

 ...02-CMakeList-do-not-overwrite-module-path.patch | 56 ++++++++++++++++++++++
 support/misc/Buildroot.cmake                       |  4 ++
 2 files changed, 60 insertions(+)
 create mode 100644 package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] support/cmake: impersonate a Linux system even more
  2017-03-02 21:03 [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Yann E. MORIN
@ 2017-03-02 21:03 ` Yann E. MORIN
  2017-03-02 21:03 ` [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path Yann E. MORIN
  2017-03-02 21:13 ` [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2017-03-02 21:03 UTC (permalink / raw)
  To: buildroot

Some packages test the system name to decide whether to enable/disable
features or link with specific libs.

So we forcefully set the system name form our custom system file, so
that packagses still believe they are running on Linux rather than
Buildroot.

Fixes:
    fastd      : http://autobuild.buildroot.net/results/f1d/f1dfe90068ad62e733f17a22202235415bda3974/
    paho-mqtt-c: http://autobuild.buildroot.net/results/457/457d76279e16247bf58c838a2c5dd0a4f3962c21/
    libiio     : http://autobuild.buildroot.net/results/281/2812b008a0ab6bab5fe4d45eb9ffe4e9496a8cb4/
    and so on...

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Ben Boeckel <mathstuf@gmail.com>
Cc: J?rg Krause <joerg.krause@embedded.rocks>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Samuel Martin <s.martin49@gmail.com>
---
 support/misc/Buildroot.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/support/misc/Buildroot.cmake b/support/misc/Buildroot.cmake
index b0046b3..9f5f565 100644
--- a/support/misc/Buildroot.cmake
+++ b/support/misc/Buildroot.cmake
@@ -1,3 +1,7 @@
+# Impersonate a Linux system. Afterall, that's what we are...
+set(CMAKE_SYSTEM_NAME Linux)
 include(Platform/Linux)
+
+# Override problematic settings, to avoid RPATH against host lib directories.
 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-- 
2.7.4

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

* [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path
  2017-03-02 21:03 [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Yann E. MORIN
  2017-03-02 21:03 ` [Buildroot] [PATCH 1/2] support/cmake: impersonate a Linux system even more Yann E. MORIN
@ 2017-03-02 21:03 ` Yann E. MORIN
  2017-03-02 22:34   ` Alexander Dahl
  2017-03-02 21:13 ` [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Thomas Petazzoni
  2 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2017-03-02 21:03 UTC (permalink / raw)
  To: buildroot

fastd's CMakeList.txt completely overwrites CMAKE_MODULE_PATH with its
own, thus causing cmake to not find our own custom one.

We fix fastd by appending its custom value, rather than replacing.

Fixes;
    http://autobuild.buildroot.net/results/69f/69fb2e3b549a069e2898506db918423e6742c589/

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Alexander Dahl <post@lespocky.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Ben Boeckel <mathstuf@gmail.com>
Cc: J?rg Krause <joerg.krause@embedded.rocks>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Samuel Martin <s.martin49@gmail.com>
---
 ...02-CMakeList-do-not-overwrite-module-path.patch | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch

diff --git a/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch b/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch
new file mode 100644
index 0000000..88c1953
--- /dev/null
+++ b/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch
@@ -0,0 +1,56 @@
+From a925a4cab1b722a2a24b0c1d2a1925f3b766de61 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Thu, 2 Mar 2017 21:43:39 +0100
+Subject: [PATCH] CMakeList: do not overwrite module path
+
+Currently, the CMakeList.txt completely overwrites the CMAKE_MODULE_PATH
+variable.
+
+This is problematic when an upper-layer buildsystem wants to set its own
+module path to use custom modules.
+
+For example, Buldroot [0] provides a custom platform description [1] to fix
+cross-compilation issue. Overwriting the module path means that this
+custom platform description is not found [2].
+
+Providing such a custom platform description is what the upstream cmake
+devs suggest [3], quoting:
+
+    If a toolchain file specifies CMAKE_SYSTEM_NAME such that a custom
+    `Platform/MySystem.cmake` file is loaded then the latter can set
+    them [*] as needed for the target platform.
+
+[*] offending settings causing RPATH issues during cross-compilation.
+
+So we need to append our source tree to the module path, not replace it
+blindly.
+
+[0] https://buildroot.org/
+[1] https://git.buildroot.org/buildroot/tree/support/misc/Buildroot.cmake
+[2] http://autobuild.buildroot.net/results/69f/69fb2e3b549a069e2898506db918423e6742c589/build-end.log
+[3] http://public.kitware.com/pipermail/cmake/2017-February/065063.html
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+---
+Patch applied upstream:
+https://git.universe-factory.net/fastd/commit/?id=a925a4cab1b722a2a24b0c1d2a1925f3b766de61
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 61689b1..2c9c61a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.8.8)
+ 
+-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
++list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+ cmake_policy(SET CMP0017 OLD) # Prefer modules in our module directory
+ 
+ project(FASTD C ASM)
+-- 
+2.7.4
+
-- 
2.7.4

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

* [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system
  2017-03-02 21:03 [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Yann E. MORIN
  2017-03-02 21:03 ` [Buildroot] [PATCH 1/2] support/cmake: impersonate a Linux system even more Yann E. MORIN
  2017-03-02 21:03 ` [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path Yann E. MORIN
@ 2017-03-02 21:13 ` Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2017-03-02 21:13 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu,  2 Mar 2017 22:03:13 +0100, Yann E. MORIN wrote:

> Yann E. MORIN (2):
>       support/cmake: impersonate a Linux system even more
>       package/fastd: do not overwrite the cmake module path

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path
  2017-03-02 21:03 ` [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path Yann E. MORIN
@ 2017-03-02 22:34   ` Alexander Dahl
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2017-03-02 22:34 UTC (permalink / raw)
  To: buildroot

Already applied upstream:

https://git.universe-factory.net/fastd/commit/?id=a925a4cab1b722a2a24b0c1d2a1925f3b766de61

Thanks. :-)

Alex

On Thu, Mar 02, 2017 at 10:03:16PM +0100, Yann E. MORIN wrote:
> fastd's CMakeList.txt completely overwrites CMAKE_MODULE_PATH with its
> own, thus causing cmake to not find our own custom one.
> 
> We fix fastd by appending its custom value, rather than replacing.
> 
> Fixes;
>     http://autobuild.buildroot.net/results/69f/69fb2e3b549a069e2898506db918423e6742c589/
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Alexander Dahl <post@lespocky.de>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: Ben Boeckel <mathstuf@gmail.com>
> Cc: J?rg Krause <joerg.krause@embedded.rocks>
> Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> Cc: Samuel Martin <s.martin49@gmail.com>
> ---
>  ...02-CMakeList-do-not-overwrite-module-path.patch | 56 ++++++++++++++++++++++
>  1 file changed, 56 insertions(+)
>  create mode 100644 package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch
> 
> diff --git a/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch b/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch
> new file mode 100644
> index 0000000..88c1953
> --- /dev/null
> +++ b/package/fastd/0002-CMakeList-do-not-overwrite-module-path.patch
> @@ -0,0 +1,56 @@
> +From a925a4cab1b722a2a24b0c1d2a1925f3b766de61 Mon Sep 17 00:00:00 2001
> +From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> +Date: Thu, 2 Mar 2017 21:43:39 +0100
> +Subject: [PATCH] CMakeList: do not overwrite module path
> +
> +Currently, the CMakeList.txt completely overwrites the CMAKE_MODULE_PATH
> +variable.
> +
> +This is problematic when an upper-layer buildsystem wants to set its own
> +module path to use custom modules.
> +
> +For example, Buldroot [0] provides a custom platform description [1] to fix
> +cross-compilation issue. Overwriting the module path means that this
> +custom platform description is not found [2].
> +
> +Providing such a custom platform description is what the upstream cmake
> +devs suggest [3], quoting:
> +
> +    If a toolchain file specifies CMAKE_SYSTEM_NAME such that a custom
> +    `Platform/MySystem.cmake` file is loaded then the latter can set
> +    them [*] as needed for the target platform.
> +
> +[*] offending settings causing RPATH issues during cross-compilation.
> +
> +So we need to append our source tree to the module path, not replace it
> +blindly.
> +
> +[0] https://buildroot.org/
> +[1] https://git.buildroot.org/buildroot/tree/support/misc/Buildroot.cmake
> +[2] http://autobuild.buildroot.net/results/69f/69fb2e3b549a069e2898506db918423e6742c589/build-end.log
> +[3] http://public.kitware.com/pipermail/cmake/2017-February/065063.html
> +
> +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> +---
> +Patch applied upstream:
> +https://git.universe-factory.net/fastd/commit/?id=a925a4cab1b722a2a24b0c1d2a1925f3b766de61
> +
> +---
> + CMakeLists.txt | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index 61689b1..2c9c61a 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -1,6 +1,6 @@
> + cmake_minimum_required(VERSION 2.8.8)
> + 
> +-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
> ++list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
> + cmake_policy(SET CMP0017 OLD) # Prefer modules in our module directory
> + 
> + project(FASTD C ASM)
> +-- 
> +2.7.4
> +
> -- 
> 2.7.4

-- 
?With the first link, the chain is forged. The first speech censured, 
the first thought forbidden, the first freedom denied, chains us all 
irrevocably.? (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: C28E E6B9 0263 95CF 8FAF  08FA 34AD CD00 7221 5CC6 ***
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170302/6565b769/attachment.asc>

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

end of thread, other threads:[~2017-03-02 22:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 21:03 [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system Yann E. MORIN
2017-03-02 21:03 ` [Buildroot] [PATCH 1/2] support/cmake: impersonate a Linux system even more Yann E. MORIN
2017-03-02 21:03 ` [Buildroot] [PATCH 2/2] package/fastd: do not overwrite the cmake module path Yann E. MORIN
2017-03-02 22:34   ` Alexander Dahl
2017-03-02 21:13 ` [Buildroot] [PATCH 0/2] core/cmake: better impersonate a Linux system 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.