Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loongarch64 support #1565

Closed
wants to merge 1 commit into from

Conversation

zhaixiaojuan
Copy link
Contributor

No description provided.

Copy link

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LLVM version needs to be bumped to 16 too before we can enable the build. Also, rust-lang/rust#96971 is still not merged yet, let's at least wait for that so we can build anything at all.

@@ -83,6 +83,9 @@
#elif defined(__ARMEL__) || defined(_M_ARM)
#define OPENSSL_32_BIT
#define OPENSSL_ARM
#elif defined(__loongarch64)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#elif defined(__loongarch64)
#elif defined(__loongarch_lp64)

mk/cargo.sh Outdated
@@ -108,6 +108,11 @@ case $target in
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
fi
;;
loongarch64-unknown-linux-gnuf64)
export CC_loongarch64_unknown_linux_gnuf64=clang-$llvm_version
export CC_loongarch64_unknown_linux_gnuf64=llvm-ar-$llvm_version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to become loongarch64-unknown-linux-gnu after loongson/LoongArch-Documentation#80.

@@ -72,6 +72,9 @@ case $target in
--target=i686-unknown-linux-musl|--target=x86_64-unknown-linux-musl)
use_clang=1
;;
--target=loongarch64-unknown-linux-gnuf64)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here.

@zhaixiaojuan zhaixiaojuan changed the title Add loongarch64 support in base.h & mk Add loongarch64 support Apr 20, 2023
@zhaixiaojuan zhaixiaojuan requested a review from xen0n April 20, 2023 04:51
@zhaixiaojuan
Copy link
Contributor Author

RFR, Thanks~

mk/cargo.sh Outdated
loongarch64-unknown-linux-gnu)
export CC_loongarch64_unknown_linux_gnu=clang-$llvm_version
export CC_loongarch64_unknown_linux_gnu=llvm-ar-$llvm_version
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNUF64_LINKER=clang-$llvm_version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNUF64_LINKER=clang-$llvm_version
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=clang-$llvm_version

Copy link

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the only remaining piece is the $llvm_version bump. Ideally that should be done for all arches, so you could do it in a separate PR.

@@ -109,6 +109,11 @@ case $target in
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
fi
;;
loongarch64-unknown-linux-gnu)
export CC_loongarch64_unknown_linux_gnu=clang-$llvm_version
export CC_loongarch64_unknown_linux_gnu=llvm-ar-$llvm_version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export CC_loongarch64_unknown_linux_gnu=llvm-ar-$llvm_version
export AR_loongarch64_unknown_linux_gnu=llvm-ar-$llvm_version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I will create a new PR to do this since I have lost authentication to the current PR repository.

@heiher
Copy link
Contributor

heiher commented Sep 3, 2023

Tracked in new PR: #1632

@briansmith
Copy link
Owner

Tracked in new PR: #1632

Thanks. I am closing this one.

@briansmith briansmith closed this Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants