Skip to content

Conversation

zboszor
Copy link

@zboszor zboszor commented Sep 15, 2025

Hi,

I tried your changes from OSSystems#920 but it failed to build for me, see my comment there.

I cherry-picked/adapted/salvaged some changes from my own PR at OSSystems#918 and it seems to build now.

@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch 2 times, most recently from 6c723b8 to 20f14e4 Compare September 15, 2025 13:12
@caneraltinbasak
Copy link

@caneraltinbasak
Copy link

Build failed. Can you give me the hashes you used for: meta-oe, meta-clang, poky.

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

Hi,

meta-oe    926302f7296299c5adc5b9afa62a6f1ee9424632
meta-clang af59ec636f0f956a94356ede6579e11b8653314d
meta       0a886fcacaab0fbce1306c0f99d482f940a8f705
poky       2ff9be23fffeec94bc5156166ad157b0a59e076d

@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch from 20f14e4 to 6cbbbe5 Compare September 16, 2025 07:43
@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

I just replaced the last commit. With meta-clang merged into oe-core, lld became a separate recipe, so chromium needs to depend on lld-native. My build is running now and does not complain about -fuse-ld=lld is invalid.

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

Still failed, with a much advanced state. It complains about a rust module:

ld.lld: error: undefined symbol: __rustc::__rust_no_alloc_shim_is_unstable_v2
>>> referenced by serde_json_lenient.8880183df0940bc0-cgu.0
>>>               libserde_json_lenient_lib.serde_json_lenient.8880183df0940bc0-cgu.0.rcgu.o:(serde_json_lenient::error::Error::syntax::h367187de58202ca1) in archive yocto_native/obj/third_party/rust/serde_json_lenient/v0_2/lib/libserde_json_lenient_lib.rlib
>>> referenced by third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.7bbe238a93e506f6-cgu.0
>>>               libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.7bbe238a93e506f6-cgu.0.rcgu.o:(_$LT$$RF$mut$u20$serde_json_lenient..de..Deserializer$LT$R$GT$$u20$as$u20$serde..de..Deserializer$GT$::deserialize_any::h57ecaa2d73b56b79) in archive yocto_native/obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib
>>> referenced by third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.7bbe238a93e506f6-cgu.0
>>>               libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.7bbe238a93e506f6-cgu.0.rcgu.o:(_$LT$$RF$mut$u20$serde_json_lenient..de..Deserializer$LT$R$GT$$u20$as$u20$serde..de..Deserializer$GT$::deserialize_any::h57ecaa2d73b56b79) in archive yocto_native/obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib
>>> referenced 144 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

@caneraltinbasak
Copy link

Hi,

meta-oe    926302f7296299c5adc5b9afa62a6f1ee9424632
meta-clang af59ec636f0f956a94356ede6579e11b8653314d
meta       0a886fcacaab0fbce1306c0f99d482f940a8f705
poky       2ff9be23fffeec94bc5156166ad157b0a59e076d

I've replied your message on other pull request. I'll test this, but I first want to land the existing changes and do the adaptations for latest oe as a follow up.

Some general comments about the changeset:

  1. Conditionals are generally a bad idea in bitbake.
  2. You don't need WHINLATTER_OR_NEWER conditional, and it doesn't solve the problem. The meta-oe hash I've picked is also Whinlatter, and doesn't have this problem.
  3. meta-browser has branches for older yocto releases. Users shouldn't try to use latest meta-browser with older oe releases anyway.

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

I've replied your message on other pull request. I'll test this, but I first want to land the existing changes and do the adaptations for latest oe as a follow up.

Some general comments about the changeset:

1. Conditionals are generally a bad idea in bitbake.

2. You don't need WHINLATTER_OR_NEWER conditional, and it doesn't solve the problem. The meta-oe hash I've picked is also Whinlatter, and doesn't have this problem.

3. meta-browser has branches for older yocto releases. Users shouldn't try to use latest meta-browser with older oe releases anyway.

So the bottom line is meta-browser master should more aggressively remove support for older versions then. This way, no conditionals are necessary.

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

FWIW, I tried to revive my OSSystems#918 with the lld fix, and it also failed with a rust related error, only with more missing symbols that are alloc related. Maybe rust 1.89 needs an even newer chromium, like 139 or 140.

@caneraltinbasak
Copy link

Still failed, with a much advanced state. It complains about a rust module:

ld.lld: error: undefined symbol: __rustc::__rust_no_alloc_shim_is_unstable_v2

Can you please try adding this change as a patch:
chromium/chromium@6aae0e2

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

Can you please try adding this change as a patch: chromium/chromium@6aae0e2

The build is in progress and has long passed the previous failure point. I will report back.

Regarding the extra changes: I can clean up the conditionals and make meta-chromium whinlatter-only.

Or we can keep them, because meta-firefox in the same repository also uses them to keep compatibility with walnascar and older. In fact, the whole conditional idea came from there.

@caneraltinbasak
Copy link

Regarding the extra changes: I can clean up the conditionals and make meta-chromium whinlatter-only.

This would be my preferred option. Chromium is much more complicated and fragile than Firefox.

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

The build failed at 57% with this:

../../sandbox/policy/linux/sandbox_linux.cc:694:3: error: static assertion expression is not an integral constant expression

There are breaking changes in whinlatter in oe-core.

Part of the changes was that meta-clang was merged into oe-core.
There's no need to depend on meta-clang anymore.

Signed-off-by: Zoltán Böszörményi <[email protected]>
@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch 2 times, most recently from f27f9fe to 112fe39 Compare September 16, 2025 12:34
@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

Regarding the extra changes: I can clean up the conditionals and make meta-chromium whinlatter-only.

This would be my preferred option. Chromium is much more complicated and fragile than Firefox.

Cleaned up the conditionals.

@caneraltinbasak
Copy link

The build failed at 57% with this:

../../sandbox/policy/linux/sandbox_linux.cc:694:3: error: static assertion expression is not an integral constant expression

I suspect this is due to new compiler not being happy with some old code. Can you paste entire error message?

@zboszor
Copy link
Author

zboszor commented Sep 16, 2025

../../sandbox/policy/linux/sandbox_linux.cc:694:3: error: static assertion expression is not an integral constant expression
  694 |   UMA_HISTOGRAM_ENUMERATION("Security.Sandbox.LandlockState", landlock_state);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/metrics/histogram_macros.h:82:7: note: expanded from macro 'UMA_HISTOGRAM_ENUMERATION'
   80 |   INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO(                         \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   81 |       __VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   82 |       INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY)               \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   83 |   (name, __VA_ARGS__, base::HistogramBase::kUmaTargetedHistogramFlag)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/metrics/histogram_macros_internal.h:171:73: note: expanded from macro 'INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO'
  171 | #define INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO(_1, _2, NAME, ...) NAME
      |                                                                         ^
../../base/metrics/histogram_macros_internal.h:175:3: note: expanded from macro 'INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY'
  175 |   INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG(                                    \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  176 |       name, sample,                                                            \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |       base::internal::EnumSizeTraits<std::decay_t<decltype(sample)>>::Count(), \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178 |       flags)
      |       ~~~~~~
../../base/metrics/histogram_macros_internal.h:207:9: note: expanded from macro 'INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG'
  207 |         static_cast<uintmax_t>(boundary) <                                     \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208 |             static_cast<uintmax_t>(                                            \
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  209 |                 std::numeric_limits<base::HistogramBase::Sample32>::max()),    \
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/metrics/histogram_macros_internal.h:35:14: note: integer value 4 is outside the valid range of values [0, 3] for the enumeration type 'LandlockState'
   35 |       return static_cast<Enum>(base::to_underlying(Enum::kMaxValue) + 1);
      |              ^
../../sandbox/policy/linux/sandbox_linux.cc:694:3: note: in call to 'Count()'
  694 |   UMA_HISTOGRAM_ENUMERATION("Security.Sandbox.LandlockState", landlock_state);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/metrics/histogram_macros.h:82:7: note: expanded from macro 'UMA_HISTOGRAM_ENUMERATION'
   80 |   INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO(                         \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   81 |       __VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   82 |       INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY)               \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   83 |   (name, __VA_ARGS__, base::HistogramBase::kUmaTargetedHistogramFlag)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/metrics/histogram_macros_internal.h:171:73: note: expanded from macro 'INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO'
  171 | #define INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO(_1, _2, NAME, ...) NAME
      |                                                                         ^
../../base/metrics/histogram_macros_internal.h:177:7: note: expanded from macro 'INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY'
  175 |   INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG(                                    \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  176 |       name, sample,                                                            \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |       base::internal::EnumSizeTraits<std::decay_t<decltype(sample)>>::Count(), \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178 |       flags)
      |       ~~~~~~
../../base/metrics/histogram_macros_internal.h:207:32: note: expanded from macro 'INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG'
  207 |         static_cast<uintmax_t>(boundary) <                                     \
      |                                ^~~~~~~~
1 error generated.

@caneraltinbasak
Copy link

it is due to strict argument number checking for macros on Clang21. You need to add this patch to your build:
chromium/chromium@b0ff8c3

@zboszor
Copy link
Author

zboszor commented Sep 17, 2025

Compiling sandbox/policy/linux/sandbox_linux.cc succeeds with that patch. Still waiting for the build to finish. I will report back.

@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch from e3da573 to 5961b8b Compare September 17, 2025 09:15
@zboszor
Copy link
Author

zboszor commented Sep 17, 2025

Next error, this time it's Rust again:

FAILED: [code=1] obj/third_party/rust/qr_code/v2/lib/libqr_code_lib.rlib 
"python3" "../../build/rust/rustc_wrapper.py" --rustc=../../../../recipe-sysroot-native/usr/bin/rustc --depfile=obj/third_party/rust/qr_code/v2/lib/libqr_code_lib.rlib.d 
 --rsp=obj/third_party/rust/qr_code/v2/lib/libqr_code_lib.rlib.rsp -- -Clinker="x86_64-oe-linux-clang++  -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2  --dyld
-prefix=/usr -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/zozo/yocto-5.3-arm/tmp-sicom/work/corei7
-64-oe-linux/chromium-x11/138.0.7204.157/recipe-sysroot" --crate-name qr_code ../../third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs --crate-type rlib -A
warnings -Cmetadata=qr_code-2 --edition=2018 -Cforce-unwind-tables=no -Crelocation-model=pic -Cembed-bitcode=no -Cdefault-linker-libraries -Zdep-info-omit-d-target -Zmac
ro-backtrace -Zremap-cwd-prefix=. -Zexternal-clangrt --color=always --target=x86_64-oe-linux-gnu -Cembed-bitcode=no -Clto=no -Ccodegen-units=1 --cfg cr_rustc_revision=\"
custom\" -Copt-level=3 -Zallow-features= -Cembed-bitcode=no -Zdefault-visibility=hidden -Funsafe_code --emit=dep-info=obj/third_party/rust/qr_code/v2/lib/libqr_code_lib.
rlib.d,link -o obj/third_party/rust/qr_code/v2/lib/libqr_code_lib.rlib LDFLAGS RUSTENV OUT_DIR=../../../../../../out/Release/gen/third_party/rust/qr_code/v2/lib CARGO_PK
G_AUTHORS=kennytm\ \<[email protected]\>,\ Riccardo\ Casatta\ \<[email protected]\> CARGO_PKG_VERSION=2.0.0 CARGO_PKG_NAME=qr_code CARGO_PKG_DESCRIPTION=QR\ cod
e\ encoder\ in\ Rust,\ support\ structured\ append\ \(data\ in\ multiple\ qrcodes\) CARGO_MANIFEST_DIR=../../third_party/rust/qr_code/v2/lib/crate

error: hiding a lifetime that's elided elsewhere is confusing
   --> ../../third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs:219:17
    |
219 |     pub fn iter(&self) -> QrCodeIterator {
    |                 ^^^^^     -------------- the same lifetime is hidden here
    |                 |
    |                 the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
note: the lint level is defined here
   --> ../../third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs:8:9
    |
8   | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(mismatched_lifetime_syntaxes)]` implied by `#[deny(warnings)]`
help: use `'_` for type paths
    |
219 |     pub fn iter(&self) -> QrCodeIterator<'_> {
    |                                         ++++

error: hiding a lifetime that's elided elsewhere is confusing
   --> ../../third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/optimize.rs:112:22
    |
112 |     pub fn new(data: &[u8]) -> Parser {
    |                      ^^^^^     ------ the same lifetime is hidden here
    |                      |
    |                      the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
112 |     pub fn new(data: &[u8]) -> Parser<'_> {
    |                                      ++++

error: aborting due to 2 previous errors

@caneraltinbasak
Copy link

Seems like Chromium haven't started using the latest Rust yet. I can't find a patch addressing this issue upstream on latest Chromium. You need these changes in the source:

diff --git a/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs
@@ -216,7 +216,7 @@ impl QrCode {
-    pub fn iter(&self) -> QrCodeIterator {
+    pub fn iter(&self) -> QrCodeIterator<'_> {
         QrCodeIterator::new(self)
     }
 }

and

diff --git a/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/optimize.rs b/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/optimize.rs
@@ -109,7 +109,7 @@ impl Parser {
-    pub fn new(data: &[u8]) -> Parser {
+    pub fn new(data: &[u8]) -> Parser<'_> {
         // existing body
     }
 }

You will likely find more problems though.

@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch from 5961b8b to 017f03b Compare September 17, 2025 16:11
@zboszor
Copy link
Author

zboszor commented Sep 17, 2025

I went a different route. Instead of finding patches that can be cherry picked, I upgraded to chromium 140 and it completed the build.

RUNTIME and TC_CXX_RUNTIME are both set explicitly to "llvm"
in chromium.inc. Therefore the :runtime-llvm override is
not needed because it's always on. But it's also a problem in
whinlatter now, because the DEPENDS = "compiler-rt" is not
applied properly, making do_copy_clang_library() fail.
Remove :runtime-llvm override.

Use TOOLCHAIN_NATIVE instead of TOOLCHAIN:class-native.

Drop 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch
and fix do_copy_clang_library() in a way that's compatible with
clang in oe-core.

Depend on lld-native.

Signed-off-by: Zoltán Böszörményi <[email protected]>
@zboszor zboszor force-pushed the for/review/ossystems/master/138.0.7204.157 branch from 017f03b to 508981d Compare September 17, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants