mozjs78: fix cross

This commit is contained in:
Daniel Kolesa 2020-09-18 00:11:10 +02:00
parent 71a8fec0db
commit eca739669e
3 changed files with 78 additions and 4 deletions

View File

@ -0,0 +1,15 @@
Allow us to just set RUST_TARGEt ourselves instead of hacking around in mozilla's
weird custom build system...
diff -upr firefox-68.9.0.orig/build/moz.configure/rust.configure firefox-68.9.0/build/moz.configure/rust.configure
--- firefox-68.9.0.orig/build/moz.configure/rust.configure 2020-06-02 22:54:39.982616128 +0200
+++ firefox-68.9.0/build/moz.configure/rust.configure 2020-06-02 23:08:37.656332899 +0200
@@ -345,7 +345,7 @@ def rust_triple_alias(host_or_target):
return None
- rustc_target = find_candidate(candidates)
+ rustc_target = os.environ['RUST_TARGET']
if rustc_target is None:
die("Don't know how to translate {} for rustc".format(

View File

@ -0,0 +1,58 @@
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -78,9 +78,6 @@
return unwrap
-rustc = unwrap_rustup(rustc, 'rustc')
-cargo = unwrap_rustup(cargo, 'cargo')
-
set_config('CARGO', cargo)
set_config('RUSTC', rustc)
@@ -348,26 +345,6 @@
os.write(in_fd, source)
os.close(in_fd)
-
- cmd = [
- rustc,
- '--crate-type', 'staticlib',
- target_arg,
- '-o', out_path,
- in_path,
- ]
-
- def failed():
- die(dedent('''\
- Cannot compile for {} with {}
- The target may be unsupported, or you may not have
- a rust std library for that target installed. Try:
-
- rustup target add {}
- '''.format(host_or_target.alias, rustc, rustc_target)))
- check_cmd_output(*cmd, onerror=failed)
- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
- failed()
finally:
os.remove(in_path)
os.remove(out_path)
@@ -405,18 +405,6 @@ def rust_triple_alias(host_or_target, host_or_target_c_compiler):
rust_target_triple = rust_triple_alias(target, c_compiler)
rust_host_triple = rust_triple_alias(host, host_c_compiler)
-
-@depends(host, rust_host_triple, rustc_info.host)
-def validate_rust_host_triple(host, rust_host, rustc_host):
- if rust_host != rustc_host:
- if host.alias == rust_host:
- configure_host = host.alias
- else:
- configure_host = '{}/{}'.format(host.alias, rust_host)
- die("The rust compiler host ({}) is not suitable for the configure host ({})."
- .format(rustc_host, configure_host))
-
-
set_config('RUST_TARGET', rust_target_triple)
set_config('RUST_HOST_TARGET', rust_host_triple)

View File

@ -5,6 +5,7 @@ revision=1
wrksrc="firefox-${version}"
build_wrksrc=js/src
build_style=gnu-configure
build_helper=rust
hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive
cargo rust llvm clang which python3"
makedepends="icu-devel libffi-devel nspr-devel python-devel readline-devel
@ -17,7 +18,6 @@ homepage="https://www.mozilla.org/js/"
distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
checksum=965ccfcbb8c0aa97639911997c54be0fcf896fd388b03138952089af675ea918
patch_args="-Np1"
nocross=yes
CXXFLAGS+=" -Wno-class-memaccess"
LDFLAGS+=" -Wl,-z,stack-size=1048576"
@ -37,7 +37,9 @@ do_configure() {
export TARGET_CC="${CC}"
export HOST_CFLAGS="-Os"
export HOST_CXXFLAGS="-Os"
_args+=" --target=$XBPS_CROSS_TRIPLET --enable-linker=bfd"
_args+=" --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
else
_args+=" --target=${XBPS_TRIPLET}"
fi
autoconf-2.13 old-configure.in > old-configure
@ -49,8 +51,7 @@ do_configure() {
--enable-readline --enable-shared-js --enable-system-ffi \
--enable-tests --with-intl-api --with-system-icu --with-system-nspr \
--enable-hardening --enable-release --with-system-zlib \
--target=${XBPS_TRIPLET} --host=${XBPS_TRIPLET} \
${_args}
--host=${XBPS_TRIPLET} ${_args}
}
do_check() {