Bug 15814 - C++ not supported by bootlin toolchain
Summary: C++ not supported by bootlin toolchain
Status: RESOLVED INVALID
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2023.08
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-06 22:08 UTC by stsp
Modified: 2023-10-07 12:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stsp 2023-10-06 22:08:14 UTC
BR2_TOOLCHAIN_EXTERNAL_CXX depends on
BR2_TOOLCHAIN_EXTERNAL_CUSTOM.
BR2_TOOLCHAIN_BUILDROOT_CXX depends on
BR2_TOOLCHAIN_BUILDROOT, which is not
enabled when BR2_TOOLCHAIN_EXTERNAL_BOOTLIN
is enabled.
So it seems the config doesn't allow to
enable C++ support together with selecting
bootlin toolchain.
Is there anything that can be done with that?
Comment 1 Yann E. MORIN 2023-10-07 08:52:32 UTC
stsp, All,

> So it seems the config doesn't allow to
> enable C++ support together with selecting
> bootlin toolchain.

Have you actually tried to enable a package written in C++?

The symbols you reference are just intermediate symbols, that ultimately
select BR2_INSTALL_LIBSTDCPP, which is the one symbol that represents
whether C++ is available in the toolchain. All Bootlin toolchains with
C++ support do select that symbol.

> Is there anything that can be done with that?

No, because it is already working as expected.

Regards,
Yann E. MORIN.
Comment 2 stsp 2023-10-07 08:57:35 UTC
> Have you actually tried to enable a package written in C++?

Of course!
Even if BR2_INSTALL_LIBSTDCPP is enabled,
with bootlin tool-chain there is still no
host g++ so the compilation fails.

> No, because it is already working as expected.

I think this is a premature judgement.
Comment 3 Yann E. MORIN 2023-10-07 09:26:52 UTC
stsp, All,

> with bootlin tool-chain there is still no
> host g++

The Bootlin tolchains are cross toolchains; they compile for the target, not
for the host. The host C++ compiler is not provided by the cross toolchain.

The host toolchain (of which g++ is part) is to be provided by the distribution
you use on your host system; Buildroot does not handle it at all: it is
expected to be present. Install the C++ part of the toolchain from your
distribution; if that does not exist, ask your distribution to package it.

> so the compilation fails.

What exactly fails? Please provide a log of the failing build.

> I think this is a premature judgement.

Maybe... Does not look like it, though: the Bootlin toolchains are widely
used, and I know for a fact that they do support C++ for the target, for
using that daily.

Regards,
Yann E. MORIN.
Comment 4 stsp 2023-10-07 10:35:36 UTC
OK, I am sorry, "make clean" have
fixed the problem.
The problem was the missing
output/host/bin/x86_64-linux-g++
(host g++), but its now there.
So not sure what happened. :(
Comment 5 Yann E. MORIN 2023-10-07 10:45:55 UTC
stsp, All,

> "make clean" have fixed the problem.

If you change the toolchain settings in menuconfig, then you have to rebuild
from scratch; see the manual:

    https://buildroot.org/downloads/manual/manual.html#full-rebuild

> output/host/bin/x86_64-linux-g++ (host g++)

This is not the host C++ compiler. This is the cross-compiler.

It looks like you just happen to have an x86-64 target, like you have
an x86-64 host.

Regards,
Yann E. MORIN.
Comment 6 stsp 2023-10-07 11:02:30 UTC
> If you change the toolchain settings in menuconfig, then you have to rebuild
> from scratch; see the manual:

Treating such things anyhow but
bugs, is quite unhelpful. :)
If you know "make clean" is now needed,
then please tell me so on exit from
menuconfig. Either by printing such a
message, or, better yet, asking to run
"make clean" (ok/cancel) before exiting
TUI.

> It looks like you just happen to have an x86-64 target, like you have
> an x86-64 host.

I see, thanks.
So "host" in a dir name, doesn't make
it a host compiler. Just a cross-compiler
that runs on host.
Comment 7 Yann E. MORIN 2023-10-07 12:16:07 UTC
stsp, All,0

> Treating such things anyhow but
> bugs, is quite unhelpful. :)
> If you know "make clean" is now needed,
> then please tell me so on exit from
> menuconfig. Either by printing such a
> message, or, better yet, asking to run
> "make clean" (ok/cancel) before exiting
> TUI.

Rebuilding from scratch after menuconfig is not always required; if one
just adds a new package which has no dependency and is not the dependency
of another, then this is usually OK, and running "make" again is often
just enough.

So no, this is not a bug, and this is expected behaviour. It has limitations,
and those are thoroughly explained in the manual.

Regards,
Yann E. MORIN.
Comment 8 stsp 2023-10-07 12:24:39 UTC
> Rebuilding from scratch after menuconfig is not always required;

I am not saying about "always".
Likewise, you pop up the "save settings?"
TUI dialog only if the settings changed.
You can do the same here by alerting the
user when needed, or even offering to do
the "make clean" from TUI.