Skip to content

Commit f11749c

Browse files
committed
update cosmo config
1 parent 04e4932 commit f11749c

6 files changed

+69
-17
lines changed

.cargo/config.toml

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
[unstable]
2+
build-std-features = [""]
3+
build-std = ["libc", "panic_abort", "std"]
4+
5+
[profile.dev]
6+
panic = "abort"
7+
opt-level = "s"
8+
9+
[profile.release]
10+
panic = "abort"
11+
opt-level = "s"
12+
113
# On Windows MSVC, statically link the C runtime so that the resulting EXE does
214
# not depend on the vcruntime DLL.
315
#

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ version = "2.33.0"
6161
default-features = false
6262
features = ["suggestions"]
6363

64-
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
64+
[target.'cfg(all(target_env = "dont-compile", target_pointer_width = "64"))'.dependencies.jemallocator]
6565
version = "0.5.0"
6666

6767
[build-dependencies.clap]

aarch64-unknown-linux-cosmo.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"llvm-target": "aarch64-unknown-linux-musl",
3+
"target-pointer-width": "64",
4+
"arch": "aarch64",
5+
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
6+
"os":"linux",
7+
"env": "musl",
8+
"panic-strategy":"abort",
9+
"requires-uwtable":false,
10+
"dynamic-linking": false,
11+
"executables": true,
12+
"exe-suffix": ".com.dbg",
13+
"emit-debug-gdb-scripts":false,
14+
"crt-static-default": true,
15+
"crt-static-respected": false,
16+
"linker-is-gnu":true,
17+
"allows-weak-linkage":true,
18+
"has-rpath": false,
19+
"has-thread-local": false,
20+
"is-builtin": false,
21+
"trap-unreachable":true,
22+
"position-independent-executables": false,
23+
"static-position-independent-executables": false,
24+
"relocation-model": "static",
25+
"disable-redzone":true,
26+
"frame-pointer":"always",
27+
"requires-lto":false,
28+
"eh-frame-header":false,
29+
"no-default-libraries":true,
30+
"max-atomic-width":64,
31+
"linker-flavor":"gcc",
32+
"linker": "./gcc-linker-wrapper.bash",
33+
"late-link-args": {
34+
"gcc": []
35+
},
36+
"pre-link-args": {
37+
"gcc": [
38+
"-static"
39+
]
40+
},
41+
"post-link-args": {
42+
"gcc": [
43+
]
44+
},
45+
"stack-probes": {
46+
"kind": "none"
47+
},
48+
"target-family": [
49+
"unix"
50+
]
51+
}

crates/cli/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ them to the corresponding number of bytes (`2 * 1<<20` in this case). If an
120120
invalid size is found, then a good error message is crafted that typically
121121
tells the user how to fix the problem.
122122
*/
123-
123+
#![feature(rustc_private)]
124124
#![deny(missing_docs)]
125125

126126
mod decompress;

gcc-linker-wrapper.bash

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
#!/bin/bash
22
set -eu
33

4+
COSMO="${COSMO:-/opt/cosmo}"
5+
ARCH="${ARCH:-x86_64}"
6+
47
declare -a args
58
args=()
69
for o in "$@" ; do
710
case $o in
811
"-lunwind") continue;;
9-
"-lutil") continue;;
10-
"-lrt") continue;;
11-
"-lc") continue;;
12-
"-lm") continue;;
13-
"-lpthread") continue;;
14-
"-lgcc") continue;;
1512
"-Wl,-Bdynamic") continue;;
1613
"-Wl,-Bstatic") continue;;
1714
esac
1815
args+=("$o")
1916
done
2017

21-
gcc "${args[@]}"
18+
$COSMO/bin/$ARCH-unknown-cosmo-cc "${args[@]}"

x86_64-unknown-linux-cosmo.json

-8
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,12 @@
3737
"pre-link-args": {
3838
"gcc": [
3939
"-static",
40-
"-nostdinc",
41-
"-nostdlib",
4240
"-pg",
4341
"-mnop-mcount"
4442
]
4543
},
4644
"post-link-args": {
4745
"gcc": [
48-
"-Wl,--gc-sections",
49-
"-fuse-ld=bfd",
50-
"-Wl,-T,./libcosmo/ape.lds",
51-
"./libcosmo/crt.o",
52-
"./libcosmo/ape-no-modify-self.o",
53-
"./libcosmo/cosmopolitan.a"
5446
]
5547
},
5648
"stack-probes": {

0 commit comments

Comments
 (0)