PF4Public / gentoo-overlay

Personal Gentoo overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

www-client/ungoogled-chromium-121.0.6167.160_p1: compile without libcxx

ProtoGitCell opened this issue · comments

New version, new breakage. :-\ But the attached patch enabled ungoogled-chromium to compile without libcxx on my machine. So perhaps you find it useful. :)

For the technical interested reader, I think one can get rid of the two "to_ad()" functions and use C++'s std::to_address() instead. to_ad() is just an artefact of me trying things out. But after so many hours I don't want to compile again for just a minor change. If a new version of chromium comes along, I'll probably try to use std::to_address() and update the patch accordingly.

ungoogled-chromium-121-ConvertTo.patch.txt

Is this an addition to the previous patch or the older one no longer needed?

I tried this patch without the previous one. It compiles but the browser crashes when playing YT videos. Thank you for looking into this still. It would be great if you can share your USE flags that works with this patch.

@kcning maybe -system-ffmpeg? Did you expose av_stream_get_first_dts in ffmpeg?

@ProtoGitCell I've included your patch in the next bump, please give it a try.

PS: Looks like both are needed.

-system-ffmpeg might work. I'll probably test it in the next release. And yes I did patch ffmpeg to expose av_stream_get_first_dts

Arch seems to also have this issue. ffmpeg got commented out in their PKGBUILD:

#[ffmpeg]=ffmpeg # YouTube playback stopped working in Chromium 120

Yes, both patches are needed. I attach a new version of the second patch that is shorter but should be functionally equivalent.

FYI, I patch ffmpeg and use system-ffmpeg with ungoogled-chromium and it plays audio and video for me but it was compiled with your latest ffmpeg patch for ungoogled-chromium.

ungoogled-chromium-121-ConvertTo.patch.txt

@ProtoGitCell What are your USE flags for ungoogled-chromium? And which version of ffmpeg do you have and what are your USE flags for it? Which compiler and its version do you have?

There is something wrong with opus:
image

@ProtoGitCell I've updated your patch and found a fix for video/audio, but I'd like to know how your system is different if it does not happen there.

@ProtoGitCell What are your USE flags for ungoogled-chromium? And which version of ffmpeg do you have and what are your USE flags for it? Which compiler and its version do you have?

@kcning @baconsalad try --disable-features=FFmpegAllowLists. The thing is they implemented codec whitelisting, which does not work properly for system ffmpeg for some reason. chromium/chromium@02508a7

Recompiled last night, added the flag to chromium-flags.conf but still not working. I also don't see any "ffmpeg" related flags in chrome://flags/

Recompiled last night, added the flag to chromium-flags.conf but still not working.

It belongs to /etc/chromium/default. Mine for example:

CHROMIUM_FLAGS="--enable-blink-features=MiddleClickAutoscroll --disable-features=FFmpegAllowLists"

My mistake, works now.

Thanks for updating the patch! I use ffmpeg 6.1.1 with a patch for av_stream and clang is 17.0.6 but I don't have the USE flags at hand.

@kcning @baconsalad Do you use ffmpeg-6.0.1 as I do? That could explain the difference.

@ProtoGitCell I've bumped to 122 and updated your patch. They've modified mojo/public/cpp/bindings/type_converter.h in https://chromium-review.googlesource.com/c/chromium/src/+/5088290, which looks good, but it got broken elsewhere :(

Thanks @JohnFlowerful, those include-errors are easy to fix. But there are these ones, that I have no idea yet how to deal with:

In file included from ../../components/bookmarks/browser/bookmark_model.cc:5:
In file included from ../../components/bookmarks/browser/bookmark_model.h:17:
In file included from ../../base/check_op.h:14:
In file included from ../../base/check.h:17:
In file included from ../../base/memory/raw_ptr.h:11:
In file included from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:10:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/functional:63:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/unordered_map:41:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unordered_map.h:33:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable.h:35:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable_policy.h:1725:6: error: static assertion failed due to requirement 'std::__is_invocable<const bookmarks::NodeUuidEquality &, const base::Uuid &, const bookmarks::BookmarkNode *const &>{}': key equality predicate must be invocable with two arguments of key type
 1725 |             __is_invocable<const _Equal&, const _Kt&, const _Key&>{},
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable_policy.h:1741:34: note: in instantiation of function template specialization 'std::__detail::_Hashtable_base<const bookmarks::BookmarkNode *, const bookmarks::BookmarkNode *, std::__detail::_Identity, bookmarks::NodeUuidEquality, bookmarks::NodeUuidHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true>>::_M_key_equals_tr<base::Uuid>' requested here
 1741 |         { return _S_equals(__c, __n) && _M_key_equals_tr(__k, __n); }
      |                                         ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable.h:1991:16: note: in instantiation of function template specialization 'std::__detail::_Hashtable_base<const bookmarks::BookmarkNode *, const bookmarks::BookmarkNode *, std::__detail::_Identity, bookmarks::NodeUuidEquality, bookmarks::NodeUuidHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true>>::_M_equals_tr<base::Uuid>' requested here
 1991 |             if (this->_M_equals_tr(__k, __code, *__p))
      |                       ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable.h:826:22: note: in instantiation of function template specialization 'std::_Hashtable<const bookmarks::BookmarkNode *, const bookmarks::BookmarkNode *, std::allocator<const bookmarks::BookmarkNode *>, std::__detail::_Identity, bookmarks::NodeUuidEquality, bookmarks::NodeUuidHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true>>::_M_find_before_node_tr<base::Uuid>' requested here
  826 |           auto __before_n = _M_find_before_node_tr(__bkt, __key, __c);
      |                             ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable.h:1735:24: note: in instantiation of function template specialization 'std::_Hashtable<const bookmarks::BookmarkNode *, const bookmarks::BookmarkNode *, std::allocator<const bookmarks::BookmarkNode *>, std::__detail::_Identity, bookmarks::NodeUuidEquality, bookmarks::NodeUuidHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true>>::_M_find_node_tr<base::Uuid>' requested here
 1735 |         return const_iterator(_M_find_node_tr(__bkt, __k, __code));
      |                               ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unordered_set.h:677:16: note: in instantiation of function template specialization 'std::_Hashtable<const bookmarks::BookmarkNode *, const bookmarks::BookmarkNode *, std::allocator<const bookmarks::BookmarkNode *>, std::__detail::_Identity, bookmarks::NodeUuidEquality, bookmarks::NodeUuidHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true>>::_M_find_tr<base::Uuid, void, void>' requested here
  677 |         { return _M_h._M_find_tr(__k); }
      |                       ^
../../components/bookmarks/browser/bookmark_model.cc:811:24: note: in instantiation of function template specialization 'std::unordered_set<const bookmarks::BookmarkNode *, bookmarks::NodeUuidHash, bookmarks::NodeUuidEquality>::find<base::Uuid>' requested here
  811 |   auto it = uuid_index.find(uuid);
      |                        ^
In file included from ../../components/bookmarks/browser/bookmark_model.cc:5:
In file included from ../../components/bookmarks/browser/bookmark_model.h:17:
In file included from ../../base/check_op.h:14:
In file included from ../../base/check.h:17:
In file included from ../../base/memory/raw_ptr.h:11:
In file included from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:10:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/functional:63:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/unordered_map:41:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unordered_map.h:33:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable.h:35:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/hashtable_policy.h:1728:11: error: no matching function for call to object of type 'const bookmarks::NodeUuidEquality'
 1728 |           return _M_eq()(__k, _ExtractKey{}(__n._M_v()));
      |                  ^~~~~~~
../../components/bookmarks/browser/uuid_index.h:19:8: note: candidate function not viable: no known conversion from 'const base::Uuid' to 'const BookmarkNode *' for 1st argument
   19 |   bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const {
      |        ^          ~~~~~~~~~~~~~~~~~~~~~~
../../components/bookmarks/browser/uuid_index.h:23:8: note: candidate function not viable: no known conversion from 'const base::Uuid' to 'const BookmarkNode *' for 1st argument
   23 |   bool operator()(const BookmarkNode* n1, const base::Uuid& uuid2) const {
      |        ^          ~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
In file included from ../../chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc:5:
In file included from ../../chrome/browser/ui/webui/omnibox/omnibox_page_handler.h:16:
In file included from gen/chrome/browser/ui/webui/omnibox/omnibox.mojom.h:20:
In file included from ../../mojo/public/cpp/bindings/struct_ptr.h:16:
../../mojo/public/cpp/bindings/type_converter.h:101:8: error: ambiguous partial specializations of 'TypeConverter<std::vector<mojo::StructPtr<mojom::AutocompleteMatch>>, std::vector<AutocompleteMatch>>'
  101 | return TypeConverter<T, U>::Convert(obj);
      |        ^
../../chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc:316:15: note: in instantiation of function template specialization 'mojo::ConvertTo<std::vector<mojo::StructPtr<mojom::AutocompleteMatch>>, std::vector<AutocompleteMatch>>' requested here
  316 |         mojo::ConvertTo<std::vector<mojom::AutocompleteMatchPtr>>(
      |               ^
../../mojo/public/cpp/bindings/type_converter.h:127:8: note: partial specialization matches [with OutVec = std::vector<mojo::StructPtr<mojom::AutocompleteMatch>>, InVec = std::vector<AutocompleteMatch>]
  127 | struct TypeConverter<OutVec, InVec> {
      |        ^
../../mojo/public/cpp/bindings/type_converter.h:147:8: note: partial specialization matches [with OutVec = std::vector<mojo::StructPtr<mojom::AutocompleteMatch>>, InVec = std::vector<AutocompleteMatch>]
  147 | struct TypeConverter<OutVec, InVec> {
      |        ^
../../mojo/public/cpp/bindings/type_converter.h:101:8: error: ambiguous partial specializations of 'TypeConverter<std::vector<mojo::StructPtr<mojom::AutocompleteResultsForProvider>>, std::vector<scoped_refptr<AutocompleteProvider>>>'
  101 | return TypeConverter<T, U>::Convert(obj);
      |        ^
../../chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc:373:13: note: in instantiation of function template specialization 'mojo::ConvertTo<std::vector<mojo::StructPtr<mojom::AutocompleteResultsForProvider>>, std::vector<scoped_refptr<AutocompleteProvider>>>' requested here
  373 |       mojo::ConvertTo<std::vector<mojom::AutocompleteResultsForProviderPtr>>(
      |             ^
../../mojo/public/cpp/bindings/type_converter.h:127:8: note: partial specialization matches [with OutVec = std::vector<mojo::StructPtr<mojom::AutocompleteResultsForProvider>>, InVec = std::vector<scoped_refptr<AutocompleteProvider>>]
  127 | struct TypeConverter<OutVec, InVec> {
      |        ^
../../mojo/public/cpp/bindings/type_converter.h:147:8: note: partial specialization matches [with OutVec = std::vector<mojo::StructPtr<mojom::AutocompleteResultsForProvider>>, InVec = std::vector<scoped_refptr<AutocompleteProvider>>]
  147 | struct TypeConverter<OutVec, InVec> {
      |        ^
2 errors generated.
In file included from ../../third_party/blink/renderer/modules/handwriting/handwriting_type_converters.cc:5:
In file included from ../../third_party/blink/renderer/modules/handwriting/handwriting_type_converters.h:8:
../../mojo/public/cpp/bindings/type_converter.h:101:8: error: ambiguous partial specializations of 'TypeConverter<WTF::Vector<mojo::StructPtr<handwriting::mojom::blink::HandwritingPoint>>, blink::HeapVector<cppgc::internal::BasicMember<const blink::HandwritingPoint, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>>'
  101 | return TypeConverter<T, U>::Convert(obj);
      |        ^
../../third_party/blink/renderer/modules/handwriting/handwriting_type_converters.cc:64:13: note: in instantiation of function template specialization 'mojo::ConvertTo<WTF::Vector<mojo::StructPtr<handwriting::mojom::blink::HandwritingPoint>>, blink::HeapVector<cppgc::internal::BasicMember<const blink::HandwritingPoint, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>>' requested here
   64 |       mojo::ConvertTo<Vector<HandwritingPointPtr>>(input->getPoints());
      |             ^
../../mojo/public/cpp/bindings/type_converter.h:127:8: note: partial specialization matches [with OutVec = WTF::Vector<mojo::StructPtr<handwriting::mojom::blink::HandwritingPoint>>, InVec = blink::HeapVector<cppgc::internal::BasicMember<const blink::HandwritingPoint, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>]
  127 | struct TypeConverter<OutVec, InVec> {
      |        ^
../../mojo/public/cpp/bindings/type_converter.h:147:8: note: partial specialization matches [with OutVec = WTF::Vector<mojo::StructPtr<handwriting::mojom::blink::HandwritingPoint>>, InVec = blink::HeapVector<cppgc::internal::BasicMember<const blink::HandwritingPoint, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>]
  147 | struct TypeConverter<OutVec, InVec> {
      |        ^
1 error generated.
In file included from ../../third_party/blink/renderer/modules/printing/web_printing_type_converters.cc:5:
In file included from ../../third_party/blink/renderer/modules/printing/web_printing_type_converters.h:8:
../../mojo/public/cpp/bindings/type_converter.h:101:8: error: ambiguous partial specializations of 'TypeConverter<blink::HeapVector<cppgc::internal::BasicMember<blink::WebPrintingResolution, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>, WTF::Vector<gfx::Size>>'
  101 | return TypeConverter<T, U>::Convert(obj);
      |        ^
../../third_party/blink/renderer/modules/printing/web_printing_type_converters.cc:317:13: note: in instantiation of function template specialization 'mojo::ConvertTo<blink::HeapVector<cppgc::internal::BasicMember<blink::WebPrintingResolution, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>, WTF::Vector<gfx::Size>>' requested here
  317 |       mojo::ConvertTo<HeapVector<Member<blink::WebPrintingResolution>>>(
      |             ^
../../mojo/public/cpp/bindings/type_converter.h:127:8: note: partial specialization matches [with OutVec = blink::HeapVector<cppgc::internal::BasicMember<blink::WebPrintingResolution, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>, InVec = WTF::Vector<gfx::Size>]
  127 | struct TypeConverter<OutVec, InVec> {
      |        ^
../../mojo/public/cpp/bindings/type_converter.h:147:8: note: partial specialization matches [with OutVec = blink::HeapVector<cppgc::internal::BasicMember<blink::WebPrintingResolution, cppgc::internal::StrongMemberTag, cppgc::internal::DijkstraWriteBarrierPolicy>>, InVec = WTF::Vector<gfx::Size>]
  147 | struct TypeConverter<OutVec, InVec> {
      |        ^
1 error generated.

This got me passed the static assertion (I think):
https://chromium-review.googlesource.com/c/chromium/src/+/5227686

There's a couple more of those std::optional patches as well... I needed at least this one:
https://chromium-review.googlesource.com/c/chromium/src/+/5259337

It seems like the ebuild is patching type_converter.h seen in #303. There was a commit yesterday or so about it:
https://chromium-review.googlesource.com/c/chromium/src/+/5307601
I haven't looked much further than this however.

Edit: just realised I'm posting this in the 121 issue instead of the one for 122. Sorry :(

Edit: just realised I'm posting this in the 121 issue instead of the one for 122. Sorry :(

It was opened for 121, but it gradually became about libcxx in general :) So no need to sorry, I'm making chaos myself.

Compiled (but untested) using the following:

Missing std::optional:
https://chromium-review.googlesource.com/c/chromium/src/+/5259337
https://chromium-review.googlesource.com/c/chromium/src/+/5227329
https://chromium-review.googlesource.com/c/chromium/src/+/5223947
https://chromium-review.googlesource.com/c/chromium/src/+/5306779

Missing std::bitset:
https://chromium-review.googlesource.com/c/chromium/src/+/5190545

libstdc++ static assertion in NodeUuidEquality:
https://chromium-review.googlesource.com/c/chromium/src/+/5227686

And finally a patch for https://chromium-review.googlesource.com/c/chromium/src/+/5307601 based on 122.0.6261.69:
base_to_address.patch.tar.gz
Excuse the patch format. Copying files in ram is faster than downloading chromium with enough depth to see this far back >_>

Edit: forgot to mention that I removed ungoogled-chromium-121-ConvertTo-r1.patch from the ebuild.

Edit 2: because I removed the above patch from the ebuild, I needed https://chromium-review.googlesource.com/c/chromium/src/+/5227330 as well.

Thanks, @JohnFlowerful! I've added your patch and the missing ones. Still building.