Bug 1425381 - Always enable PIE on Android now that we support only >= 4.1. r=froydnj

--HG--
extra : rebase_source : c73d77ab1274b2dd54a3785a6d77c6e8dcb69f87
This commit is contained in:
Mike Hommey 2018-01-11 10:42:15 +09:00
parent f1c9a5da78
commit bb2afff5c1
8 changed files with 8 additions and 34 deletions

View File

@ -198,10 +198,14 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
fi
fi
# bionic in Android < 4.1 doesn't support PIE
# On OSX, the linker defaults to building PIE programs when targeting OSX 10.7.
# On other Unix systems, some file managers (Nautilus) can't start PIE programs
MOZ_PIE=
if test "$OS_TARGET" = Android; then
# bionic in Android >= 4.1 supports PIE, and we target those versions.
MOZ_PIE=1
else
MOZ_PIE=
fi
MOZ_ARG_ENABLE_BOOL(pie,
[ --enable-pie Enable Position Independent Executables],

View File

@ -4,15 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Any changes that affect Android need to be made in pie/moz.build as well.
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
Program(CONFIG['MOZ_CHILD_PROCESS_NAME'])
SOURCES += [
'MozillaRuntimeMainAndroid.cpp',
]
DIRS += ['pie']
else:
GeckoProgram(CONFIG['MOZ_CHILD_PROCESS_NAME'], linkage='dependent')

View File

@ -1,19 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Program(CONFIG['MOZ_CHILD_PROCESS_NAME_PIE'])
SOURCES += [
'../MozillaRuntimeMainAndroid.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
LOCAL_INCLUDES += [
'/toolkit/xre',
'/xpcom/base',
]
LDFLAGS += ['-pie']

View File

@ -219,8 +219,8 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
for var in ('MOZ_CHILD_PROCESS_NAME', 'MOZ_CHILD_PROCESS_NAME_PIE',
'MOZ_CHILD_PROCESS_BUNDLE', 'DLL_PREFIX', 'DLL_SUFFIX'):
for var in ('MOZ_CHILD_PROCESS_NAME', 'MOZ_CHILD_PROCESS_BUNDLE',
'DLL_PREFIX', 'DLL_SUFFIX'):
DEFINES[var] = '"%s"' % CONFIG[var]
if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':

View File

@ -50,9 +50,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'xul.dll',
]
if CONFIG['OS_TARGET'] == 'Android':
LDFLAGS += ['-pie']
CFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
OS_LIBS += CONFIG['TK_LIBS']

View File

@ -27,7 +27,6 @@ DEFINES += \
-DPREF_DIR=$(PREF_DIR) \
-DJAREXT= \
-DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) \
-DMOZ_CHILD_PROCESS_NAME_PIE=$(MOZ_CHILD_PROCESS_NAME_PIE) \
-DANDROID_CPU_ARCH=$(ANDROID_CPU_ARCH) \
$(NULL)

View File

@ -74,7 +74,6 @@
@BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
# This should be MOZ_CHILD_PROCESS_NAME, but that has a "lib/" prefix.
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
@BINPATH@/@MOZ_CHILD_PROCESS_NAME_PIE@
#ifdef MOZ_ANDROID_GOOGLE_VR
@BINPATH@/@DLL_PREFIX@gvr@DLL_SUFFIX@

View File

@ -4431,8 +4431,6 @@ else
# because the unpacked file will be under the lib/ subdirectory and will
# need to be executed from that path.
MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
MOZ_CHILD_PROCESS_NAME_PIE="libplugin-container-pie.so"
AC_SUBST(MOZ_CHILD_PROCESS_NAME_PIE)
fi
MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_DISPLAYNAME}CP"