* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
@ 2014-11-15 16:00 Volker Krause
2014-11-15 17:26 ` Samuel Martin
2014-11-16 5:33 ` Bernd Kuhls
0 siblings, 2 replies; 8+ messages in thread
From: Volker Krause @ 2014-11-15 16:00 UTC (permalink / raw)
To: buildroot
This is rarely needed by packages, but convenient to have when it is.
Signed-off-by: Volker Krause <volker.krause@kdab.com>
---
package/pkg-cmake.mk | 1 +
support/misc/toolchainfile.cmake.in | 1 +
2 files changed, 2 insertions(+)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index c8735ef..57a6d29 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -193,5 +193,6 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
-e 's:@@TARGET_LDFLAGS@@:$(call qstrip,$(TARGET_LDFLAGS)):' \
-e 's:@@TARGET_CC_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC_NOCCACHE))):' \
-e 's:@@TARGET_CXX_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX_NOCCACHE))):' \
+ -e 's:@@BR2_ARCH@@:$(BR2_ARCH):' \
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
> $@
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index 4ca3d35..86ef0b4 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -11,6 +11,7 @@
string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR @@BR2_ARCH@@)
set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@ ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot CFLAGS")
set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@ ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot CXXFLAGS")
--
1.8.4.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 16:00 [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR Volker Krause
@ 2014-11-15 17:26 ` Samuel Martin
2014-11-15 17:52 ` Romain Naour
2014-11-16 5:33 ` Bernd Kuhls
1 sibling, 1 reply; 8+ messages in thread
From: Samuel Martin @ 2014-11-15 17:26 UTC (permalink / raw)
To: buildroot
Hi Volker,
On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com> wrote:
> This is rarely needed by packages, but convenient to have when it is.
>
> Signed-off-by: Volker Krause <volker.krause@kdab.com>
> ---
> package/pkg-cmake.mk | 1 +
> support/misc/toolchainfile.cmake.in | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index c8735ef..57a6d29 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -193,5 +193,6 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
> -e 's:@@TARGET_LDFLAGS@@:$(call qstrip,$(TARGET_LDFLAGS)):' \
> -e 's:@@TARGET_CC_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC_NOCCACHE))):' \
> -e 's:@@TARGET_CXX_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX_NOCCACHE))):' \
> + -e 's:@@BR2_ARCH@@:$(BR2_ARCH):' \
You should qstrip the variable here.
> $(TOPDIR)/support/misc/toolchainfile.cmake.in \
> > $@
> diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
> index 4ca3d35..86ef0b4 100644
> --- a/support/misc/toolchainfile.cmake.in
> +++ b/support/misc/toolchainfile.cmake.in
> @@ -11,6 +11,7 @@
> string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
>
> set(CMAKE_SYSTEM_NAME Linux)
> +set(CMAKE_SYSTEM_PROCESSOR @@BR2_ARCH@@)
>
> set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@ ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot CFLAGS")
> set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@ ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot CXXFLAGS")
> --
> 1.8.4.5
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Otherwise, it looks good.
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 17:26 ` Samuel Martin
@ 2014-11-15 17:52 ` Romain Naour
2014-11-15 18:20 ` Samuel Martin
0 siblings, 1 reply; 8+ messages in thread
From: Romain Naour @ 2014-11-15 17:52 UTC (permalink / raw)
To: buildroot
Hi Volker,
Le 15/11/2014 18:26, Samuel Martin a ?crit :
> Hi Volker,
>
> On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com> wrote:
>> This is rarely needed by packages, but convenient to have when it is.
>>
There is only one package (openpowerlink) that set this variable in buildroot
and the expected value is "x86" or "x86_64".
Are you sure that the BR2_ARCH can be used by other packages that need
CMAKE_SYSTEM_PROCESSOR ?
If so, I can send a patch for openpowerlink to fix that.
Best regards,
Romain Naour
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 17:52 ` Romain Naour
@ 2014-11-15 18:20 ` Samuel Martin
2014-11-16 11:25 ` Volker Krause
2014-11-22 0:14 ` Romain Naour
0 siblings, 2 replies; 8+ messages in thread
From: Samuel Martin @ 2014-11-15 18:20 UTC (permalink / raw)
To: buildroot
Romain, Volker,
On Sat, Nov 15, 2014 at 6:52 PM, Romain Naour <romain.naour@openwide.fr> wrote:
> Hi Volker,
>
> Le 15/11/2014 18:26, Samuel Martin a ?crit :
>> Hi Volker,
>>
>> On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com> wrote:
>>> This is rarely needed by packages, but convenient to have when it is.
>>>
>
> There is only one package (openpowerlink) that set this variable in buildroot
> and the expected value is "x86" or "x86_64".
Hmm... this is in the openpowerlink source?
I think it'd better do (to be more robust):
---
string(REGEX REPLACE "i*86" "x86" CMAKE_SYSTEM_PROCESSOR
${CMAKE_SYSTEM_PROCESSOR})
---
But that's another story ;-)
>
> Are you sure that the BR2_ARCH can be used by other packages that need
> CMAKE_SYSTEM_PROCESSOR ?
According to CMake doc [1], CMAKE_SYSTEM_PROCESSOR is set to the
output of the command "uname -p" (in fact it is the output of "uname
-m").
This is only true for native compilation.
In the case of cross-compilation, the CMake code does not set anything
[2], it just expects the CMAKE_SYSTEM_* variables to be set in the
toolchain file.
> If so, I can send a patch for openpowerlink to fix that.
>
> Best regards,
> Romain Naour
Regards,
[1] http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SYSTEM_PROCESSOR.html
[2] http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeDetermineSystem.cmake;hb=HEAD#l110
--
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 16:00 [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR Volker Krause
2014-11-15 17:26 ` Samuel Martin
@ 2014-11-16 5:33 ` Bernd Kuhls
1 sibling, 0 replies; 8+ messages in thread
From: Bernd Kuhls @ 2014-11-16 5:33 UTC (permalink / raw)
To: buildroot
Volker Krause <volker.krause@kdab.com> wrote in
news:1416067219-30211-1-git-send-email-volker.krause at kdab.com:
> This is rarely needed by packages, but convenient to have when it is.
Hi,
the x265 package (patch in patchworks:
http://patchwork.ozlabs.org/patch/408501/) also needs CMAKE_SYSTEM_PROCESSOR.
Regards, Bernd
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 18:20 ` Samuel Martin
@ 2014-11-16 11:25 ` Volker Krause
2014-11-22 0:14 ` Romain Naour
1 sibling, 0 replies; 8+ messages in thread
From: Volker Krause @ 2014-11-16 11:25 UTC (permalink / raw)
To: buildroot
Hi,
On Saturday 15 November 2014 19:20:49 Samuel Martin wrote:
> On Sat, Nov 15, 2014 at 6:52 PM, Romain Naour <romain.naour@openwide.fr>
wrote:
> > Le 15/11/2014 18:26, Samuel Martin a ?crit :
> >> On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com>
wrote:
> >>> This is rarely needed by packages, but convenient to have when it is.
> >
> > There is only one package (openpowerlink) that set this variable in
> > buildroot and the expected value is "x86" or "x86_64".
My use-case is packaging GammaRay (https://github.com/KDAB/GammaRay), which
relies on CMAKE_SYSTEM_PROCESSOR. Setting it via the cmake command line is of
course possible, but that didn't look like the "clean" solution.
> Hmm... this is in the openpowerlink source?
> I think it'd better do (to be more robust):
> ---
> string(REGEX REPLACE "i*86" "x86" CMAKE_SYSTEM_PROCESSOR
> ${CMAKE_SYSTEM_PROCESSOR})
> ---
> But that's another story ;-)
Right, the usual value of CMAKE_SYSTEM_PROCESSOR for x86 32bit seems to be far
from well defined. "i*86" is the most common one I've seen on Linux, so
BR2_ARCH should be fine there in general.
> > Are you sure that the BR2_ARCH can be used by other packages that need
> > CMAKE_SYSTEM_PROCESSOR ?
>
> According to CMake doc [1], CMAKE_SYSTEM_PROCESSOR is set to the
> output of the command "uname -p" (in fact it is the output of "uname
> -m").
> This is only true for native compilation.
>
> In the case of cross-compilation, the CMake code does not set anything
> [2], it just expects the CMAKE_SYSTEM_* variables to be set in the
> toolchain file.
I'll submit an updated patch that adds qstrip, and that sets the correct arm
variant as shown in the x265 patch that Bernd mentioned.
regards,
Volker
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-15 18:20 ` Samuel Martin
2014-11-16 11:25 ` Volker Krause
@ 2014-11-22 0:14 ` Romain Naour
2014-11-22 9:19 ` Samuel Martin
1 sibling, 1 reply; 8+ messages in thread
From: Romain Naour @ 2014-11-22 0:14 UTC (permalink / raw)
To: buildroot
Hi Samuel, Volker,
Le 15/11/2014 19:20, Samuel Martin a ?crit :
> Romain, Volker,
>
> On Sat, Nov 15, 2014 at 6:52 PM, Romain Naour <romain.naour@openwide.fr> wrote:
>> Hi Volker,
>>
>> Le 15/11/2014 18:26, Samuel Martin a ?crit :
>>> Hi Volker,
>>>
>>> On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com> wrote:
>>>> This is rarely needed by packages, but convenient to have when it is.
>>>>
>>
>> There is only one package (openpowerlink) that set this variable in buildroot
>> and the expected value is "x86" or "x86_64".
>
> Hmm... this is in the openpowerlink source?
> I think it'd better do (to be more robust):
> ---
> string(REGEX REPLACE "i*86" "x86" CMAKE_SYSTEM_PROCESSOR
> ${CMAKE_SYSTEM_PROCESSOR})
> ---
> But that's another story ;-)
I used "if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")" instead, because the meaning of
* is not the same as in shell. I had "i6x86"...
I found "^i.86$" in cmake sources:
http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindJNI.cmake;h=3dcb0d0aaf019a69766b26db36ddbdab6aee3fa7;hb=HEAD#l46
I send a patch to fix that in openpowerlink sources:
http://patchwork.ozlabs.org/patch/413219/
Best regards,
--
Romain Naour
OPEN WIDE Ing?nierie - Paris
23/25, rue Daviel| 75013 PARIS
http://ingenierie.openwide.fr
Le blog des technologies libres et embarqu?es :
http://www.linuxembedded.fr
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR.
2014-11-22 0:14 ` Romain Naour
@ 2014-11-22 9:19 ` Samuel Martin
0 siblings, 0 replies; 8+ messages in thread
From: Samuel Martin @ 2014-11-22 9:19 UTC (permalink / raw)
To: buildroot
On Sat, Nov 22, 2014 at 1:14 AM, Romain Naour <romain.naour@openwide.fr> wrote:
> Hi Samuel, Volker,
>
> Le 15/11/2014 19:20, Samuel Martin a ?crit :
>> Romain, Volker,
>>
>> On Sat, Nov 15, 2014 at 6:52 PM, Romain Naour <romain.naour@openwide.fr> wrote:
>>> Hi Volker,
>>>
>>> Le 15/11/2014 18:26, Samuel Martin a ?crit :
>>>> Hi Volker,
>>>>
>>>> On Sat, Nov 15, 2014 at 5:00 PM, Volker Krause <volker.krause@kdab.com> wrote:
>>>>> This is rarely needed by packages, but convenient to have when it is.
>>>>>
>>>
>>> There is only one package (openpowerlink) that set this variable in buildroot
>>> and the expected value is "x86" or "x86_64".
>>
>> Hmm... this is in the openpowerlink source?
>> I think it'd better do (to be more robust):
>> ---
>> string(REGEX REPLACE "i*86" "x86" CMAKE_SYSTEM_PROCESSOR
>> ${CMAKE_SYSTEM_PROCESSOR})
>> ---
>> But that's another story ;-)
>
> I used "if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")" instead, because the meaning of
> * is not the same as in shell. I had "i6x86"...
Good catch!
>
> I found "^i.86$" in cmake sources:
> http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindJNI.cmake;h=3dcb0d0aaf019a69766b26db36ddbdab6aee3fa7;hb=HEAD#l46
>
> I send a patch to fix that in openpowerlink sources:
> http://patchwork.ozlabs.org/patch/413219/
>
> Best regards,
> --
> Romain Naour
>
> OPEN WIDE Ing?nierie - Paris
> 23/25, rue Daviel| 75013 PARIS
> http://ingenierie.openwide.fr
>
> Le blog des technologies libres et embarqu?es :
> http://www.linuxembedded.fr
--
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-11-22 9:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-15 16:00 [Buildroot] [PATCH 1/1] pkg-cmake.mk: Set CMAKE_SYSTEM_PROCESSOR Volker Krause
2014-11-15 17:26 ` Samuel Martin
2014-11-15 17:52 ` Romain Naour
2014-11-15 18:20 ` Samuel Martin
2014-11-16 11:25 ` Volker Krause
2014-11-22 0:14 ` Romain Naour
2014-11-22 9:19 ` Samuel Martin
2014-11-16 5:33 ` Bernd Kuhls
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.