1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 16:16:16 +04:00

fix compile for rv64

This commit is contained in:
WangRunji 2019-01-24 00:08:25 +08:00
parent 047f4ffdcc
commit 238de1b282

View File

@ -54,7 +54,7 @@ fi
fi
# 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
make kernel arch=riscv32 board=none
fi
@ -95,14 +95,7 @@ fi
CNAME=compiler_builtins
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
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 ]]
if [[ -d $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5 ]]
then
COMPILER_BUILTINS_PATH=$CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.5
else
@ -261,6 +254,95 @@ rustc --crate-name bitflags $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823
gen_full_rlib
fi
CNAME=managed
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
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 \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="alloc"' \
--cfg 'feature="map"' \
--out-dir ${OUTDIR} \
--target $TARGET_JSON \
-L ${OUTDIR} \
--cap-lints allow
gen_full_rlib
fi
CNAME=device_tree
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
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 \
-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=byteorder
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
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 \
-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=log
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name log $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/log-0.4.6/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=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
@ -305,21 +387,6 @@ rustc --crate-name bbl $PWD/../crate/bbl/src/lib.rs \
gen_full_rlib
fi
CNAME=log
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
rustc --crate-name log $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/log-0.4.6/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=linked_list_allocator
if ! [[ -f ${OUTDIR}/${CNAME}.o ]]
then
@ -565,6 +632,8 @@ rustc --edition=2018 --crate-name rcore src/lib.rs \
--extern rcore_process=${OUTDIR}/librcore_process.rlib \
--extern volatile=${OUTDIR}/libvolatile.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
gen_full_rlib
@ -600,5 +669,7 @@ rustc --edition=2018 --crate-name rcore src/main.rs \
--extern rcore_process=${OUTDIR}/librcore_process.rlib \
--extern volatile=${OUTDIR}/libvolatile.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}
#fi