Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60e0030e9b
|
+69
-30
@@ -1,3 +1,51 @@
|
|||||||
|
package mrustc-source {
|
||||||
|
description = "patched mrustc source tree";
|
||||||
|
exclude = true;
|
||||||
|
|
||||||
|
version# = "0.12.0";
|
||||||
|
output = remoteGitHub {
|
||||||
|
suffix = "thepowersgang/mrustc";
|
||||||
|
tag = "v"+version;
|
||||||
|
checksum = "Db25OAKL_1yZIF6MlXOTHhrEJ-Pd-i-accVtt5rJollmpKm6B3bgS0xN7hoC1cVu";
|
||||||
|
};
|
||||||
|
chmod = true;
|
||||||
|
patches = [
|
||||||
|
"0001-do-not-download-rustc.patch",
|
||||||
|
"0002-Revert-HIR-Typecheck-Optimise-by-doing-multiple-chec.patch",
|
||||||
|
|
||||||
|
"remove-git-invocations.patch",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
package mrustc {
|
||||||
|
description = "alternative rust compiler (re-implementation)";
|
||||||
|
website = "https://github.com/thepowersgang/mrustc";
|
||||||
|
anitya = 391250;
|
||||||
|
|
||||||
|
source = mrustc-source;
|
||||||
|
enterSource = true;
|
||||||
|
writable = true;
|
||||||
|
|
||||||
|
minimal = true;
|
||||||
|
exec = make {
|
||||||
|
inPlace = true;
|
||||||
|
skipConfigure = true;
|
||||||
|
make = [ "CXX='g++ -w'" ];
|
||||||
|
// test suite runs during rustc-bootstrap
|
||||||
|
skipCheck = true;
|
||||||
|
install = "install -vD bin/mrustc /work/system/bin/mrustc";
|
||||||
|
};
|
||||||
|
|
||||||
|
inputs = [
|
||||||
|
bash,
|
||||||
|
|
||||||
|
// mrustc requires buggy gcc behaviour
|
||||||
|
gcc,
|
||||||
|
];
|
||||||
|
|
||||||
|
runtime = [ gcc ];
|
||||||
|
}
|
||||||
|
|
||||||
package rustc-bootstrap-source {
|
package rustc-bootstrap-source {
|
||||||
description = "rustc source tree used by mrustc";
|
description = "rustc source tree used by mrustc";
|
||||||
exclude = true;
|
exclude = true;
|
||||||
@@ -11,32 +59,20 @@ package rustc-bootstrap-source {
|
|||||||
chmod = true;
|
chmod = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
package mrustc {
|
package rustc-bootstrap {
|
||||||
description = "alternative rust compiler (re-implementation)";
|
description = "rust toolchain bootstrapped via mrustc";
|
||||||
website = "https://github.com/thepowersgang/mrustc";
|
exclude = true;
|
||||||
anitya = 391250;
|
|
||||||
|
|
||||||
version# = "0.12.0";
|
source = mrustc-source;
|
||||||
source = remoteGitHub {
|
|
||||||
suffix = "thepowersgang/mrustc";
|
|
||||||
tag = "v"+version;
|
|
||||||
checksum = "Db25OAKL_1yZIF6MlXOTHhrEJ-Pd-i-accVtt5rJollmpKm6B3bgS0xN7hoC1cVu";
|
|
||||||
};
|
|
||||||
patches = [
|
|
||||||
"0001-do-not-download-rustc.patch",
|
|
||||||
"0002-Revert-HIR-Typecheck-Optimise-by-doing-multiple-chec.patch",
|
|
||||||
];
|
|
||||||
extra = [ rustc-bootstrap-source ];
|
extra = [ rustc-bootstrap-source ];
|
||||||
|
|
||||||
enterSource = true;
|
enterSource = true;
|
||||||
writable = true;
|
writable = true;
|
||||||
chmod = true;
|
|
||||||
|
|
||||||
exec = make {
|
exec = make {
|
||||||
inPlace = true;
|
inPlace = true;
|
||||||
skipConfigure = true;
|
skipConfigure = true;
|
||||||
preMake = `
|
preMake = `
|
||||||
export CC=gcc CXX=g++
|
|
||||||
export PARLEVEL=`+jobsE+`
|
export PARLEVEL=`+jobsE+`
|
||||||
export RUSTC_SOURCE='../extra/rustc-bootstrap-source'
|
export RUSTC_SOURCE='../extra/rustc-bootstrap-source'
|
||||||
export RUSTC_VERSION="$(cut -d ' ' -f 1 "$RUSTC_SOURCE/version")"
|
export RUSTC_VERSION="$(cut -d ' ' -f 1 "$RUSTC_SOURCE/version")"
|
||||||
@@ -44,21 +80,26 @@ export MRUSTC_TARGET_VER="$(cut -d '.' -f 1,2 <<< "$RUSTC_VERSION")"
|
|||||||
export OUTDIR_SUF="-$RUSTC_VERSION"
|
export OUTDIR_SUF="-$RUSTC_VERSION"
|
||||||
patch -d "$RUSTC_SOURCE" -p0 < "rustc-$RUSTC_VERSION-src.patch"
|
patch -d "$RUSTC_SOURCE" -p0 < "rustc-$RUSTC_VERSION-src.patch"
|
||||||
touch "$RUSTC_SOURCE/dl-version"
|
touch "$RUSTC_SOURCE/dl-version"
|
||||||
ln -s "$RUSTC_SOURCE" "rustc-$RUSTC_VERSION-src"
|
|
||||||
|
|
||||||
sed -i 's/\$(shell git show --pretty=%H -s --no-show-signature)/unknown/' Makefile
|
ln -s "$RUSTC_SOURCE" "rustc-$RUSTC_VERSION-src"
|
||||||
sed -i 's/\$(shell git show -s --pretty=%h --no-show-signature)/unknown/' Makefile
|
mkdir bin && ln -s /system/bin/mrustc bin/
|
||||||
sed -i 's/\$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)/v`+version+`/' Makefile
|
|
||||||
sed -i 's/\$(shell git diff-index --quiet HEAD; echo $$?)/0/' Makefile
|
|
||||||
sed -i 's/\$(shell env LC_TIME=C date -u +"%a, %e %b %Y %T +0000")/Thu, 1 Jan 1970 00:00:00 +0000/' Makefile
|
|
||||||
`;
|
`;
|
||||||
preCheck = `
|
make = [
|
||||||
make -f minicargo.mk LIBS
|
"-f",
|
||||||
make local_tests
|
"minicargo.mk",
|
||||||
`;
|
"CC=gcc",
|
||||||
check = [ "test" ];
|
"CXX='g++ -w'",
|
||||||
|
"LIBS",
|
||||||
|
];
|
||||||
|
check = [
|
||||||
|
"CC=gcc",
|
||||||
|
"CXX='g++ -w'",
|
||||||
|
"test",
|
||||||
|
"local_tests",
|
||||||
|
];
|
||||||
|
|
||||||
install = `
|
install = `
|
||||||
|
export CC=gcc CXX=g++
|
||||||
OUTDIR="output-$RUSTC_VERSION"
|
OUTDIR="output-$RUSTC_VERSION"
|
||||||
make -f minicargo.mk "$OUTDIR/rustc"
|
make -f minicargo.mk "$OUTDIR/rustc"
|
||||||
make -f minicargo.mk "$OUTDIR/cargo"
|
make -f minicargo.mk "$OUTDIR/cargo"
|
||||||
@@ -73,9 +114,7 @@ make -C run_rustc
|
|||||||
pkg-config,
|
pkg-config,
|
||||||
perl,
|
perl,
|
||||||
python,
|
python,
|
||||||
|
mrustc,
|
||||||
// mrustc requires buggy gcc behaviour
|
|
||||||
gcc,
|
|
||||||
|
|
||||||
kernel-headers,
|
kernel-headers,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 4317d2c0..415427b4 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -187,7 +187,7 @@ $(OBJDIR)%.o: src/%.cpp
|
||||||
|
$(OBJDIR)version.o: $(OBJDIR)%.o: src/%.cpp $(filter-out $(OBJDIR)version.o,$(OBJ)) Makefile
|
||||||
|
@+mkdir -p $(dir $@)
|
||||||
|
@echo [CXX] -o $@
|
||||||
|
- $V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF $@.dep -D VERSION_GIT_FULLHASH=\"$(shell git show --pretty=%H -s --no-show-signature)\" -D VERSION_GIT_BRANCH="\"$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)\"" -D VERSION_GIT_SHORTHASH=\"$(shell git show -s --pretty=%h --no-show-signature)\" -D VERSION_BUILDTIME="\"$(shell env LC_TIME=C date -u +"%a, %e %b %Y %T +0000")\"" -D VERSION_GIT_ISDIRTY=$(shell git diff-index --quiet HEAD; echo $$?)
|
||||||
|
+ $V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF $@.dep -D VERSION_GIT_FULLHASH=\"unknown\" -D VERSION_GIT_BRANCH="\"v0.12.0\"" -D VERSION_GIT_SHORTHASH=\"unknown\" -D VERSION_BUILDTIME="\"Thu, 1 Jan 1970 00:00:00 +0000\"" -D VERSION_GIT_ISDIRTY=0
|
||||||
|
|
||||||
|
src/main.cpp: $(PCHS:%=src/%.gch)
|
||||||
|
|
||||||
Reference in New Issue
Block a user