Question on liballocator dependency

36 views
Skip to first unread message

William Candillon

unread,
May 28, 2025, 1:15:38 AMMay 28
to Dawn Graphics

Hello,

On Android we do need to apply a tiny patch for Dawn to link on Android. In build_overrides/dawn.gni, `dawn_partition_alloc_dir="//third_party/externals/partition_alloc"` needs to be unset; however, I didn't find a way to do it via the command line. Is it possible to do it without patching dawn?

And/Or should the linking error itself be reported as a bug?

Kind regards,

William

Corentin Wallez

unread,
May 28, 2025, 7:28:48 AMMay 28
to William Candillon, Dawn Graphics
Hey William,

Since this is a GN arg, you can modify out/<your dir>/args.gn to put the empty string in that place? But why do you need to unset it? Can partition alloc be fixed instead? Also why not use the CMake build? The GN build is very tied to Chromium and not great for general consumption.

Cheers,

Corentin

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dawn-graphics/9658781f-6001-4d40-8c23-e0bfd890cb80n%40googlegroups.com.

William Candillon

unread,
May 28, 2025, 10:20:07 AMMay 28
to Corentin Wallez, Dawn Graphics
Hello Corentin,

Thank you for your prompt reply. This error occurs when building the
Dawn part of Skia Graphite. On Android, we get:

ld.lld: error: undefined symbol:
partition_alloc::internal::PartitionAddressSpace::setup_
>>> referenced by HistogramMacros.cpp
>>> libdawn_platform_static.HistogramMacros.o:(dawn::platform::metrics::DawnHistogramTimer::DawnHistogramTimer(dawn::platform::Platform*)) in archive

(Full stack trace:
https://gist.github.com/wcandillon/4ddb2d3adefd28a5bb39d37c7c755c04)

You raise some interesting points. Currently, I am migrating our
WebGPU module to use the Dawn build from Skia so that everything stays
in sync. The idea is that eventually React Native Skia Graphite will
ship everything as one cohesive package, including WebGPU bindings. Of
course, if you want to use WebGPU without Skia, you're free to do so
we will have a separate WebGPU module that pulls pre-built binaries
and bindings from our Skia repository, creating one monolithic block.

Let me know if you foresee any issues with this new approach.

Kind regards,

William

William Candillon

unread,
Jun 1, 2025, 1:34:24 PMJun 1
to Corentin Wallez, Dawn Graphics
Hello,

The CMake build still works for us nicely but I had to patch
abseil-cpp as I hit the build issue described at
https://github.com/abseil/abseil-cpp/issues/1241
I am surprised the issue is not occurring on the google/dawn GitHub
build workflow. Do you think I should try to contribute my iOS/Android
prebuilt binaries scripts to the GitHub workflow?
It's a bit different because we cross-compile and another tiny quirk
is that on iOS we force building a static lib file since shared
libraries are not supported in CocoaPods I think.

Let me know what you think.

Kind regards,

William

Corentin Wallez

unread,
Jun 2, 2025, 10:56:15 AMJun 2
to William Candillon, Dawn Graphics, Arthur Sonzogni, Kai Ninomiya
Hey William,

For the GN build, partition_alloc enablement is done in this file and arguments can be overriden in the GN args (gn args out/Release) if needed. Also unsetting dawn_partition_alloc_dir should make Dawn use its own raw_ptr variant. I'm surprised that the GN build fails because GN deps seem to be set up correctly. +CC Arthur in case he's got any idea.

TBH using the Skia+Dawn GN build will be a best effort support path and it might break as it's not meant for consumption outside of the Skia CI. Chromium is the only other place I know of that bundles Skia + Dawn but I can't recommend using it for your build due to its size and complexity. So IDK of a future proof, well supported Skia + Dawn build path for consumption outside of Chromium :/

I'm not sure that I totally got what the issue was in the abseil issue you linked. But IMHO we should add Android / iOS prebuilt to the Github CI, +CC Kai for that.

Cheers,

Corentin

William Candillon

unread,
Jun 2, 2025, 3:32:50 PMJun 2
to Corentin Wallez, Dawn Graphics, Arthur Sonzogni, Kai Ninomiya
Hello Corentin,

Thank you for your prompt reply and for notifying me that there is
openness to accept contributions for iOS + Android prebuilt binaries
to GitHub. This will help a lot.

I have indeed cooled off completely on the idea of using the build
artifacts from Skia for WebGPU, for exactly the reasons you pointed
out in your last message.

However, I am still encountering the dawn_partition_alloc_dir issue in
the Skia Graphite/Dawn build. I wasn't able to resolve it using the
dawn_partition_alloc_dir="" argument.
This issue doesn't arise in the standalone CMake Dawn build.

Thank you for bringing clarity to these topics.

Kind regards,

William

Corentin Wallez

unread,
Jun 3, 2025, 7:33:04 AMJun 3
to William Candillon, Dawn Graphics, Arthur Sonzogni, Kai Ninomiya
Hey William,

Without additional context it's not clear why setting dawn_partition_alloc_dir="" isn't sufficient. Try using GN's print() in the file I linked earlier to see what doesn't get set correctly?

Cheers,

Corentin

William Candillon

unread,
Jun 4, 2025, 6:37:45 AMJun 4
to Corentin Wallez, Dawn Graphics, Arthur Sonzogni, Kai Ninomiya
Hello Corentin and Kai,

I've made a PR to pre-build iOS and Android binaries on Github:
https://github.com/google/dawn/pull/39
As you can see from this run, it runs nicely:
https://github.com/google/dawn/actions/runs/15435405483/job/43440726042
(the final steps failed but because we don't build the static iOS
library).

However for iOS we would like to build the fat lib and therefore we
apply a tiny patch first to build the static lib on iOS:
https://github.com/google/dawn/pull/39/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR118
As far as I know, as long as React Native is using CocoaPods, we need
to use the fab lib approach. But maybe we can ask via a command line
option to build the static lib if needed? I assume this would be your
preference? If yes could you give me pointers on this?

Let me know your thoughts but if we have this setup, this would be
quite helpful for us. And it would be very helpful for other mobile
libraries wishing to use Dawn.

Kind regards,

William
Reply all
Reply to author
Forward
0 new messages