[poky] Handling CC/CXX and CFLAGS/CXXFLAGS environment variable
Adam Oleksy
adam.oleksy at gmail.com
Tue Sep 11 12:42:41 PDT 2018
W dniu czw., 6.09.2018 o 16:31 Richard Purdie <rpurdie at rpsys.net>
napisał(a):
> On Thu, 2018-09-06 at 16:06 +0200, Adam Oleksy wrote:
> > Hi,
> > I'm user of the SDK built with yocto with populate_sdk task for
> > image.
> > I've found that some of the IDEs and CMake has a problem with
> > environment setup script (e.g. environment-setup-aarch64-poky-linux),
> > which is produced by toolchain-scripts.bbclass.
> >
> > The problem is that, the CC and CXX variables contains arguments for
> > the compiler (march, mtune and sysroot). It causes problems when
> > CMake or IDE (e.g. CLion) works under such configured environment
> > (look at this bug report https://youtrack.jetbrains.com/issue/CPP-112
> > 50#focus=streamItem-27-2564925-0-0 for CLion, and this merge request
> > https://gitlab.kitware.com/cmake/cmake/merge_requests/2352/diffs for
> > CMake). Authors of these tools are of the opinion that CC/CXX
> > variables should points only to the compiler program, but not contain
> > any arguments. It agrees with the definition of these variables,
> > which can be found at http://www.gnu.org/software/make/manual/make.ht
> > ml#Implicit-Variables.
> >
> > Could you consider changing the toolchain-scripts.bbclass that any
> > argument for the compiler goes to CFLAGS/CXXFLAGS? Is there any
> > rationale to not change the current status quo?
>
> The current contents of these files matches what the wider system uses
> to build things, we use exactly these values to build everything in the
> system.
>
> Why? We've done this for a long time (since forever). There are
> codebases which ignore *FLAGS. More recently we have gone and
> identified and fixed most of those. Some applications (and the Linux
> kernel) have their own ideas about which compile optimisations to use
> so the *FLAGS are the less essential options and the ones in the tools
> are the options the tools won't work without.
>
> So we could consider it but it is likely a huge change. We could just
> hack toolchain-scripts but then we'd not match what we do everwhere
> else. I can see arguments both ways.
Understood.
CMake has merged my change to handle CC/CXX variables containing arguments
(but with complaining). CLion as well. And I'm happy.
Thank you Richard for detailed explanation.
EOT
Adam
--
Pozdrawiam,
Adam Oleksy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/poky/attachments/20180911/d97c8c80/attachment.html>
More information about the poky
mailing list