Search code examples
c++chromium

build chromium on Mac then I got cannot execute binary file


I am trying to build Google Chromium on a Mac. To get Chromiumum I did the following steps:

  1. fetch chromium on a Google Cloud Ubuntu Server.
  2. git fetch origin tag <tag> on the server.
  3. Zip the downloaded source and then download the zipped source to my local machine
  4. Unzip the source on my local machine.

This process is need due to bad network connection in China which meant git clone can experience packet loss.

To build, I did the following steps:

  1. gclient sync
  2. gn gen out/Default
  3. autoninja -C out/Default chrome

When doing this I get the following error;

[1/48575] CC obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o
FAILED: obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o 
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o.d -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1220 -DCR_CLANG_REVISION=\"llvmorg-12-init-11462-g418f18c6-1\" -DCOMPONENT_BUILD -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_DEBUG=0 -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBP_NEAR_LOSSLESS=0 -DWEBP_DISABLE_STATS -DWEBP_REDUCE_SIZE -DWEBP_REDUCE_CSP -DWEBP_EXTERN=extern -I../.. -Igen -I../../third_party/libwebp -I../../third_party/libwebp/src -msse4.1 -fno-strict-aliasing -fstack-protector-strong -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O0 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.10.0 -ftrivial-auto-var-init=pattern -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -std=c11 -Wno-implicit-fallthrough -c ../../third_party/libwebp/src/dsp/dec_sse41.c -o obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o
/bin/sh: ../../third_party/llvm-build/Release+Asserts/bin/clang: cannot execute binary file

I'm working on this over 5 days, pls help me.


Solution

  • It works, I found a solution.

    I remove src/third_party/llvm-build directory, then gclient sync again. It will download executable clang program.

    thx everybody.