diff --git a/golang.spec b/golang.spec index bd7128cab8ce12e34811279cebf0b0619d091906..ba6f6b3f93760b4c3a5e21be3c04e3bc996bb824 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 @@ -95,6 +95,9 @@ %ifarch s390x %global gohostarch s390x %endif +%ifarch loongarch64 +%global gohostarch loong64 +%endif %global go_api 1.19 %global version 1.19.10 @@ -118,6 +121,8 @@ Source0: https://github.com/golang/go/archive/refs/tags/go%{version}.tar. Source1: https://github.com/golang-fips/go/archive/refs/tags/go%{version}-%{pkg_release}-openssl-fips.tar.gz # 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. @@ -265,6 +270,15 @@ popd %patch1939923 -p1 %patch227 -p1 +## 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 + cp %{SOURCE2} ./src/runtime/ %build @@ -539,6 +553,9 @@ cd .. %endif %changelog +* Tue Jul 18 2023 zhaoxiaolin - 1.19.10-1.0.2 +- LoongArch64: bug fix and add some new features support + * Fri Jun 30 2023 Liwei Ge - 1.19.10-1.0.1 - update base to golang 1.19.10 (CVE-2023-29402 CVE-2023-29403 CVE-2023-29404 CVE-2023-29405) diff --git a/loongarch64.patches b/loongarch64.patches new file mode 100644 index 0000000000000000000000000000000000000000..259850c1be4122c14feeaf7813c1d9894aeb6933 --- /dev/null +++ b/loongarch64.patches @@ -0,0 +1,81 @@ +0001-release-branch.go1.19-cmd-cgo-correct-_cgo_flags-out.patch +0002-fix-misc-cgo-test-sigaltstack-size-on-loong64.patch +0003-fix-mabi-to-lp64-for-loong64.patch +0004-fix-runtime-defs_linux_loong64.patch +0005-fix-test-issue11656-for-loong64.patch +0006-fixup-stack-growth-after-fork-in-runtime.sigfillset.patch +0007-debug-elf-add-new-style-LoongArch-reloc-types.patch +0008-cmd-link-recognize-the-new-R_LARCH_32_PCREL-type-on-.patch +0009-runtime-internal-atomic-enable-atomic-64bit-types-fo.patch +0010-cmd-compile-add-missing-tail-calls-flag-for-linux-lo.patch +0011-cmd-compile-remove-the-resultInArg0-register-checks-.patch +0012-runtime-remove-the-fake-mstart-caller-in-systemstack.patch +0013-cmd-internal-obj-loong64-save-LR-after-decrementing-.patch +0014-runtime-minor-refactoring-of-_rt0_loong64_linux.patch +0015-runtime-fix-gcWriteBarrier-frame-size-on-loong64-mip.patch +0016-cmd-internal-obj-loong64-remove-invalid-branch-delay.patch +0017-cmd-compile-cmd-internal-obj-rename-loong64-instruct.patch +0018-math-implement-Sqrt-in-assembly-for-loong64.patch +0019-cmd-asm-add-RDTIME-L-H-.W-RDTIME.D-support-for-loong.patch +0020-runtime-use-StableCounter-implement-cputicks-on-linu.patch +0021-cmd-compile-remove-atomic-Cas-Xchg-and-Xadd-intrinsi.patch +0022-runtime-fix-runtime.usleep-on-linux-loong64.patch +0023-cmd-internal-obj-remove-redundant-cnames-on-loong64.patch +0024-runtime-save-fetch-g-register-during-VDSO-on-loong64.patch +0025-runtime-save-restore-callee-saved-registers-in-loong.patch +0026-runtime-add-comment-for-sys_linux_loong64.patch +0027-runtime-add-support-for-buildmode-c-shared-on-loong6.patch +0028-cmd-compile-add-support-for-buildmode-c-shared-on-lo.patch +0029-cmd-internal-obj-loong64-cmd-internal-objabi-add-c-s.patch +0030-cmd-link-add-support-for-buildmode-c-shared-on-loong.patch +0031-cmd-internal-sys-enable-c-shared-feature-on-loong64.patch +0032-cmd-dist-misc-cgo-testcshared-enable-c-shared-test-o.patch +0033-cmd-compile-move-SSA-rotate-instruction-detection-to.patch +0034-cmd-compile-combine-multiple-rotate-instructions.patch +0035-cmd-internal-obj-loong64-add-MASKEQZ-and-MASKNEZ-ins.patch +0036-cmd-internal-obj-loong64-add-ROTR-ROTRV-instructions.patch +0037-cmd-compile-intrinsify-RotateLeft-32-64-on-loong64.patch +0038-cmd-compile-intrinsify-Add64-on-loong64.patch +0039-cmd-compile-intrinsify-Sub64-on-loong64.patch +0040-cmd-link-detect-glibc-vs-musl-ldso-at-link-time.patch +0041-runtime-mark-morestack_noctxt-SPWRITE-for-linux-loon.patch +0042-runtime-using-wyrand-for-fastrand-on-linux-loong64.patch +0043-cmd-compile-cmd-dist-cmd-go-enable-pie-buildmode-for.patch +0044-cmd-compile-cmd-link-cmd-internal-runtime-support-bu.patch +0045-cmd-link-cmd-internal-runtime-support-buildmode-plug.patch +0046-enable-test-for-buildmode-share-plugin.patch +0047-cmd-internal-runtime-enable-memory-sanitizer-on-loon.patch +0048-enable-test-for-msan.patch +0049-cmd-internal-runtime-enable-address-sanitizer-on-loo.patch +0050-enable-test-for-asan.patch +0051-Revert-cmd-compile-remove-atomic-Cas-Xchg-and-Xadd-i.patch +0052-cmd-compile-sign-extend-the-2nd-argument-of-the-Atom.patch +0053-cmd-asm-link-loong64-Implement-the-IE-model-to-acces.patch +0054-net-disable-TestLookupDotsWithRemoteSource-and-TestL.patch +0055-enable-c-archive-test-on-linux-loong64.patch +0056-runtime-no-need-to-save-these-registers-in-load_g-sa.patch +0057-cmd-internal-obj-loong64-add-support-for-movgr2cf-an.patch +0058-cmd-cmd-vendor-pick-up-updates-for-golang.org-x-arch.patch +0059-cmd-internal-objfile-add-loong64-disassembler-suppor.patch +0060-cmd-compile-disable-address-folding-for-globals-for-.patch +0061-cmd-compile-internal-runtime-use-NOOP-for-hardware-N.patch +0062-cmd-link-internal-loong64-use-BREAK-0-as-the-code-pa.patch +0063-cmd-asm-runtime-remove-the-RSB-register-from-loong64.patch +0064-cmd-internal-obj-loong64-realize-all-unconditional-j.patch +0065-cmd-internal-obj-loong64-clean-up-code-for-short-con.patch +0066-cmd-internal-obj-loong64-assemble-BEQ-BNEs-comparing.patch +0067-cmd-internal-obj-loong64-remove-Optab.family-and-reo.patch +0068-cmd-asm-support-the-PCALIGN-directive-on-loong64.patch +0069-internal-bytealg-runtime-align-some-loong64-asm-loop.patch +0070-cmd-link-bump-loong64-function-alignment-to-16-bytes.patch +0071-cmd-compile-remove-output-registers-limit-for-MUL-DI.patch +0072-cmd-compile-optimize-multiplication-on-loong64.patch +0073-cmd-compile-split-DIVV-DIVVU-op-on-loong64.patch +0074-cmd-internal-obj-loong64-auto-align-loop-heads-to-16.patch +0075-cmd-internal-obj-loong64-add-atomic-memory-access-in.patch +0076-cmd-compiler-runtime-internal-atomic-optimize-xchg-a.patch +0077-cmd-compiler-runtime-internal-atomic-optimize-xadd-a.patch +0078-cmd-compiler-runtime-internal-atomic-optimize-And-32.patch +0079-syscall-implement-Ptrace-Set-Get-Regs-using-PTRACE_-.patch +0080-cmd-internal-obj-loong64-remove-the-invalid-plan9-fo.patch +0081-internal-sysinfo-print-cpu-type-from-cpuinfo-when-in.patch diff --git a/loongarch64.tar.gz b/loongarch64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5613b21fc1e741a50c1775de0db14eb2d1c62bef Binary files /dev/null and b/loongarch64.tar.gz differ