mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-08 17:39:24 +00:00
mozjs: Drop using JS_VOLATILE_ARM
JS_VOLATILE_ARM was a workaround for a gcc 4.7 bug on B2G where it would generate unaligned word accesses that should have been individual byte accesses. firefox now a days require at least gcc 6.1+ (and ARM systems support unaligned accesses). see [1] in gcc11 volatile wont be accepted as argument qualifier in functions, hence the build breaks, this patch unbreaks it [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1495731 Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
+111
@@ -0,0 +1,111 @@
|
||||
# HG changeset patch
|
||||
# User Lars T Hansen <lhansen@mozilla.com>
|
||||
# Date 1538489772 -7200
|
||||
# Node ID bb430eaf5521aa8ab233a45b585ff9e5dfecf4c9
|
||||
# Parent e87d7028568e721e8d297ce62f9622e74d29bb37
|
||||
Bug 1495731 - remove JS_VOLATILE_ARM, it is no longer relevant. r=waldo
|
||||
|
||||
JS_VOLATILE_ARM was a workaround for a gcc 4.7 bug on B2G where it
|
||||
would generate unaligned word accesses that should have been
|
||||
individual byte accesses. We now require at least gcc 6.1 (and ARM
|
||||
systems support unaligned accesses).
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Upstream-Status: Backport [https://hg.mozilla.org/integration/mozilla-inbound/rev/bb430eaf5521]
|
||||
|
||||
--- a/js/src/vm/TypedArrayObject-inl.h
|
||||
+++ b/js/src/vm/TypedArrayObject-inl.h
|
||||
@@ -259,68 +259,61 @@ class ElementSpecific {
|
||||
return true;
|
||||
}
|
||||
|
||||
- // Inhibit unaligned accesses on ARM (bug 1097253, a compiler bug).
|
||||
-#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__)
|
||||
-#define JS_VOLATILE_ARM volatile
|
||||
-#else
|
||||
-#define JS_VOLATILE_ARM
|
||||
-#endif
|
||||
-
|
||||
SharedMem<void*> data = Ops::extract(source);
|
||||
switch (source->type()) {
|
||||
case Scalar::Int8: {
|
||||
- SharedMem<JS_VOLATILE_ARM int8_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM int8_t*>();
|
||||
+ SharedMem<int8_t*> src =
|
||||
+ data.cast<int8_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Uint8:
|
||||
case Scalar::Uint8Clamped: {
|
||||
- SharedMem<JS_VOLATILE_ARM uint8_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM uint8_t*>();
|
||||
+ SharedMem<uint8_t*> src =
|
||||
+ data.cast<uint8_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Int16: {
|
||||
- SharedMem<JS_VOLATILE_ARM int16_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM int16_t*>();
|
||||
+ SharedMem<int16_t*> src =
|
||||
+ data.cast<int16_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Uint16: {
|
||||
- SharedMem<JS_VOLATILE_ARM uint16_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM uint16_t*>();
|
||||
+ SharedMem<uint16_t*> src =
|
||||
+ data.cast<uint16_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Int32: {
|
||||
- SharedMem<JS_VOLATILE_ARM int32_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM int32_t*>();
|
||||
+ SharedMem<int32_t*> src =
|
||||
+ data.cast<int32_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Uint32: {
|
||||
- SharedMem<JS_VOLATILE_ARM uint32_t*> src =
|
||||
- data.cast<JS_VOLATILE_ARM uint32_t*>();
|
||||
+ SharedMem<uint32_t*> src =
|
||||
+ data.cast<uint32_t*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Float32: {
|
||||
- SharedMem<JS_VOLATILE_ARM float*> src =
|
||||
- data.cast<JS_VOLATILE_ARM float*>();
|
||||
+ SharedMem<float*> src =
|
||||
+ data.cast<float*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
}
|
||||
case Scalar::Float64: {
|
||||
- SharedMem<JS_VOLATILE_ARM double*> src =
|
||||
- data.cast<JS_VOLATILE_ARM double*>();
|
||||
+ SharedMem<double*> src =
|
||||
+ data.cast<double*>();
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
|
||||
break;
|
||||
@@ -329,8 +322,6 @@ class ElementSpecific {
|
||||
MOZ_CRASH("setFromTypedArray with a typed array with bogus type");
|
||||
}
|
||||
|
||||
-#undef JS_VOLATILE_ARM
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ SRC_URI = " \
|
||||
file://0011-To-fix-build-error-on-arm32BE.patch \
|
||||
file://0012-JS_PUBLIC_API.patch \
|
||||
file://0013-riscv-Disable-atomic-operations.patch \
|
||||
file://0014-remove-JS_VOLATIME_ARM.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " \
|
||||
file://musl/0001-support-musl.patch \
|
||||
|
||||
Reference in New Issue
Block a user