diff --git a/golang.spec b/golang.spec index 6f936752bb1459dd809c9d33049d000702251070..350b0aedb4000622dc22f515e26ff4214ec63539 100644 --- a/golang.spec +++ b/golang.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 %undefine _missing_build_ids_terminate_build %global bcond_with strict_fips @@ -30,20 +30,20 @@ # Define GOROOT macros %global goroot %{_prefix}/lib/%{name} %global gopath %{_datadir}/gocode -%global golang_arches x86_64 aarch64 ppc64le s390x +%global golang_arches x86_64 aarch64 ppc64le s390x loongarch64 %global golibdir %{_libdir}/%{name} # Golang build options. # Build golang using external/internal(close to cgo disabled) linking. -%ifarch x86_64 ppc64le %{arm} aarch64 s390x +%ifarch x86_64 ppc64le %{arm} aarch64 s390x loongarch64 %global external_linker 1 %else %global external_linker 0 %endif # Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%ifarch x86_64 ppc64le %{arm} aarch64 s390x +%ifarch x86_64 ppc64le %{arm} aarch64 s390x loongarch64 %global cgo_enabled 1 %else %global cgo_enabled 0 @@ -57,7 +57,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch x86_64 %{arm} aarch64 ppc64le s390x +%ifarch x86_64 %{arm} aarch64 ppc64le s390x loongarch64 %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -91,6 +91,9 @@ %ifarch s390x %global gohostarch s390x %endif +%ifarch loongarch64 +%global gohostarch loong64 +%endif %global go_api 1.20 %global version 1.20.10 @@ -115,6 +118,9 @@ Source1: https://github.com/golang-fips/go/archive/refs/tags/go%{version}- # make possible to override default traceback level at build time by setting build tag rpm_crashtraceback Source2: fedora.go +Source3: loongarch64.tar.gz +Source4: loongarch64.patches + # The compiler is written in Go. Needs go(1.4+) compiler for build. # Actual Go based bootstrap compiler provided by above source. %if !%{golang_bootstrap} @@ -252,6 +258,15 @@ ln -s ../go-go%{version} go ./scripts/configure-crypto-tests.sh popd +## Apply loongarch64 patches +tar xf %{SOURCE3} +for p in $(cat %{SOURCE4}); do + patch -p1 -s -i loongarch64/$p +done + +## Delete loongarch64 directory +rm -rf loongarch64 + %patch2 -p1 %patch3 -p1 @@ -521,6 +536,9 @@ cd .. %endif %changelog +* Wed Jan 10 2024 Meidan Li - 1.20.10-1.0.2 +- Add LoongArch64 support. + * Thu Dec 14 2023 Chang Gao - 1.20.10-1.0.1 - disable DISABLE_BoringCertAlgs_TEST test diff --git a/loongarch64.patches b/loongarch64.patches new file mode 100644 index 0000000000000000000000000000000000000000..36d30363f32c7136ae3bfa795398facb2f689fe7 --- /dev/null +++ b/loongarch64.patches @@ -0,0 +1,97 @@ +0001-oldabi-fix-misc-cgo-test-sigaltstack-size-on-loong64.patch +0002-oldabi-fix-mabi-to-lp64-for-loong64.patch +0003-oldabi-fix-runtime-defs_linux_loong64.patch +0004-oldabi-fix-test-issue11656-for-loong64.patch +0005-oldabi-fixup-stack-growth-after-fork-in-runtime.sigf.patch +0006-cmd-asm-add-RDTIME-L-H-.W-RDTIME.D-support-for-loong.patch +0007-runtime-implement-cputicks-with-the-stable-counter-o.patch +0008-runtime-remove-the-fake-mstart-caller-in-systemstack.patch +0009-cmd-internal-obj-loong64-save-LR-after-decrementing-.patch +0010-runtime-refactor-the-linux-loong64-entrypoint.patch +0011-cmd-internal-obj-loong64-remove-invalid-branch-delay.patch +0012-runtime-calculate-nanoseconds-in-usleep-on-linux-loo.patch +0013-cmd-internal-obj-remove-redundant-cnames-on-loong64.patch +0014-runtime-save-fetch-g-register-during-VDSO-on-loong64.patch +0015-runtime-save-restore-callee-saved-registers-in-loong.patch +0016-runtime-add-comment-for-sys_linux_loong64.patch +0017-runtime-mark-morestack_noctxt-SPWRITE-for-linux-loon.patch +0018-cmd-internal-obj-loong64-add-the-PCALAU12I-instructi.patch +0019-runtime-add-support-for-buildmode-c-shared-on-loong6.patch +0020-cmd-compile-add-support-for-buildmode-c-shared-on-lo.patch +0021-cmd-internal-obj-loong64-cmd-internal-objabi-add-c-s.patch +0022-cmd-link-add-support-for-buildmode-c-shared-on-loong.patch +0023-cmd-internal-sys-enable-c-shared-feature-on-loong64.patch +0024-cmd-dist-misc-cgo-testcshared-enable-c-shared-test-o.patch +0025-cmd-compile-cmd-link-cmd-internal-runtime-support-bu.patch +0026-cmd-link-cmd-internal-runtime-support-buildmode-plug.patch +0027-cmd-asm-link-loong64-Implement-the-IE-model-to-acces.patch +0028-cmd-compile-cmd-dist-cmd-go-enable-pie-buildmode-for.patch +0029-cmd-internal-runtime-enable-memory-sanitizer-on-loon.patch +0030-enable-test-for-msan.patch +0031-cmd-internal-runtime-enable-address-sanitizer-on-loo.patch +0032-enable-test-for-asan.patch +0033-enable-test-for-buildmode-share-plugin.patch +0034-net-disable-TestLookupDotsWithRemoteSource-and-TestL.patch +0035-enable-c-archive-test-on-linux-loong64.patch +0036-runtime-no-need-to-save-these-registers-in-load_g-sa.patch +0037-cmd-internal-obj-loong64-add-support-for-movgr2cf-an.patch +0038-runtime-save-and-restore-fcc-registers-in-async-pree.patch +0039-cmd-cmd-vendor-pick-up-updates-for-golang.org-x-arch.patch +0040-cmd-internal-objfile-add-loong64-disassembler-suppor.patch +0041-cmd-compile-disable-address-folding-for-globals-for-.patch +0042-runtime-remove-the-meaningless-offset-of-8-for-duffz.patch +0043-cmd-compiler-remove-the-meaningless-offset-of-8-for-.patch +0044-cmd-compile-internal-runtime-use-NOOP-for-hardware-N.patch +0045-cmd-link-internal-loong64-use-BREAK-0-as-the-code-pa.patch +0046-cmd-asm-runtime-remove-the-RSB-register-from-loong64.patch +0047-cmd-internal-obj-loong64-realize-all-unconditional-j.patch +0048-cmd-internal-obj-loong64-clean-up-code-for-short-con.patch +0049-cmd-internal-obj-loong64-assemble-BEQ-BNEs-comparing.patch +0050-cmd-internal-obj-loong64-remove-Optab.family-and-reo.patch +0051-cmd-asm-support-the-PCALIGN-directive-on-loong64.patch +0052-internal-bytealg-runtime-align-some-loong64-asm-loop.patch +0053-cmd-link-bump-loong64-function-alignment-to-16-bytes.patch +0054-cmd-compile-optimize-multiplication-on-loong64.patch +0055-cmd-compile-split-DIVV-DIVVU-op-on-loong64.patch +0056-cmd-internal-obj-loong64-auto-align-loop-heads-to-16.patch +0057-cmd-internal-obj-loong64-add-atomic-memory-access-in.patch +0058-cmd-compiler-runtime-internal-atomic-optimize-xchg-a.patch +0059-cmd-compiler-runtime-internal-atomic-optimize-xadd-a.patch +0060-cmd-compiler-runtime-internal-atomic-optimize-And-32.patch +0061-syscall-implement-Ptrace-Set-Get-Regs-using-PTRACE_-.patch +0062-cmd-internal-obj-loong64-remove-the-invalid-plan9-fo.patch +0063-internal-sysinfo-print-cpu-type-from-cpuinfo-when-in.patch +0064-cmd-compiler-runtime-internal-atomic-Implementing-xc.patch +0065-cmd-compiler-runtime-internal-atomic-Implementing-xa.patch +0066-cmd-compiler-runtime-internal-atomic-Implementing-An.patch +0067-cmd-internal-obj-loong64-correct-the-instruction-for.patch +0068-cmd-internal-obj-loong64-recheck-jump-offset-boundar.patch +0069-runtime-fix-the-vDSO-symbol-version-for-kernel-4.19-.patch +0070-cmd-link-internal-loadelf-correct-the-relocation-siz.patch +0071-cmd-compile-cmd-internal-runtime-change-the-register.patch +0072-cmd-compile-add-ABI-register-definations-for-loong64.patch +0073-cmd-compile-cmd-internal-runtime-change-registers-on.patch +0074-internal-abi-define-loong64-regABI-constants.patch +0075-cmd-compile-internal-add-register-info-for-loong64-r.patch +0076-cmd-compile-internal-add-spill-support-for-loong64-r.patch +0077-cmd-compile-update-loong64-CALL-ops.patch +0078-runtime-make-duff-device-as-ABIInternal-for-loong64.patch +0079-runtime-support-regABI-and-add-spill-functions-in-ru.patch +0080-reflect-runtime-add-reflect-support-for-regABI-on-lo.patch +0081-internal-bytealg-add-regABI-support-in-bytealg-funct.patch +0082-runtime-add-regABI-support-in-memclr-and-memmove-fun.patch +0083-cmd-internal-obj-set-morestack-arg-spilling-and-rega.patch +0084-cmd-compile-fix-If-lowering-on-loong64.patch +0085-runtime-internal-syscall-use-ABIInternal-for-Syscall.patch +0086-cmd-compile-internal-buildcfg-enable-regABI-on-loong.patch +0087-internal-abi-internal-buildcfg-always-enable-registe.patch +0088-all-delete-loong64-non-register-ABI-fallback-path.patch +0089-cmd-internal-obj-loong64-using-LookupABI-to-find-duf.patch +0090-cmd-internal-cmd-link-unify-the-relocation-nameing-s.patch +0091-oldabi-fix-the-definition-of-members-in-the-PtraceRe.patch +0092-cmd-internal-obj-loong64-remove-unused-register-alia.patch +0093-cmd-internal-runtime-change-the-LR-parameter-registe.patch +0094-syscall-add-a-Go-directive-go-nocheckptr-to-forkAndE.patch +0095-src-runtime-mark-asanread-and-asanwrite-functions-as.patch +0096-cmd-dist-update-isUnsupportedVMASize-test-skip.patch + diff --git a/loongarch64.tar.gz b/loongarch64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c2cdaab8bbcf2c8e710334504febcb82ca264cdc Binary files /dev/null and b/loongarch64.tar.gz differ