chromiumunsafeninjagn

Error when compiling Chromium on an M2 Macbook Air


So i was trying to compile Chromium on MacOS Sonoma with an M2 chip using autoninja and on [50994/61229] CXX obj/third_party/blink/renderer/bindings/core/v8/v8/v8_async_iterator_readable_stream.o it suddenly failed. The error log is extremely long but they are all about unsafe buffer access.

/Users/me/chromium/src/out/Default/../../base/containers/span.h:901:27: error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
901 |     return UNSAFE_BUFFERS(data()[idx]);

I never actually modified the code so it's pretty weird.

I tried around 5 more times playing around with my args.gn file but nothing worked. This is my args.gn file right now by the way:

target_cpu = "arm64"
is_debug = false
is_component_build = true
symbol_level = 0

Please help


Solution

  • To add or modify compiler flags, you typically need to use the correct configuration name in the args.gn file. To disable treating warnings as errors, you can use the following parameter:

    treat_warnings_as_errors = false
    

    This should globally disable the behavior of treating warnings as errors.