[PATCHv2] cmake: remove CMAKE_ASM_FLAGS variable in toolchain file

Message ID 20220217155729.20280-1-martin.beeger@online.de
State New
Headers show
Series [PATCHv2] cmake: remove CMAKE_ASM_FLAGS variable in toolchain file | expand

Commit Message

Martin Beeger Feb. 17, 2022, 3:57 p.m. UTC
As discussied in [YOCTO #14717] cmake contains a OEToolchainConfig.cmake
file to configure the toolchain correctly in cross-compile build for recipes
using cmake. The CMAKE_ASM_FLAGS are the configuration are meant for  assembly,
but the spelling is incorrect and the Flag is ASFLAGS for gcc and other compilers.
So this variable might neever have worked and it is better for
recipes to specify their own.

Signed-off-by: Martin Beeger <martin.beeger@online.de>
---
 meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 1 -
 1 file changed, 1 deletion(-)

Comments

Khem Raj Feb. 17, 2022, 7:46 p.m. UTC | #1
On 2/17/22 7:57 AM, Martin Beeger wrote:
> As discussied in [YOCTO #14717] cmake contains a OEToolchainConfig.cmake
> file to configure the toolchain correctly in cross-compile build for recipes
> using cmake. The CMAKE_ASM_FLAGS are the configuration are meant for  assembly,
> but the spelling is incorrect and the Flag is ASFLAGS for gcc and other compilers.
> So this variable might neever have worked and it is better for
> recipes to specify their own.
> 
> Signed-off-by: Martin Beeger <martin.beeger@online.de>
> ---
>   meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> index 86446c3ace..3ddef12c83 100644
> --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> @@ -1,7 +1,6 @@
>   set( CMAKE_SYSTEM_NAME Linux )
>   set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
>   set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )
> -set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )

We do have global ASFLAGS so why not use that.

>   set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} )
>   
>   set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#161817): https://lists.openembedded.org/g/openembedded-core/message/161817
> Mute This Topic: https://lists.openembedded.org/mt/89212148/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Martin Beeger Feb. 18, 2022, 2:52 p.m. UTC | #2
If you provide ASFLAGS CMake will already load them into CMAKE_AS_FLAGS 
anyway, they will just not be force-overriden.

Martin

Am 17.02.22 um 20:46 schrieb Khem Raj:
>
>
> On 2/17/22 7:57 AM, Martin Beeger wrote:
>> As discussied in [YOCTO #14717] cmake contains a OEToolchainConfig.cmake
>> file to configure the toolchain correctly in cross-compile build for 
>> recipes
>> using cmake. The CMAKE_ASM_FLAGS are the configuration are meant for  
>> assembly,
>> but the spelling is incorrect and the Flag is ASFLAGS for gcc and 
>> other compilers.
>> So this variable might neever have worked and it is better for
>> recipes to specify their own.
>>
>> Signed-off-by: Martin Beeger <martin.beeger@online.de>
>> ---
>>   meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git 
>> a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake 
>> b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
>> index 86446c3ace..3ddef12c83 100644
>> --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
>> +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
>> @@ -1,7 +1,6 @@
>>   set( CMAKE_SYSTEM_NAME Linux )
>>   set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
>>   set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )
>> -set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
>
> We do have global ASFLAGS so why not use that.
>
>>   set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} )
>>     set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#161817): 
>> https://lists.openembedded.org/g/openembedded-core/message/161817
>> Mute This Topic: https://lists.openembedded.org/mt/89212148/1997914
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
>> [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>

Patch

diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
index 86446c3ace..3ddef12c83 100644
--- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
+++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -1,7 +1,6 @@ 
 set( CMAKE_SYSTEM_NAME Linux )
 set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
 set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )
-set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
 set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} )
 
 set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )