All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix rust-native build issue when debug is enabled
@ 2021-09-29 13:20 Pgowda
  2021-10-06  0:42 ` [OE-core] " Randy MacLeod
  0 siblings, 1 reply; 4+ messages in thread
From: Pgowda @ 2021-09-29 13:20 UTC (permalink / raw)
  To: openembedded-core
  Cc: richard.purdie, rwmacleod, alex.kanavin, umesh.kalappa0,
	vinay.m.engg, Pgowda

When DEBUG_BUILD is set for building rust-native, it generated
error as follows:-
=========================================================
Building : rustdoc, rustdoc-json-types
error[E0463]: can't find crate for `rustc_llvm`
which `rustc_driver` depends on
  --> src/librustdoc/lib.rs:37:1
   |
37 | extern crate rustc_driver;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
=========================================================
On analyzing the issue, it was found that rustc_llvm crate was present
at required path. However, it was very huge due to the presence of
debugging information. Hence, it was somehow not recognized as a valid
crate. The following patch removes the debug information from
rust-llvm-native which is built prior to rust-native but retains debug
information as required in rust-native binaries.

Signed-off-by: Pgowda <pgowda.cve@gmail.com>
---
 meta/recipes-devtools/rust/rust-llvm.inc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-devtools/rust/rust-llvm.inc b/meta/recipes-devtools/rust/rust-llvm.inc
index d7f445385b..0f8fb785b7 100644
--- a/meta/recipes-devtools/rust/rust-llvm.inc
+++ b/meta/recipes-devtools/rust/rust-llvm.inc
@@ -15,6 +15,11 @@ DEPENDS += "ninja-native rust-llvm-native"
 ARM_INSTRUCTION_SET:armv5 = "arm"
 ARM_INSTRUCTION_SET:armv4t = "arm"
 
+# rustc_llvm with debug info is not recognized as a valid crate that's
+# generated by rust-llvm-native.
+CFLAGS:remove = "-g"
+CXXFLAGS:remove = "-g"
+
 LLVM_DIR = "llvm${LLVM_RELEASE}"
 
 EXTRA_OECMAKE = " \
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] Fix rust-native build issue when debug is enabled
  2021-09-29 13:20 [PATCH] Fix rust-native build issue when debug is enabled Pgowda
@ 2021-10-06  0:42 ` Randy MacLeod
  2021-10-07  8:56   ` pgowda cve
  0 siblings, 1 reply; 4+ messages in thread
From: Randy MacLeod @ 2021-10-06  0:42 UTC (permalink / raw)
  To: Pgowda, openembedded-core
  Cc: richard.purdie, rwmacleod, alex.kanavin, umesh.kalappa0, vinay.m.engg

On 2021-09-29 9:20 a.m., Pgowda wrote:
> When DEBUG_BUILD is set for building rust-native, it generated
> error as follows:-
> =========================================================
> Building : rustdoc, rustdoc-json-types
> error[E0463]: can't find crate for `rustc_llvm`
> which `rustc_driver` depends on
>    --> src/librustdoc/lib.rs:37:1
>     |
> 37 | extern crate rustc_driver;
>     | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
> =========================================================
> On analyzing the issue, it was found that rustc_llvm crate was present
> at required path. However, it was very huge due to the presence of
> debugging information. Hence, it was somehow not recognized as a valid
> crate. 

So we need to know more about this. What tool is being used to identify
the crate and has there been any changes to fix is since 1.54?

Also, please check this problem still happens with Alex's 1.55 upgrade:
 
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/package-version-updates



> The following patch removes the debug information from
> rust-llvm-native which is built prior to rust-native but retains debug
> information as required in rust-native binaries.

This is a functional work-around but I suspect that we'll hold-off
for a while before giving in and accepting it in oe-core/master.
Some people might find it useful so thanks for posting it as I suggested.

Hopefully we can better understand and fix the root cause.

Thanks Naveen,

../Randy

> 
> Signed-off-by: Pgowda <pgowda.cve@gmail.com>
> ---
>   meta/recipes-devtools/rust/rust-llvm.inc | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/meta/recipes-devtools/rust/rust-llvm.inc b/meta/recipes-devtools/rust/rust-llvm.inc
> index d7f445385b..0f8fb785b7 100644
> --- a/meta/recipes-devtools/rust/rust-llvm.inc
> +++ b/meta/recipes-devtools/rust/rust-llvm.inc
> @@ -15,6 +15,11 @@ DEPENDS += "ninja-native rust-llvm-native"
>   ARM_INSTRUCTION_SET:armv5 = "arm"
>   ARM_INSTRUCTION_SET:armv4t = "arm"
>   
> +# rustc_llvm with debug info is not recognized as a valid crate that's
> +# generated by rust-llvm-native.
> +CFLAGS:remove = "-g"
> +CXXFLAGS:remove = "-g"
> +
>   LLVM_DIR = "llvm${LLVM_RELEASE}"
>   
>   EXTRA_OECMAKE = " \
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#156454): https://lists.openembedded.org/g/openembedded-core/message/156454
> Mute This Topic: https://lists.openembedded.org/mt/85948023/3616765
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
# Randy MacLeod
# Wind River Linux



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] Fix rust-native build issue when debug is enabled
  2021-10-06  0:42 ` [OE-core] " Randy MacLeod
@ 2021-10-07  8:56   ` pgowda cve
  2021-10-07 17:03     ` Randy MacLeod
  0 siblings, 1 reply; 4+ messages in thread
From: pgowda cve @ 2021-10-07  8:56 UTC (permalink / raw)
  To: Randy MacLeod
  Cc: openembedded-core, Richard Purdie, Randy MacLeod, alex.kanavin,
	umesh.kalappa0, Vinay Kumar

Hi Randy,

>> check this problem still happens with Alex's 1.55 upgrade:

I checked the issue with latest version upgrade branch from Alexander:-
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/package-version-updates

It builds as expected without any errors for rust-native with
DEBUG_BUILD = "1"

Thanks,
pgowda


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] Fix rust-native build issue when debug is enabled
  2021-10-07  8:56   ` pgowda cve
@ 2021-10-07 17:03     ` Randy MacLeod
  0 siblings, 0 replies; 4+ messages in thread
From: Randy MacLeod @ 2021-10-07 17:03 UTC (permalink / raw)
  To: pgowda cve
  Cc: openembedded-core, Richard Purdie, Randy MacLeod, alex.kanavin,
	umesh.kalappa0, Vinay Kumar

On 2021-10-07 4:56 a.m., pgowda cve wrote:
> Hi Randy,
> 
>>> check this problem still happens with Alex's 1.55 upgrade:
> 
> I checked the issue with latest version upgrade branch from Alexander:-
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/package-version-updates
> 
> It builds as expected without any errors for rust-native with
> DEBUG_BUILD = "1"
> 
> Thanks,
> pgowda
> 


Oh excellent! We don't really need to identify what the change was
that fixed it but I'm curious so please take 10 minutes or so
to see if you can find it.


-- 
# Randy MacLeod
# Wind River Linux



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-07 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 13:20 [PATCH] Fix rust-native build issue when debug is enabled Pgowda
2021-10-06  0:42 ` [OE-core] " Randy MacLeod
2021-10-07  8:56   ` pgowda cve
2021-10-07 17:03     ` Randy MacLeod

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.