diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 967d3d35..6618b5fb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,34 +3,13 @@ // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ - { - "label": "build-release-amd64-win-submit", - "type": "shell", - "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd > ./target/x86_64-pc-windows-msvc/release/loader.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.c", - "problemMatcher": [ - "$rustc" - ], - }, - { - "label": "build-release-amd64-win-rs-submit", - "type": "shell", - "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd > ./target/x86_64-pc-windows-msvc/release/loader.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.rs", - "problemMatcher": [ - "$rustc" - ], - }, - { - "label": "build-release-amd64-win-fn-impl-submit", - "type": "shell", - "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-fn-impl.cmd > ./target/x86_64-pc-windows-msvc/release/loader.cpp; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.cpp", - "problemMatcher": [ - "$rustc" - ], - }, { "label": "build-release-amd64-submit", "type": "shell", "command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-64bit.sh > ./target/x86_64-unknown-linux-gnu/release/loader.c; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.c", + "windows": { + "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd > ./target/x86_64-pc-windows-msvc/release/loader.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.c", + }, "problemMatcher": [ "$rustc" ], @@ -39,6 +18,9 @@ "label": "build-release-amd64-short-submit", "type": "shell", "command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.c; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.c", + "windows": { + "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd --features short > ./target/x86_64-pc-windows-msvc/release/loader_short.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader_short.c", + }, "problemMatcher": [ "$rustc" ], @@ -47,6 +29,9 @@ "label": "build-release-amd64-rs-submit", "type": "shell", "command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-rs.sh > ./target/x86_64-unknown-linux-gnu/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.rs", + "windows": { + "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd > ./target/x86_64-pc-windows-msvc/release/loader.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.rs", + }, "problemMatcher": [ "$rustc" ], @@ -54,7 +39,9 @@ { "label": "build-release-amd64-rs-short-submit", "type": "shell", - "command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release-rs.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.rs", + "command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release-rs.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.rs", "windows": { + "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd --features short > ./target/x86_64-pc-windows-msvc/release/loader.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.rs", + }, "problemMatcher": [ "$rustc" ], @@ -63,6 +50,9 @@ "label": "build-release-amd64-fn-impl-submit", "type": "shell", "command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-64bit-fn-impl.sh > ./target/x86_64-unknown-linux-gnu/release/loader.cpp; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.cpp", + "windows": { + "command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-fn-impl.cmd > ./target/x86_64-pc-windows-msvc/release/loader.cpp; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.cpp", + }, "problemMatcher": [ "$rustc" ], @@ -71,6 +61,9 @@ "label": "build-release-i686-submit", "type": "shell", "command": "mkdir -p ./target/i686-unknown-linux-gnu/release; ./release-32bit.sh > ./target/i686-unknown-linux-gnu/release/loader.c; code --reuse-window ./target/i686-unknown-linux-gnu/release/loader.c", + "windows": { + "command": "echo 'i686 build is only supported on Linux.'" + }, "problemMatcher": [ "$rustc" ], @@ -79,14 +72,9 @@ "label": "build-release-wasm32-submit", "type": "shell", "command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.sh > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js", - "problemMatcher": [ - "$rustc" - ], - }, - { - "label": "build-release-wasm32-win-submit", - "type": "shell", - "command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.cmd > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js", + "windows": { + "command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.cmd > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js", + }, "problemMatcher": [ "$rustc" ], diff --git a/scripts/static-pie.py b/scripts/static-pie.py index 38e0fb7d..e93d60cb 100644 --- a/scripts/static-pie.py +++ b/scripts/static-pie.py @@ -59,11 +59,17 @@ def main(args): elif target in ["x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu"]: stub = "static-pie-stub-amd64.bin" if lang == "C": - template = "static-pie-template-amd64.c" + if short: + template = "static-pie-template-amd64-short.c" + else: + template = "static-pie-template-amd64.c" elif lang == "CFnImpl": template = "static-pie-template-amd64-fn-impl.cpp" elif lang == "Rust": - template = "static-pie-template-amd64.rs" + if short: + template = "static-pie-template-amd64-short.rs" + else: + template = "static-pie-template-amd64.rs" else: print(f"Language ${lang} is not supported for target ${target}", file=sys.stderr) exit()