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

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.