Skip to content

Commit 567164a

Browse files
committed
Apply patches.
1 parent 605f946 commit 567164a

File tree

9 files changed

+49
-20
lines changed

9 files changed

+49
-20
lines changed

mozjs/build/moz.configure/android-ndk.configure

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
js_option('--with-android-ndk', nargs=1,
99
help='location where the Android NDK can be found')
1010

11+
js_option('--with-android-ndk-version', nargs=1,
12+
help='android NDK version')
13+
14+
js_option('--with-android-platform', nargs=1,
15+
help='location of the Android platform')
16+
17+
js_option('--with-android-clang', nargs=1,
18+
help='location of the Android clang compiler')
19+
1120
js_option('--with-android-toolchain', nargs=1,
1221
help='location of the Android toolchain')
1322

@@ -63,13 +72,17 @@ set_config('ANDROID_NDK', ndk)
6372
add_old_configure_assignment('android_ndk', ndk)
6473

6574

66-
@depends(ndk)
75+
@depends('--with-android-ndk-version', ndk)
6776
@checking('for android ndk version')
6877
@imports(_from='__builtin__', _import='open')
69-
def ndk_version(ndk):
78+
def ndk_version(value, ndk):
7079
if not ndk:
7180
# Building 'js/src' for non-Android.
7281
return
82+
83+
if value:
84+
return value[0]
85+
7386
with open(os.path.join(ndk, 'source.properties'), 'r') as f:
7487
for line in f:
7588
if not line.startswith('Pkg.Revision'):
@@ -109,13 +122,16 @@ def ndk_minor_version(ndk_version):
109122
set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version)
110123

111124

112-
@depends(target, android_version, ndk)
125+
@depends('--with-android-platform', target, android_version, ndk)
113126
@checking('for android platform directory')
114127
@imports(_from='os.path', _import='isdir')
115-
def android_platform(target, android_version, ndk):
128+
def android_platform(value, target, android_version, ndk):
116129
if target.os != 'Android':
117130
return
118131

132+
if value:
133+
return value[0]
134+
119135
if 'aarch64' == target.cpu:
120136
target_dir_name = 'arm64'
121137
else:
@@ -252,7 +268,7 @@ js_option(env='STLPORT_CPPFLAGS',
252268
@imports(_from='os.path', _import='isdir')
253269
def stlport_cppflags(value, ndk):
254270
if value and len(value):
255-
return value.split()
271+
return value[0].split()
256272
if not ndk:
257273
return
258274

@@ -296,6 +312,8 @@ def extra_toolchain_flags(android_system, android_sysroot, toolchain_dir,
296312
android_system,
297313
'-isystem',
298314
os.path.join(android_sysroot, 'usr', 'include'),
315+
'--sysroot',
316+
android_sysroot,
299317
'-gcc-toolchain',
300318
toolchain_dir,
301319
'-D__ANDROID_API__=%d' % android_version]
@@ -332,13 +350,16 @@ def bindgen_cflags_android(toolchain_flags, toolchain, toolchain_prefix):
332350
]
333351

334352

335-
@depends(host, ndk)
353+
@depends('--with-android-clang', host, ndk)
336354
@imports(_from='os.path', _import='exists')
337355
@imports(_from='os.path', _import='isdir')
338-
def android_clang_compiler(host, ndk):
356+
def android_clang_compiler(value, host, ndk):
339357
if not ndk:
340358
return
341359

360+
if value:
361+
return value[0]
362+
342363
llvm_format = '%s/toolchains/llvm/prebuilt/%s-%s/bin'
343364
llvm_path = llvm_format % (ndk, host.kernel.lower(), host.cpu)
344365
if not isdir(llvm_path) and host.cpu == 'x86_64':

mozjs/build/moz.configure/toolchain.configure

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,8 +1298,14 @@ set_config('COLOR_CFLAGS', color_cflags)
12981298
# hidden visibility.
12991299

13001300

1301-
@depends(c_compiler, target)
1302-
def libcxx_override_visibility(c_compiler, target):
1301+
option(env='_LIBCPP_INLINE_VISIBILITY',
1302+
nargs=1,
1303+
help='Visibility of libc++ inlines')
1304+
1305+
@depends('_LIBCPP_INLINE_VISIBILITY', c_compiler, target)
1306+
def libcxx_override_visibility(value, c_compiler, target):
1307+
if len(value):
1308+
return value[0]
13031309
if c_compiler.type == 'clang' and target.os == 'Android':
13041310
return ''
13051311

mozjs/config/external/nspr/moz.build

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ if CONFIG['MOZ_BUILD_NSPR']:
1818
'nss',
1919
]
2020
else:
21-
USE_LIBS += [
22-
'nspr4',
23-
'plc4',
24-
'plds4',
25-
]
21+
#USE_LIBS += [
22+
# 'nspr4',
23+
# 'plc4',
24+
# 'plds4',
25+
#]
26+
pass
2627
EXPORTS.nspr += ['prcpucfg.h']
2728
else:
2829
OS_LIBS += CONFIG['NSPR_LIBS']

mozjs/config/system-headers.mozbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ system_headers = [
10481048
'zmouse.h',
10491049
]
10501050

1051-
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
1051+
if CONFIG['OS_TARGET'] == 'Android':
10521052
system_headers += [
10531053
'android/api-level.h',
10541054
'android/ashmem.h',

mozjs/js/src/build/moz.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if CONFIG['JS_SHARED_LIBRARY']:
3838
SYMBOLS_FILE = '!symverscript'
3939
else:
4040
Library('js')
41+
USE_LIBS += ['mozglue']
4142

4243
FORCE_STATIC_LIB = True
4344
STATIC_LIBRARY_NAME = 'js_static'

mozjs/mfbt/GuardObjects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class GuardObjectNotifier {
9696
}
9797
};
9898

99-
class GuardObjectNotificationReceiver {
99+
class alignas(8) GuardObjectNotificationReceiver {
100100
private:
101101
bool mStatementDone;
102102

mozjs/moz.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,6 @@ if CONFIG['MOZ_BUILD_APP']:
137137
else:
138138
include('/toolkit/toolkit.mozbuild')
139139

140-
CONFIGURE_SUBST_FILES += ['.cargo/config']
140+
#CONFIGURE_SUBST_FILES += ['.cargo/config']
141141

142142
include('build/templates.mozbuild')

mozjs/mozglue/build/BionicGlue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#define NS_EXPORT __attribute__((visibility("default")))
1919

20-
#if ANDROID_VERSION < 17 || defined(MOZ_WIDGET_ANDROID)
20+
#if __ANDROID_API__ < 17 || defined(MOZ_WIDGET_ANDROID)
2121
/* Android doesn't have pthread_atfork(), so we need to use our own. */
2222
struct AtForkFuncs {
2323
void (*prepare)(void);
@@ -65,7 +65,7 @@ struct SpecialAllocator : public std::allocator<T> {
6565
static std::vector<AtForkFuncs, SpecialAllocator<AtForkFuncs> > atfork;
6666
#endif
6767

68-
#if ANDROID_VERSION < 17 || defined(MOZ_WIDGET_ANDROID)
68+
#if __ANDROID_API__ < 17 || defined(MOZ_WIDGET_ANDROID)
6969
extern "C" NS_EXPORT int pthread_atfork(void (*prepare)(void),
7070
void (*parent)(void),
7171
void (*child)(void)) {

mozjs/python/mozbuild/mozbuild/frontend/emitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ def emit_from_context(self, context):
11421142
generated_files.add(str(sub.relpath))
11431143
yield sub
11441144

1145-
for defines_var, cls, backend_flags in (('DEFINES', Defines, (computed_flags, computed_as_flags)),
1145+
for defines_var, cls, backend_flags in (('DEFINES', Defines, (computed_flags,)),
11461146
('HOST_DEFINES', HostDefines, (computed_host_flags,))):
11471147
defines = context.get(defines_var)
11481148
if defines:

0 commit comments

Comments
 (0)