| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Usage: make_more_helpers.sh <directory_within_contents> <app_name> | 7 # Usage: make_more_helpers.sh <directory_within_contents> <app_name> |
| 8 # | 8 # |
| 9 # This script creates additional helper .app bundles for Chromium, based on | 9 # This script creates additional helper .app bundles for Chromium, based on |
| 10 # the existing helper .app bundle, changing their Mach-O header's flags to | 10 # the existing helper .app bundle, changing their Mach-O header's flags to |
| 11 # enable and disable various features. Based on Chromium Helper.app, it will | 11 # enable and disable various features. |
| 12 # create Chromium Helper EH.app, which has the MH_NO_HEAP_EXECUTION bit | |
| 13 # cleared to support Chromium child processes that require an executable heap, | |
| 14 # and Chromium Helper NP.app, which has the MH_PIE bit cleared to support | |
| 15 # Chromium child processes that cannot tolerate ASLR. | |
| 16 # | 12 # |
| 17 # This script expects to be called from the chrome_exe target as a postbuild, | 13 # This script expects to be called from the chrome_exe target as a postbuild, |
| 18 # and operates directly within the built-up browser app's versioned directory. | 14 # and operates directly within the built-up browser app's versioned directory. |
| 19 # | 15 # |
| 20 # Each helper is adjusted by giving it the proper bundle name, renaming the | 16 # Each helper is adjusted by giving it the proper bundle name, renaming the |
| 21 # executable, adjusting several Info.plist keys, and changing the executable's | 17 # executable, adjusting several Info.plist keys, and changing the executable's |
| 22 # Mach-O flags. | 18 # Mach-O flags. |
| 23 | 19 |
| 24 set -eu | 20 set -eu |
| 25 | 21 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if [[ ${#} -ne 2 ]]; then | 75 if [[ ${#} -ne 2 ]]; then |
| 80 echo "usage: ${0} <directory_within_contents> <app_name>" >& 2 | 76 echo "usage: ${0} <directory_within_contents> <app_name>" >& 2 |
| 81 exit 1 | 77 exit 1 |
| 82 fi | 78 fi |
| 83 | 79 |
| 84 DIRECTORY_WITHIN_CONTENTS="${1}" | 80 DIRECTORY_WITHIN_CONTENTS="${1}" |
| 85 APP_NAME="${2}" | 81 APP_NAME="${2}" |
| 86 | 82 |
| 87 CONTENTS_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}" | 83 CONTENTS_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}" |
| 88 CONTAINING_DIR="${CONTENTS_DIR}/${DIRECTORY_WITHIN_CONTENTS}" | 84 CONTAINING_DIR="${CONTENTS_DIR}/${DIRECTORY_WITHIN_CONTENTS}" |
| 89 | |
| 90 make_helper "${CONTAINING_DIR}" "${APP_NAME}" "EH" "--executable-heap" | |
| 91 make_helper "${CONTAINING_DIR}" "${APP_NAME}" "NP" "--no-pie" | |
| OLD | NEW |