Skip to content

Commit f8eac82

Browse files
committed
Emit metadata instead of link
It allows us to save a bit of space, ignore the duplicate object files, and the archiving steps; e.g.: 643544 libcompiler_builtins.rlib 64171752 libcore.rlib vs. 530004 libcompiler_builtins.rmeta 63679866 libcore.rmeta We couldn't do it right away in [1] because `rustc` required a fix [2,3]. The fix is now in [4] and available since the 2021-01-21 nightly, so now we can go ahead and make the change. Fixes #75. [1] #52 [2] rust-lang/rust#81117 [3] rust-lang/rust#81118 [4] rust-lang/rust@f9275e1 Suggested-by: bjorn3 Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 780faf2 commit f8eac82

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Diff for: .github/workflows/ci.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
arch: [x86_64, arm64]
1414
toolchain: [gcc, clang, llvm]
1515
config: [debug, release]
16-
rustc: [2021-01-02]
16+
rustc: [2021-01-21]
1717
output: [src] # [src, build]
1818
install: [rustup] # [rustup, standalone]
1919
sysroot: [common] # [common, custom]
@@ -27,23 +27,23 @@ jobs:
2727
- arch: x86_64
2828
toolchain: gcc
2929
config: debug
30-
rustc: 2021-01-09
30+
rustc: 2021-01-21
3131
output: build
3232
install: rustup
3333
sysroot: custom
3434

3535
- arch: arm64
3636
toolchain: clang
3737
config: release
38-
rustc: 2021-01-16
38+
rustc: 2021-01-21
3939
output: build
4040
install: standalone
4141
sysroot: common
4242

4343
- arch: x86_64
4444
toolchain: llvm
4545
config: debug
46-
rustc: 2021-01-19
46+
rustc: 2021-01-21
4747
output: build
4848
install: standalone
4949
sysroot: custom

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*.o
3737
*.o.*
3838
*.patch
39-
*.rlib
39+
*.rmeta
4040
*.s
4141
*.so
4242
*.so.dbg

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
502502
-Werror=return-type -Wno-format-security \
503503
-std=gnu89
504504
KBUILD_CPPFLAGS := -D__KERNEL__
505-
KBUILD_RUSTCFLAGS := --emit=dep-info,obj,link -Zbinary_dep_depinfo=y \
505+
KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata -Zbinary_dep_depinfo=y \
506506
-Cpanic=abort -Cembed-bitcode=n -Clto=n -Crpath=n \
507507
-Cforce-unwind-tables=n -Ccodegen-units=1 \
508508
-Zsymbol-mangling-version=v0
@@ -1874,7 +1874,7 @@ clean: $(clean-dirs)
18741874
$(call cmd,rmfiles)
18751875
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
18761876
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
1877-
-o -name '*.rlib' \
1877+
-o -name '*.rmeta' \
18781878
-o -name '*.ko.*' \
18791879
-o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
18801880
-o -name '*.dwo' -o -name '*.lst' \

Diff for: rust/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $(objtree)/rust/exports_kernel_generated.h: $(objtree)/rust/kernel.o FORCE
6464

6565
quiet_cmd_rustc_procmacro = RUSTC P $@
6666
cmd_rustc_procmacro = \
67-
$(RUSTC) $(rustc_flags) --edition 2018 --extern proc_macro \
67+
$(RUSTC) $(rustc_flags) --emit=dep-info,link --edition 2018 --extern proc_macro \
6868
--crate-type proc-macro --out-dir $(objtree)/rust/ \
6969
--crate-name $(patsubst lib%.so,%,$(notdir $@)) $<; \
7070
mv $(objtree)/rust/$(patsubst lib%.so,%,$(notdir $@)).d $(depfile); \

0 commit comments

Comments
 (0)