Cannot Build Chromium

373 views
Skip to first unread message

Leylan Aurakeasamy

unread,
Aug 17, 2023, 5:31:13 PM8/17/23
to Chromium-dev
Hi,

I am using the following command to build chromium

autoninja -j 1 -C out/Default system_webview_apk

i keep getting the following error

FAILED: obj/third_party/distributed_point_functions/distributed_point_functions/evaluate_prg_hwy.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/distributed_point_functions/distributed_point_functions/evaluate_prg_hwy.o.d -DDCHECK_ALWAYS_ON=1 -D_GNU_SOURCE -D_LIBCPP_ENABLE_ASSERTIONS=1 -DANDROID -DHAVE_SYS_UIO_H -DANDROID_NDK_VERSION_ROLL=r25c_1 -DCR_CLANG_REVISION=\"llvmorg-17-init-16420-g0c545a44-5\" -DCOMPONENT_BUILD -DCR_LIBCXX_REVISION=84fb809dd6dae36d556dc0bb702c6cc2ce9d4b80 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DBASE_USE_PERFETTO_CLIENT_LIBRARY=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DGOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE=0 -DHAVE_PTHREAD -DPROTOBUF_USE_DLLS -DABSL_CONSUME_DLL -DBORINGSSL_SHARED_LIBRARY -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/distributed_point_functions -I../../third_party/distributed_point_functions/code -Igen/third_party/distributed_point_functions -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/abseil-cpp -I../../third_party/highway/src -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -fcomplete-member-pointers -ffunction-sections -fno-short-enums --target=arm-linux-androideabi24 -march=armv7-a -mfloat-abi=softfp -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -mfpu=neon -mthumb -ftrivial-auto-var-init=pattern -Oz -fdata-sections -ffunction-sections -fno-unique-section-names -fomit-frame-pointer -gdwarf-4 -g2 -gdwarf-aranges -Xclang -fuse-ctor-homing -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ref-template-as-trivial-member -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Xclang -plugin-arg-find-bad-constructs -Xclang check-raw-ptr-fields -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-exclude-path=um/winnt.h -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -DPROTOBUF_ALLOW_DEPRECATED=1 -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fvisibility-inlines-hidden -c ../../third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc -o obj/third_party/distributed_point_functions/distributed_point_functions/evaluate_prg_hwy.o
Killed
ninja: build stopped: subcommand failed.

Bob

unread,
Aug 21, 2023, 4:49:56 PM8/21/23
to Chromium-dev, Leylan Aurakeasamy
For webview build I'm using a script like this from here https://gitlab.com/harvey186/mulch

Leylan Aurakeasamy

unread,
Aug 22, 2023, 2:01:08 PM8/22/23
to Chromium-dev, Bob, Leylan Aurakeasamy
This is the script i am using

#!/bin/bash

set -e

chromium_version="116.0.5845.92"
chromium_code="5484592"
chromium_rebrand_name="Mulch"
chromium_rebrand_color="#7B3F00"
chromium_packageid_webview="com.android.webview"
chromium_packageid_standalone="com.android.webview"
chromium_packageid_libtrichrome="com.android.webview"
clean=0
gsync=0
supported_archs=(arm arm64 x86 x64)

usage() {
    echo "Usage:"
    echo "  build_webview [ options ]"
    echo
    echo "  Options:"
    echo "    -a <arch> Build specified arch"
    echo "    -c Clean"
    echo "    -h Show this message"
    echo "    -r <release> Specify chromium release"
    echo "    -s Sync"
    echo
    echo "  Example:"
    echo "    build_webview -c -s -r $chromium_version:$chromium_code"
    echo
    exit 1
}

build() {
    build_args=$args' target_cpu="'$1'"'

    code=$chromium_code
    if [ $1 '==' "arm" ]; then
        code+=00
    elif [ $1 '==' "arm64" ]; then
        code+=50
        #build_args+=' arm_control_flow_integrity="standard"'
    elif [ $1 '==' "x86" ]; then
        code+=10
    elif [ $1 '==' "x64" ]; then
        code+=60
    fi
    build_args+=' android_default_version_code="'$code'"'

    gn gen "out/$1" --args="$build_args"
    ninja -C out/$1 system_webview_apk chrome_public_apk
    if [ "$?" -eq 0 ]; then
        [ "$1" '==' "x64" ] && android_arch="x86_64" || android_arch=$1
        cp out/$1/apks/SystemWebView.apk ../prebuilt/$android_arch/webview.apk
    fi
}

while getopts ":a:chr:s" opt; do
    case $opt in
        a) for arch in ${supported_archs[@]}; do
               [ "$OPTARG" '==' "$arch" ] && build_arch="$OPTARG"
           done
           if [ -z "$build_arch" ]; then
               echo "Unsupported ARCH: $OPTARG"
               echo "Supported ARCHs: ${supported_archs[@]}"
               exit 1
           fi
           ;;
        c) clean=1 ;;
        h) usage ;;
        r) version=(${OPTARG//:/ })
           chromium_version=${version[0]}
           chromium_code=${version[1]}
           ;;
        s) gsync=1 ;;
        :)
          echo "Option -$OPTARG requires an argument"
          echo
          usage
          ;;
        \?)
          echo "Invalid option:-$OPTARG"
          echo
          usage
          ;;
    esac
done
shift $((OPTIND-1))

# Add depot_tools to PATH
if [ ! -d depot_tools ]; then
fi
export PATH="$(pwd -P)/depot_tools:$PATH"

if [ ! -d src ]; then
    echo "Initial source download"
    fetch android
    yes | gclient sync -D -R -r $chromium_version
fi

if [ $gsync -eq 1 ]; then
    echo "Syncing"
    find src -name index.lock -delete
    yes | gclient sync -D -R -f -r $chromium_version
fi
cd src

# Build args
args='target_os="android"'
args+=' android_channel="stable"' #Release build
args+=' android_default_version_name="'$chromium_version'"'
args+=' disable_fieldtrial_testing_config=true'
args+=' is_chrome_branded=false'
args+=' is_component_build=false'
args+=' is_official_build=true'
args+=' use_official_google_api_keys=false'
args+=' webview_devui_show_icon=false'
args+=' blink_symbol_level=0' #Release optimizations
args+=' is_debug=false'
args+=' symbol_level=0'
args+=' dfmify_dev_ui=false' #Don't build as module
args+=' disable_tab_ui_dfm=true'
args+=' ffmpeg_branding="Chrome"' #Codec support
args+=' proprietary_codecs=true'
args+=' enable_resource_allowlist_generation=false'
args+=' enable_gvr_services=false' #Unncessary
args+=' enable_nacl=false'
args+=' enable_remoting=false'
args+=' enable_vr=false'
args+=' use_official_google_api_keys=false'
args+=' system_webview_package_name="'$chromium_packageid_webview'"' #Package IDs
args+=' chrome_public_manifest_package="'$chromium_packageid_standalone'"'
args+=' trichrome_library_package="'$chromium_packageid_libtrichrome'"'
args+=' is_cfi=true' #Security
args+=' use_cfi_cast=true'
args+=' use_relative_vtables_abi=false'
args+=' enable_reporting=false' #Privacy

# Setup environment
[ $clean -eq 1 ] && rm -rf out && echo "Cleaned out"
. build/android/envsetup.sh

# Check target and build
if [ -n "$build_arch" ]; then
    build $build_arch
else
    echo "Building all"
    build arm
fi


and building it with ./build.sh -c -s -a arm

Leylan Aurakeasamy

unread,
Aug 22, 2023, 2:01:15 PM8/22/23
to Chromium-dev, Bob, Leylan Aurakeasamy
hi, thanks for replying i have a question on the chrome version and chrome code. How do i set this to the latest? 

I removed the patches, this patches just set the branding and images of the apk right ?

On Monday, 21 August 2023 at 22:49:56 UTC+2 Bob wrote:

Christian Biesinger

unread,
Aug 22, 2023, 2:20:34 PM8/22/23
to leylan.au...@gmail.com, Chromium-dev, Bob
You are probably running out of memory (check the output of `dmesg` to
see if it says something about the OOM killer)

is_official_build=true needs an especially large amount of RAM

Christian
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/551f5285-8c08-44a3-9625-77d41ea2e42an%40chromium.org.

Leylan Aurakeasamy

unread,
Aug 23, 2023, 4:33:28 PM8/23/23
to Chromium-dev, Christian Biesinger, Chromium-dev, Bob, leylan.au...@gmail.com
I have 32GB of RAM. I did monitor my usage was at about 70% of memory usage when it fails. I can set the flag to false maybe that will help. 

Leylan Aurakeasamy

unread,
Aug 24, 2023, 3:36:45 PM8/24/23
to Chromium-dev, Leylan Aurakeasamy, Christian Biesinger, Chromium-dev, Bob
does it make sense that the build uses 13GB of RAM ? 

[94008.533551] Out of memory: Killed process 938999 (clang++) total-vm:13094360kB, anon-rss:12766040kB, file-rss:1024kB, shmem-rss:0kB, UID:0 pgtables:25668kB oom_score_adj:0

K. Moon

unread,
Aug 24, 2023, 4:32:09 PM8/24/23
to leylan.au...@gmail.com, Chromium-dev, Christian Biesinger, Bob
It's not unheard of to need 64+ GB of RAM to build Chrome.

Sangwhan Moon

unread,
Aug 30, 2023, 3:55:41 PM8/30/23
to km...@chromium.org, leylan.au...@gmail.com, Chromium-dev, Christian Biesinger, Bob
Cross compile on 40GBs of RAM hit OOM, for one empirical example. Closing all browser windows let it get through. You could try that.

On Aug 25, 2023, at 5:31, K. Moon <km...@chromium.org> wrote:



Leylan Aurakeasamy

unread,
Aug 30, 2023, 4:00:45 PM8/30/23
to Chromium-dev, K. Moon, Chromium-dev, Christian Biesinger, Bob, leylan.au...@gmail.com
Do you guys know why i get this error when trying to install the apk:

08-30 09:21:55.327   941  1054 E NativeLibraryHelper: Library 'libcomponents_apdu.cr.so' is not page-aligned - will not be able to open it directly from apk.
08-30 09:21:55.327   941  1054 W NativeHelper: Failure copying 32 bit native libraries; copyRet=-2
08-30 09:21:55.328   941  1054 E PackageInstallerSession: Commit of session 585682695 failed: Failed to extract native libraries, res=-2
Reply all
Reply to author
Forward
0 new messages