Message ID | 20220718165023.422662-1-martin.beeger@online.de |
---|---|
State | New |
Headers | show |
Series | [v2] cmake: remove CMAKE_ASM_FLAGS variable in toolchain file | expand |
On Mon, Jul 18, 2022 at 12:51 PM Martin Beeger <martin.beeger@online.de> 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. > Should it be removed from meta/classes/cmake.bbclass and meta/recipes-devtools/cmake/cmake/SDKToolchainConfig.cmake.template as well ? and what about CMAKE_ASM_FLAGS_RELEASE > 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 ) > set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} ) > > set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} ) > -- > 2.30.2 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#168243): https://lists.openembedded.org/g/openembedded-core/message/168243 > Mute This Topic: https://lists.openembedded.org/mt/92463416/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
Am 18.07.22 um 19:08 schrieb Khem Raj: > On Mon, Jul 18, 2022 at 12:51 PM Martin Beeger <martin.beeger@online.de> 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. >> > > Should it be removed from meta/classes/cmake.bbclass and > meta/recipes-devtools/cmake/cmake/SDKToolchainConfig.cmake.template as > well ? > and what about CMAKE_ASM_FLAGS_RELEASE > The templates have been added after my patch. The author of these has used an old version, of the file, which undoes my previous patch and does not remove them. I now need to rebase my patch and remove them. Also it is unclear to me whether the creation of these new files has obsoleted the old OEToolchainConfig.cmake and whether is necessary to know duplicate all these files to have them even more inconsistent. Perhaps there is way to not have both? On the topic of CMAKE_ASM_FLAGS_RELEASE : I am very confused by the cmake.bbclass file. A lot of the parameters there make no sense to me. They are either redundant to the toolchain file, are already set by default by cmake, have little effect or are only necessary for bogus library cmake code and so on. I can remove the asm flags from there, as they should have no effect there either. For further changes I would need to dive in and try to understand where the long list of definitions in cmake.bbclass there is applied to. Is it only applied to the cmake build itself or to each build?
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} )
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(-)