summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkotwicz <pkotwicz@chromium.org>2015-12-04 11:51:00 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-04 19:52:01 +0000
commitbf76930aa62c84995ba84327173b1542b83186f3 (patch)
treed28f3c5bb876bf90f60f213d002302314bf2f73d
parent0017a90616f14a386021560570ac6fec32b7e66d (diff)
downloadchromium_src-bf76930aa62c84995ba84327173b1542b83186f3.zip
chromium_src-bf76930aa62c84995ba84327173b1542b83186f3.tar.gz
chromium_src-bf76930aa62c84995ba84327173b1542b83186f3.tar.bz2
Remove run_pie from android/tools now that ICS support is deprecated
BUG=473837, 535071 Review URL: https://codereview.chromium.org/1497743004 Cr-Commit-Position: refs/heads/master@{#363272}
-rw-r--r--build/common.gypi6
-rw-r--r--tools/android/android_tools.gyp1
-rw-r--r--tools/android/run_pie/run_pie.c68
-rw-r--r--tools/android/run_pie/run_pie.gyp49
-rw-r--r--tools/telemetry/bin/android/arm64-v8a/run_pie.sha11
-rw-r--r--tools/telemetry/bin/android/armeabi-v7a/run_pie.sha11
-rw-r--r--tools/telemetry/telemetry/internal/platform/android_platform_backend.py1
7 files changed, 0 insertions, 127 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 888f3214..7db1833 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -4965,20 +4965,14 @@
],
'target_conditions': [
['_type=="executable"', {
- # Force android tools to export the "main" symbol so they can be
- # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
- # TODO(primiano): remove -fvisibility and -rdynamic flags below
- # when ICS support will be dropped.
'cflags': [
'-fPIE',
- '-fvisibility=default',
],
'ldflags': [
'-Bdynamic',
'-Wl,--gc-sections',
'-Wl,-z,nocopyreloc',
'-pie',
- '-rdynamic',
# crtbegin_dynamic.o should be the last item in ldflags.
'<(android_ndk_lib)/crtbegin_dynamic.o',
],
diff --git a/tools/android/android_tools.gyp b/tools/android/android_tools.gyp
index 9ae163c..92b2b71 100644
--- a/tools/android/android_tools.gyp
+++ b/tools/android/android_tools.gyp
@@ -17,7 +17,6 @@
'md5sum/md5sum.gyp:md5sum',
'memtrack_helper/memtrack_helper.gyp:memtrack_helper',
'purge_ashmem/purge_ashmem.gyp:purge_ashmem',
- 'run_pie/run_pie.gyp:run_pie',
'../../tools/telemetry/telemetry.gyp:*#host',
],
},
diff --git a/tools/android/run_pie/run_pie.c b/tools/android/run_pie/run_pie.c
deleted file mode 100644
index ee1a622..0000000
--- a/tools/android/run_pie/run_pie.c
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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.
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/prctl.h>
-#include <unistd.h>
-
-// This is a wrapper to run position independent executables on Android ICS,
-// where the linker doesn't support PIE. This requires the PIE binaries to be
-// built with CFLAGS +=-fvisibility=default -fPIE, and LDFLAGS += -rdynamic -pie
-// such that the main() symbol remains exported and can be dlsym-ed.
-
-#define ERR_PREFIX "[PIE Loader] "
-
-typedef int (*main_t)(int, char**);
-
-
-int main(int argc, char** argv) {
- if (argc < 2) {
- printf("Usage: %s path_to_pie_executable [args]\n", argv[0]);
- return -1;
- }
-
- // Shift left the argv[]. argv is what /proc/PID/cmdline prints out. In turn
- // cmdline is what Android "ps" prints out. In turn "ps" is what many scripts
- // look for to decide which processes to kill / killall.
- int i;
- char* next_argv_start = argv[0];
- for (i = 1; i < argc; ++i) {
- const size_t argv_len = strlen(argv[i]) + 1;
- memcpy(argv[i - 1], argv[i], argv_len);
- next_argv_start += argv_len;
- argv[i] = next_argv_start;
- }
- argv[argc - 1] = NULL; // The last argv must be a NULL ptr.
-
- // Set also the proc name accordingly (/proc/PID/comm).
- prctl(PR_SET_NAME, (long) argv[0]);
-
- // dlopen should not fail, unless:
- // - The target binary does not exists:
- // - The dependent .so libs cannot be loaded.
- // In both cases, just bail out with an explicit error message.
- void* handle = dlopen(argv[0], RTLD_NOW);
- if (handle == NULL) {
- printf(ERR_PREFIX "dlopen() failed: %s.\n", dlerror());
- return -1;
- }
-
- main_t pie_main = (main_t) dlsym(handle, "main");
- if (pie_main) {
- return pie_main(argc - 1, argv);
- }
-
- // If we reached this point dlsym failed, very likely because the target
- // binary has not been compiled with the proper CFLAGS / LDFLAGS.
- // At this point the most sensible thing to do is running that normally
- // via exec and hope that the target binary wasn't a PIE.
- execv(argv[0], argv);
-
- // exevc is supposed to never return, unless it fails.
- printf(ERR_PREFIX "Both dlsym() and the execv() fallback failed.\n");
- perror("execv");
- return -1;
-}
diff --git a/tools/android/run_pie/run_pie.gyp b/tools/android/run_pie/run_pie.gyp
deleted file mode 100644
index 75850f4..0000000
--- a/tools/android/run_pie/run_pie.gyp
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2014 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.
-
-{
- 'targets': [
- {
- 'target_name': 'run_pie-unstripped',
- 'type': 'executable',
- 'sources': [
- 'run_pie.c',
- ],
- # See crbug.com/373219. This is the only Android executable which must be
- # non PIE.
- 'cflags!': [
- '-fPIE',
- ],
- 'ldflags!': [
- '-pie',
- ],
- # Don't inherit unneeded dependencies on libc++, so the binary remains
- # self-contained also in component=shared_library builds.
- 'libraries!': [
- '-l<(android_libcpp_library)',
- ],
- },
- {
- 'target_name': 'run_pie',
- 'type': 'none',
- 'dependencies': [
- 'run_pie-unstripped',
- ],
- 'actions': [
- {
- 'action_name': 'strip_run_pie',
- 'inputs': ['<(PRODUCT_DIR)/run_pie-unstripped'],
- 'outputs': ['<(PRODUCT_DIR)/run_pie'],
- 'action': [
- '<(android_strip)',
- '--strip-unneeded',
- '<@(_inputs)',
- '-o',
- '<@(_outputs)',
- ],
- },
- ],
- },
- ],
-}
diff --git a/tools/telemetry/bin/android/arm64-v8a/run_pie.sha1 b/tools/telemetry/bin/android/arm64-v8a/run_pie.sha1
deleted file mode 100644
index c22a415..0000000
--- a/tools/telemetry/bin/android/arm64-v8a/run_pie.sha1
+++ /dev/null
@@ -1 +0,0 @@
-30cdda413b6cdaf4646c0522f6032aa17a3ddeb6 \ No newline at end of file
diff --git a/tools/telemetry/bin/android/armeabi-v7a/run_pie.sha1 b/tools/telemetry/bin/android/armeabi-v7a/run_pie.sha1
deleted file mode 100644
index 1811d99..0000000
--- a/tools/telemetry/bin/android/armeabi-v7a/run_pie.sha1
+++ /dev/null
@@ -1 +0,0 @@
-464e2b4b72281b18ef1c312aa8d125e750c6c8b4 \ No newline at end of file
diff --git a/tools/telemetry/telemetry/internal/platform/android_platform_backend.py b/tools/telemetry/telemetry/internal/platform/android_platform_backend.py
index 5c8f333..2d97821 100644
--- a/tools/telemetry/telemetry/internal/platform/android_platform_backend.py
+++ b/tools/telemetry/telemetry/internal/platform/android_platform_backend.py
@@ -71,7 +71,6 @@ def _SetupPrebuiltTools(device):
'memtrack_helper',
'md5sum_dist/md5sum_bin',
'purge_ashmem',
- 'run_pie',
]
host_tools = [