fix compile for rv64

master
WangRunji 6 years ago
parent 047f4ffdcc
commit 238de1b282

@ -54,7 +54,7 @@ fi
fi fi
# if some crates are not exist, build for riscv32 first # if some crates are not exist, build for riscv32 first
if ! [[ -f $CARGO_PATH/git/checkouts/bit-vec-437fa4a002bd318d/9861a58/src/lib.rs ]] if ! [[ -f $CARGO_PATH/git/checkouts/bit-vec-437fa4a002bd318d/9861a58/src/lib.rs ]] || ! [[ -z ${TRAVIS_OS_NAME} ]]
then then
make kernel arch=riscv32 board=none make kernel arch=riscv32 board=none
fi fi
@ -95,14 +95,7 @@ fi
CNAME=compiler_builtins CNAME=compiler_builtins
if ! [[ -f ${OUTDIR}/${CNAME}.o ]] if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then then
if [[ -d $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5 ]]
if [[ -d $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.3 ]]
then
COMPILER_BUILTINS_PATH=$CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.3
elif [[ -d $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.4 ]]
then
COMPILER_BUILTINS_PATH=$CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.4
elif [[ -d $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5 ]]
then then
COMPILER_BUILTINS_PATH=$CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5 COMPILER_BUILTINS_PATH=$CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5
else else
@ -261,14 +254,16 @@ rustc --crate-name bitflags $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823
gen_full_rlib gen_full_rlib
fi fi
CNAME=volatile CNAME=managed
if ! [[ -f ${OUTDIR}/${CNAME}.o ]] if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then then
rustc --crate-name volatile $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/volatile-0.2.5/src/lib.rs \ rustc --crate-name managed $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/managed-0.7.1/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \ --color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \ -C opt-level=1 \
-C debuginfo=2 \ -C debuginfo=2 \
-C debug-assertions=on \ -C debug-assertions=on \
--cfg 'feature="alloc"' \
--cfg 'feature="map"' \
--out-dir ${OUTDIR} \ --out-dir ${OUTDIR} \
--target $TARGET_JSON \ --target $TARGET_JSON \
-L ${OUTDIR} \ -L ${OUTDIR} \
@ -276,10 +271,10 @@ rustc --crate-name volatile $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823
gen_full_rlib gen_full_rlib
fi fi
CNAME=once CNAME=device_tree
if ! [[ -f ${OUTDIR}/${CNAME}.o ]] if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then then
rustc --crate-name once $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/once-0.3.3/src/lib.rs \ rustc --crate-name device_tree $CARGO_PATH/git/checkouts/device_tree-rs-7c4f9e86f346d07b/1bd9b4d*/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \ --color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \ -C opt-level=1 \
-C debuginfo=2 \ -C debuginfo=2 \
@ -291,17 +286,18 @@ rustc --crate-name once $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/onc
gen_full_rlib gen_full_rlib
fi fi
CNAME=bbl CNAME=byteorder
if ! [[ -f ${OUTDIR}/${CNAME}.o ]] if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then then
rustc --crate-name bbl $PWD/../crate/bbl/src/lib.rs \ rustc --crate-name byteorder $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/byteorder-1.3.1/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \ --color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \ -C opt-level=1 \
-C debuginfo=2 \ -C debuginfo=2 \
-C debug-assertions=on \ -C debug-assertions=on \
--out-dir ${OUTDIR} \ --out-dir ${OUTDIR} \
--target $TARGET_JSON \ --target $TARGET_JSON \
-L ${OUTDIR} -L ${OUTDIR} \
--cap-lints allow
gen_full_rlib gen_full_rlib
fi fi
@ -320,6 +316,77 @@ rustc --crate-name log $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/log-
gen_full_rlib gen_full_rlib
fi fi
CNAME=smoltcp
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name smoltcp $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.5.0/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="alloc"' \
--cfg 'feature="log"' \
--cfg 'feature="managed"' \
--cfg 'feature="proto-igmp"' \
--cfg 'feature="proto-ipv4"' \
--cfg 'feature="socket-icmp"' \
--cfg 'feature="socket-tcp"' \
--cfg 'feature="socket-udp"' \
--extern bitflags=${OUTDIR}/libbitflags.rlib \
--extern byteorder=${OUTDIR}/libbyteorder.rlib \
--extern log=${OUTDIR}/liblog.rlib \
--extern managed=${OUTDIR}/libmanaged.rlib \
--out-dir ${OUTDIR} \
--target $TARGET_JSON \
-L ${OUTDIR} \
--cap-lints allow
gen_full_rlib
fi
CNAME=volatile
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name volatile $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/volatile-0.2.5/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir ${OUTDIR} \
--target $TARGET_JSON \
-L ${OUTDIR} \
--cap-lints allow
gen_full_rlib
fi
CNAME=once
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name once $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/once-0.3.3/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir ${OUTDIR} \
--target $TARGET_JSON \
-L ${OUTDIR} \
--cap-lints allow
gen_full_rlib
fi
CNAME=bbl
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name bbl $PWD/../crate/bbl/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir ${OUTDIR} \
--target $TARGET_JSON \
-L ${OUTDIR}
gen_full_rlib
fi
CNAME=linked_list_allocator CNAME=linked_list_allocator
if ! [[ -f ${OUTDIR}/${CNAME}.o ]] if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then then
@ -565,6 +632,8 @@ rustc --edition=2018 --crate-name rcore src/lib.rs \
--extern rcore_process=${OUTDIR}/librcore_process.rlib \ --extern rcore_process=${OUTDIR}/librcore_process.rlib \
--extern volatile=${OUTDIR}/libvolatile.rlib \ --extern volatile=${OUTDIR}/libvolatile.rlib \
--extern xmas_elf=${OUTDIR}/libxmas_elf.rlib \ --extern xmas_elf=${OUTDIR}/libxmas_elf.rlib \
--extern device_tree=${OUTDIR}/libdevice_tree.rlib \
--extern smoltcp=${OUTDIR}/libsmoltcp.rlib \
-L native=${OUTDIR} -l static=sfsimg -l static=atomic_rt -L native=${OUTDIR} -l static=sfsimg -l static=atomic_rt
gen_full_rlib gen_full_rlib
@ -600,5 +669,7 @@ rustc --edition=2018 --crate-name rcore src/main.rs \
--extern rcore_process=${OUTDIR}/librcore_process.rlib \ --extern rcore_process=${OUTDIR}/librcore_process.rlib \
--extern volatile=${OUTDIR}/libvolatile.rlib \ --extern volatile=${OUTDIR}/libvolatile.rlib \
--extern xmas_elf=${OUTDIR}/libxmas_elf.rlib \ --extern xmas_elf=${OUTDIR}/libxmas_elf.rlib \
--extern device_tree=${OUTDIR}/libdevice_tree.rlib \
--extern smoltcp=${OUTDIR}/libsmoltcp.rlib \
-L native=${OUTDIR} ${LINK_K210} -L native=${OUTDIR} ${LINK_K210}
#fi #fi

Loading…
Cancel
Save