From d594cdfd857347dca39952250b53bb1d1f27a334 Mon Sep 17 00:00:00 2001 From: Eloston Date: Mon, 5 Dec 2016 12:50:26 -0800 Subject: [PATCH] Attempt to fix Linux static build GN flags Change GN output directory from out/Release to out/Default to follow convention Remove unnecessary macOS flags and build dependencies in version 55 --- BUILDING.md | 14 ++------ buildlib/common.py | 2 +- buildlib/macos.py | 34 ------------------- buildlib/windows.py | 5 --- resources/common/gn_flags | 1 + resources/linux_static/gn_flags | 10 ------ resources/macos/patches/patch_order | 1 - .../fix-libcxx-archive-build-script.patch | 32 ----------------- 8 files changed, 4 insertions(+), 95 deletions(-) delete mode 100644 resources/macos/patches/ungoogled-macos/fix-libcxx-archive-build-script.patch diff --git a/BUILDING.md b/BUILDING.md index fd6bc22f..5ac10be2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -89,22 +89,12 @@ Credits to [9Morello](//github.com/9Morello) for most of the work done on this p * Xcode 7 * Homebrew -* Subversion client * Perl (for creating a `.dmg` package) -* GNU patch (see next section) ### Setting up the build environment -1. Setup [Homebrew Versions](//github.com/Homebrew/homebrew-versions) if you haven't already: `brew tap homebrew/versions` -2. Install GCC 4.9 via Homebrew: - * `brew install gcc49` - * `brew link gcc` -3. Install GNU patch via Homebrew: `brew install homebrew/dupes/gpatch` -4. Install Quilt via Homebrew: `brew install quilt` -5. Install Ninja via Homebrew: `brew install ninja` -6. Try running `svn info https://llvm.org/svn/llvm-project` - * If asked to verify llvm.org's certificate fingerprint, accept it permanently and run this command again - * If still asked to accept the fingerprint, try the solutions [on this page](http://stackoverflow.com/questions/6115170/svn-error-validating-server-certificate). Then try rerunning the command to verify the certificate is accepted. +1. Install Quilt via Homebrew: `brew install quilt` +2. Install Ninja via Homebrew: `brew install ninja` See `build.py` for more on customizing the build environment or process. diff --git a/buildlib/common.py b/buildlib/common.py index decaa4d8..035d5e88 100644 --- a/buildlib/common.py +++ b/buildlib/common.py @@ -78,7 +78,7 @@ class Builder: ninja_command = "ninja" # The build directory relative to the build sandbox - build_output = pathlib.Path("out", "Release") + build_output = pathlib.Path("out", "Default") # The ninja targets to build build_targets = ["chrome"] diff --git a/buildlib/macos.py b/buildlib/macos.py index 5a22b288..bcb88883 100644 --- a/buildlib/macos.py +++ b/buildlib/macos.py @@ -35,20 +35,6 @@ class MacOSBuilder(QuiltPatchComponent, GNMetaBuildComponent): def check_build_environment(self): super(MacOSBuilder, self).check_build_environment() - self.logger.info("Checking svn command...") - result = self._run_subprocess(["svn", "--version", "--quiet"], stdout=subprocess.PIPE, - universal_newlines=True) - if not result.returncode is 0: - raise BuilderException("svn command returned non-zero exit code {}".format( - result.returncode)) - self.logger.debug("Using svn command version '{!s}'".format(result.stdout.strip("\n"))) - - self.logger.info("Checking libtool command...") - libtool_path = shutil.which("libtool") - if libtool_path is None: - raise BuilderException("Could not find command 'libtool' in PATH variable") - self.logger.debug("Found libtool at '{!s}'".format(libtool_path)) - self.logger.info("Checking macOS SDK version...") result = self._run_subprocess(["xcrun", "--show-sdk-version"], stdout=subprocess.PIPE, universal_newlines=True) @@ -60,26 +46,6 @@ class MacOSBuilder(QuiltPatchComponent, GNMetaBuildComponent): result.stdout.strip())) self.logger.debug("Using macOS SDK version '{!s}'".format(result.stdout.strip())) - self.logger.info("Checking g++ compiler for building libc++...") - gxx_compiler = shutil.which("g++-4.9") - if not pathlib.Path(gxx_compiler).is_file(): - raise BuilderException("GNU compiler '{}' does not exist or is not a file".format( - gxx_compiler)) - - def build(self): - if (self._sandbox_dir / pathlib.Path("third_party", "libc++-static", "libc++.a")).exists(): - self.logger.info("libc++.a already exists. Skipping its building") - else: - self.logger.info("Building libc++.a ...") - result = self._run_subprocess("./build.sh", - cwd=str(self._sandbox_dir / - pathlib.Path("third_party", "libc++-static")), - shell=True) - if not result.returncode == 0: - raise BuilderException("libc++.a build script returned non-zero exit code") - - super(MacOSBuilder, self).build() - def generate_package(self): # Based off of chrome/tools/build/mac/build_app_dmg self.logger.info("Generating .dmg file...") diff --git a/buildlib/windows.py b/buildlib/windows.py index 9bb3d6f3..84e7f6b6 100644 --- a/buildlib/windows.py +++ b/buildlib/windows.py @@ -51,11 +51,6 @@ class WindowsBuilder(GNUPatchComponent, GNMetaBuildComponent): self._files_cfg = (self._sandbox_dir / pathlib.Path("chrome", "tools", "build", "win", "FILES.cfg")) - # Fix build output directory based on user-specified target_cpu - # If it cannot be determined, assume 32-bit. This uses the default directory - if self.target_cpu == CPUArch.x64: - self.build_output = pathlib.Path("out", "Release_x64") - def generate_build_configuration(self): self.logger.info("Running gn command...") if self.use_depot_tools_toolchain: diff --git a/resources/common/gn_flags b/resources/common/gn_flags index c71b7523..0e756c0a 100644 --- a/resources/common/gn_flags +++ b/resources/common/gn_flags @@ -26,3 +26,4 @@ remove_webcore_debug_symbols=true enable_widevine=true enable_rlz_support=false symbol_level=0 +enable_iterator_debugging=false diff --git a/resources/linux_static/gn_flags b/resources/linux_static/gn_flags index 39338ef3..4e3caf2c 100644 --- a/resources/linux_static/gn_flags +++ b/resources/linux_static/gn_flags @@ -1,11 +1 @@ -is_clang=true -use_sysroot=false -clang_use_chrome_plugins=false -use_gconf=false -use_gnome_keyring=false -use_gold=true -gold_path="" -enable_iterator_debugging=false -clang_base_path="/usr/lib/llvm-3.9" -ffmpeg_branding="ChromeOS" is_official_build=true diff --git a/resources/macos/patches/patch_order b/resources/macos/patches/patch_order index ebe19fca..a1453a6a 100644 --- a/resources/macos/patches/patch_order +++ b/resources/macos/patches/patch_order @@ -1,3 +1,2 @@ -ungoogled-macos/fix-libcxx-archive-build-script.patch ungoogled-macos/disable-symbol-order-verification.patch ungoogled-macos/add-trknotify-gn-dependency.patch diff --git a/resources/macos/patches/ungoogled-macos/fix-libcxx-archive-build-script.patch b/resources/macos/patches/ungoogled-macos/fix-libcxx-archive-build-script.patch deleted file mode 100644 index 38c7a621..00000000 --- a/resources/macos/patches/ungoogled-macos/fix-libcxx-archive-build-script.patch +++ /dev/null @@ -1,32 +0,0 @@ -# Modify libc++.a build script to make it build - ---- a/third_party/libc++-static/build.sh -+++ b/third_party/libc++-static/build.sh -@@ -13,15 +13,15 @@ THIS_DIR="${PWD}/$(dirname "${0}")" - # TODO(thakis): Figure out why our clang complains about visibility and - # redeclarations. - #CXX="$THIS_DIR/../llvm-build/Release+Asserts/bin/clang++" --CXX=c++ -+CXX=g++-4.9 - - --FLAGS="-nostdinc++ -O3 -std=c++11 -fstrict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -arch i386 -arch x86_64 -isysroot $(xcrun -show-sdk-path)" -+FLAGS="-nostdinc++ -O3 -std=c++11 -fstrict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.7 -arch x86_64 -isysroot $(xcrun -show-sdk-path)" - - pushd "${DIR}" - --svn co --force https://llvm.org/svn/llvm-project/libcxx/trunk@$REV libcxx --svn co --force https://llvm.org/svn/llvm-project/libcxxabi/trunk@$REV libcxxabi -+svn --non-interactive --trust-server-cert co --force https://llvm.org/svn/llvm-project/libcxx/trunk@$REV libcxx -+svn --non-interactive --trust-server-cert co --force https://llvm.org/svn/llvm-project/libcxxabi/trunk@$REV libcxxabi - - mkdir libcxxbuild - cd libcxxbuild -@@ -47,7 +47,6 @@ popd - libtool -static -o libc++.a libcxx*/*.o - - cp libc++.a "${THIS_DIR}/libc++.a" --upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++.a" - - popd - rm -rf "${DIR}"