diff mbox series

[v2] rust: Use libc++ runtime when using clang with llvm runtime

Message ID 20220901203228.274513-1-raj.khem@gmail.com
State Accepted, archived
Commit 521872ab2cac092c88446730772cb8c4e22b0cdc
Headers show
Series [v2] rust: Use libc++ runtime when using clang with llvm runtime | expand

Commit Message

Khem Raj Sept. 1, 2022, 8:32 p.m. UTC
meta-clang has options when it comes to C++ runtime, default is to use
gnu runtime, other options are llvm runtime and android runtime. This
patch helps when a distro is using llvm runtime for C/C++ runtime. It
informs the rust build system about right C++ runtime to configure for
when such a setting is used.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebase now that 1.63 is in

 meta/recipes-devtools/rust/rust.inc | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Purdie Sept. 1, 2022, 9:56 p.m. UTC | #1
On Thu, 2022-09-01 at 13:32 -0700, Khem Raj wrote:
> meta-clang has options when it comes to C++ runtime, default is to use
> gnu runtime, other options are llvm runtime and android runtime. This
> patch helps when a distro is using llvm runtime for C/C++ runtime. It
> informs the rust build system about right C++ runtime to configure for
> when such a setting is used.
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Rebase now that 1.63 is in
> 
>  meta/recipes-devtools/rust/rust.inc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc
> index 284347dedc..3a7b993ee8 100644
> --- a/meta/recipes-devtools/rust/rust.inc
> +++ b/meta/recipes-devtools/rust/rust.inc
> @@ -107,6 +107,8 @@ python do_configure() {
>      # [llvm]
>      config.add_section("llvm")
>      config.set("llvm", "static-libstdcpp", e(False))
> +    if "llvm" in (d.getVar('RUNTIME', True) or ""):
> +        config.set("llvm", "use-libcxx", e(True))
>  
>      # [rust]
>      config.add_section("rust")

My concerns about "RUNTIME" as a variable in OE-Core stand. We need to
figure out the naming properly for this before it is used here.

Cheers,

Richard
Khem Raj Sept. 1, 2022, 11:12 p.m. UTC | #2
On Thu, Sep 1, 2022 at 2:56 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Thu, 2022-09-01 at 13:32 -0700, Khem Raj wrote:
> > meta-clang has options when it comes to C++ runtime, default is to use
> > gnu runtime, other options are llvm runtime and android runtime. This
> > patch helps when a distro is using llvm runtime for C/C++ runtime. It
> > informs the rust build system about right C++ runtime to configure for
> > when such a setting is used.
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > v2: Rebase now that 1.63 is in
> >
> >  meta/recipes-devtools/rust/rust.inc | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc
> > index 284347dedc..3a7b993ee8 100644
> > --- a/meta/recipes-devtools/rust/rust.inc
> > +++ b/meta/recipes-devtools/rust/rust.inc
> > @@ -107,6 +107,8 @@ python do_configure() {
> >      # [llvm]
> >      config.add_section("llvm")
> >      config.set("llvm", "static-libstdcpp", e(False))
> > +    if "llvm" in (d.getVar('RUNTIME', True) or ""):
> > +        config.set("llvm", "use-libcxx", e(True))
> >
> >      # [rust]
> >      config.add_section("rust")
>
> My concerns about "RUNTIME" as a variable in OE-Core stand. We need to
> figure out the naming properly for this before it is used here.
>

Thats fine, do you see any other issue, I have addressed your other
feedback. May be we should call it
CL_RUNTIME which stands for compiler-language rumtime or we can call

<lang>_RUNTIME which in this case will be CXX_RUNTIME

> Cheers,
>
> Richard
>
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc
index 284347dedc..3a7b993ee8 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -107,6 +107,8 @@  python do_configure() {
     # [llvm]
     config.add_section("llvm")
     config.set("llvm", "static-libstdcpp", e(False))
+    if "llvm" in (d.getVar('RUNTIME', True) or ""):
+        config.set("llvm", "use-libcxx", e(True))
 
     # [rust]
     config.add_section("rust")