From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- third_party/python/gyp/test/mac/strip/file.c | 22 ++++ third_party/python/gyp/test/mac/strip/main.c | 25 +++++ third_party/python/gyp/test/mac/strip/strip.saves | 5 + .../gyp/test/mac/strip/subdirectory/nested_file.c | 1 + .../test/mac/strip/subdirectory/nested_strip.saves | 5 + .../test/mac/strip/subdirectory/subdirectory.gyp | 38 +++++++ .../test_reading_save_file_from_postbuild.sh | 5 + .../python/gyp/test/mac/strip/test-defaults.gyp | 51 +++++++++ third_party/python/gyp/test/mac/strip/test.gyp | 119 +++++++++++++++++++++ 9 files changed, 271 insertions(+) create mode 100644 third_party/python/gyp/test/mac/strip/file.c create mode 100644 third_party/python/gyp/test/mac/strip/main.c create mode 100644 third_party/python/gyp/test/mac/strip/strip.saves create mode 100644 third_party/python/gyp/test/mac/strip/subdirectory/nested_file.c create mode 100644 third_party/python/gyp/test/mac/strip/subdirectory/nested_strip.saves create mode 100644 third_party/python/gyp/test/mac/strip/subdirectory/subdirectory.gyp create mode 100755 third_party/python/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh create mode 100644 third_party/python/gyp/test/mac/strip/test-defaults.gyp create mode 100644 third_party/python/gyp/test/mac/strip/test.gyp (limited to 'third_party/python/gyp/test/mac/strip') diff --git a/third_party/python/gyp/test/mac/strip/file.c b/third_party/python/gyp/test/mac/strip/file.c new file mode 100644 index 0000000000..a4c504de71 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/file.c @@ -0,0 +1,22 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +static void the_static_function() {} +__attribute__((used)) void the_used_function() {} + +__attribute__((visibility("hidden"))) __attribute__((used)) + void the_hidden_function() {} +__attribute__((visibility("default"))) __attribute__((used)) + void the_visible_function() {} + +extern const int eci; +__attribute__((used)) int i; +__attribute__((used)) const int ci = 34623; + +void the_function() { + the_static_function(); + the_used_function(); + the_hidden_function(); + the_visible_function(); +} diff --git a/third_party/python/gyp/test/mac/strip/main.c b/third_party/python/gyp/test/mac/strip/main.c new file mode 100644 index 0000000000..b2291a6b09 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/main.c @@ -0,0 +1,25 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +static void the_static_function() {} +__attribute__((used)) void the_used_function() {} + +__attribute__((visibility("hidden"))) __attribute__((used)) +void the_hidden_function() {} +__attribute__((visibility("default"))) __attribute__((used)) +void the_visible_function() {} + +void the_function() {} + +extern const int eci; +__attribute__((used)) int i; +__attribute__((used)) const int ci = 34623; + +int main() { + the_function(); + the_static_function(); + the_used_function(); + the_hidden_function(); + the_visible_function(); +} diff --git a/third_party/python/gyp/test/mac/strip/strip.saves b/third_party/python/gyp/test/mac/strip/strip.saves new file mode 100644 index 0000000000..b60ca62857 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/strip.saves @@ -0,0 +1,5 @@ +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file would list symbols that should not be stripped. diff --git a/third_party/python/gyp/test/mac/strip/subdirectory/nested_file.c b/third_party/python/gyp/test/mac/strip/subdirectory/nested_file.c new file mode 100644 index 0000000000..50daa6c13b --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/subdirectory/nested_file.c @@ -0,0 +1 @@ +void nested_f() {} diff --git a/third_party/python/gyp/test/mac/strip/subdirectory/nested_strip.saves b/third_party/python/gyp/test/mac/strip/subdirectory/nested_strip.saves new file mode 100644 index 0000000000..d434c0ef45 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/subdirectory/nested_strip.saves @@ -0,0 +1,5 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file would list symbols that should not be stripped. diff --git a/third_party/python/gyp/test/mac/strip/subdirectory/subdirectory.gyp b/third_party/python/gyp/test/mac/strip/subdirectory/subdirectory.gyp new file mode 100644 index 0000000000..5d0d190914 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/subdirectory/subdirectory.gyp @@ -0,0 +1,38 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + 'target_name': 'nested_strip_save', + 'type': 'shared_library', + 'sources': [ 'nested_file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)', + 'CHROMIUM_STRIP_SAVE_FILE': 'nested_strip.saves', + }, + }, + { + 'target_name': 'nested_strip_save_postbuild', + 'type': 'shared_library', + 'sources': [ 'nested_file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)', + 'CHROMIUM_STRIP_SAVE_FILE': 'nested_strip.saves', + }, + 'postbuilds': [ + { + 'postbuild_name': 'Action that reads CHROMIUM_STRIP_SAVE_FILE', + 'action': [ + './test_reading_save_file_from_postbuild.sh', + ], + }, + ], + }, + ], +} + diff --git a/third_party/python/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh b/third_party/python/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh new file mode 100755 index 0000000000..976943680e --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +test -f ${CHROMIUM_STRIP_SAVE_FILE} diff --git a/third_party/python/gyp/test/mac/strip/test-defaults.gyp b/third_party/python/gyp/test/mac/strip/test-defaults.gyp new file mode 100644 index 0000000000..e688b955a7 --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/test-defaults.gyp @@ -0,0 +1,51 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'make_global_settings': [ + ['CC', '/usr/bin/clang'], + ], + 'target_defaults': { + 'xcode_settings': { + 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + }, + }, + 'targets': [ + { + 'target_name': 'single_dylib', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + }, + { + 'target_name': 'single_so', + 'type': 'loadable_module', + 'sources': [ 'file.c', ], + }, + { + 'target_name': 'single_exe', + 'type': 'executable', + 'sources': [ 'main.c', ], + }, + + { + 'target_name': 'bundle_dylib', + 'type': 'shared_library', + 'mac_bundle': '1', + 'sources': [ 'file.c', ], + }, + { + 'target_name': 'bundle_so', + 'type': 'loadable_module', + 'mac_bundle': '1', + 'sources': [ 'file.c', ], + }, + { + 'target_name': 'bundle_exe', + 'type': 'executable', + 'mac_bundle': '1', + 'sources': [ 'main.c', ], + }, + ], +} diff --git a/third_party/python/gyp/test/mac/strip/test.gyp b/third_party/python/gyp/test/mac/strip/test.gyp new file mode 100644 index 0000000000..2558aa91bb --- /dev/null +++ b/third_party/python/gyp/test/mac/strip/test.gyp @@ -0,0 +1,119 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# These xcode_settings affect stripping: +# "Deployment postprocessing involves stripping the binary, and setting +# its file mode, owner, and group." +#'DEPLOYMENT_POSTPROCESSING': 'YES', + +# "Specifies whether to strip symbol information from the binary. +# Prerequisite: $DEPLOYMENT_POSTPROCESSING = YES" "Default Value: 'NO'" +#'STRIP_INSTALLED_PRODUCT': 'YES', + +# "Values: +# * all: Strips the binary completely, removing the symbol table and +# relocation information +# * non-global: Strips nonglobal symbols but saves external symbols. +# * debugging: Strips debugging symbols but saves local and global +# symbols." +# (maps to no flag, -x, -S in that order) +#'STRIP_STYLE': 'non-global', + +# "Additional strip flags" +#'STRIPFLAGS': '-c', + +# "YES: Copied binaries are stripped of debugging symbols. This does +# not cause the binary produced by the linker to be stripped. Use +# 'STRIP_INSTALLED_PRODUCT (Strip Linked Product)' to have the linker +# strip the binary." +#'COPY_PHASE_STRIP': 'NO', +{ + 'targets': [ + { + 'target_name': 'no_postprocess', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'NO', + 'STRIP_INSTALLED_PRODUCT': 'YES', + }, + }, + { + 'target_name': 'no_strip', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'NO', + }, + }, + { + 'target_name': 'strip_all', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIP_STYLE': 'all', + }, + }, + { + 'target_name': 'strip_nonglobal', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIP_STYLE': 'non-global', + }, + }, + { + 'target_name': 'strip_debugging', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIP_STYLE': 'debugging', + }, + }, + { + 'target_name': 'strip_all_custom_flags', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIP_STYLE': 'all', + 'STRIPFLAGS': '-c', + }, + }, + { + 'target_name': 'strip_all_bundle', + 'type': 'shared_library', + 'mac_bundle': '1', + 'sources': [ 'file.c', ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIP_STYLE': 'all', + }, + }, + { + 'target_name': 'strip_save', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'dependencies': [ + 'subdirectory/subdirectory.gyp:nested_strip_save', + 'subdirectory/subdirectory.gyp:nested_strip_save_postbuild', + ], + 'xcode_settings': { + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)', + 'CHROMIUM_STRIP_SAVE_FILE': 'strip.saves', + }, + }, + ], +} -- cgit v1.2.3