diff --git a/golang.spec b/golang.spec index f29af70e8ed5d1e5b1d5d0d65b584c79a95f454b..4dc39bf1d460ff32b53f1d302695dce81e3f73a6 100644 --- a/golang.spec +++ b/golang.spec @@ -29,20 +29,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 @@ -56,7 +56,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch x86_64 %{arm} aarch64 ppc64le +%ifarch x86_64 %{arm} aarch64 ppc64le loongarch64 %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -94,14 +94,18 @@ %ifarch s390x %global gohostarch s390x %endif +%ifarch loongarch64 +%global gohostarch loong64 +%endif %global go_api 1.18 %global go_version 1.18.4 %global pkg_release 1 +%global anolis_release .0.1 Name: golang Version: %{go_version} -Release: 2%{?dist} +Release: 2%{anolis_release}%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -109,6 +113,8 @@ URL: http://golang.org/ Source0: https://github.com/golang-fips/go/archive/refs/tags/go%{go_version}-%{pkg_release}-openssl-fips.tar.gz # make possible to override default traceback level at build time by setting build tag rpm_crashtraceback Source1: fedora.go +Source2: loongarch64.tar.gz +Source3: loongarch64.patches # The compiler is written in Go. Needs go(1.4+) compiler for build. # Actual Go based bootstrap compiler provided by above source. @@ -242,6 +248,15 @@ Requires: %{name} = %{version}-%{release} %patch226 -p1 %patch227 -p1 +## Apply loongarch64 patches +tar xf %{SOURCE2} +for p in $(cat %{SOURCE3}); do + patch -p1 -s -i loongarch64/$p +done + +## Delete loongarch64 directory +rm -rf loongarch64 + cp %{SOURCE1} ./src/runtime/ %build @@ -515,6 +530,9 @@ cd .. %endif %changelog +* Tue Dec 27 2022 chenguoqi - 1.18.4-2.0.1 +- Add loongarch64 base support. + * Wed Aug 03 2022 Alejandro Sáez - 1.18.4-2 - Adds patch for PIE mode issues on PPC64LE - Resolves: rhbz#2111593 diff --git a/loongarch64.patches b/loongarch64.patches new file mode 100644 index 0000000000000000000000000000000000000000..1a30c1ce7b6fdbad486611bf942ee2ebb5e071a1 --- /dev/null +++ b/loongarch64.patches @@ -0,0 +1,87 @@ +0001-internal-add-loong64-constant-definition.patch +0002-cmd-go-internal-configure-go-tool-workflow-for-loong.patch +0003-cmd-compile-register-loong64.Init-function-for-compi.patch +0004-cmd-compile-internal-loong64-implement-Init-function.patch +0005-cmd-compile-internal-ssa-config-lower-pass-function-.patch +0006-cmd-compile-internal-ssa-increase-the-bit-width-of-B.patch +0007-cmd-compile-internal-ssa-gen-define-rules-and-operat.patch +0008-cmd-compile-internal-ssa-inline-memmove-with-known-s.patch +0009-cmd-compile-internal-ssa-add-support-on-loong64-for-.patch +0010-cmd-compile-internal-ssagen-enable-intrinsic-operati.patch +0011-cmd-compile-internal-fix-test-error-on-loong64.patch +0012-cmd-internal-obj-instructions-and-registers-for-loon.patch +0013-cmd-asm-internal-helper-function-and-end-to-end-test.patch +0014-cmd-internal-objabi-cmd-link-support-linker-for-linu.patch +0015-runtime-bootstrap-for-linux-loong64-and-implement-ru.patch +0016-runtime-load-save-TLS-variable-g-on-loong64.patch +0017-runtime-implement-signal-for-linux-loong64.patch +0018-runtime-support-vdso-for-linux-loong64.patch +0019-runtime-implement-duffzero-duffcopy-for-linux-loong6.patch +0020-runtime-implement-asyncPreempt-for-linux-loong64.patch +0021-runtime-support-memclr-memmove-for-linux-loong64.patch +0022-runtime-implement-syscalls-for-runtime-bootstrap-on-.patch +0023-runtime-add-build-tag-for-common-support-on-linux-lo.patch +0024-runtime-fix-runtime-test-error-for-loong64.patch +0025-runtime-internal-add-atomic-support-for-loong64.patch +0026-cmd-cgo-configure-cgo-tool-for-loong64.patch +0027-runtime-cgo-add-cgo-function-call-support-for-loong6.patch +0028-cmd-nm-cmd-objdump-cmd-pprof-disassembly-is-not-supp.patch +0029-cmd-dist-support-dist-tool-for-loong64.patch +0030-cmd-vendor-update-vendored-golang.org-x-sys-to-suppo.patch +0031-cmd-vendor-update-vendored-golang.org-x-tools-to-sup.patch +0032-internal-bytealg-support-basic-byte-operation-on-loo.patch +0033-debug-go-math-os-reflect-vendor-support-standard-lib.patch +0034-syscall-add-syscall-support-for-linux-loong64.patch +0035-internal-syscall-unix-loong64-use-generic-syscall.patch +0036-misc-test-fix-test-error-for-loong64.patch +0037-copyright-add-Loongson-into-AUTHORS.patch +0038-api-fix-check-errors-for-loong64.patch +0039-fixup-fix-misc-cgo-test-sigaltstack-size-on-loong64.patch +0040-fixup-fix-mabi-to-lp64-for-loong64.patch +0041-fixup-fix-runtime-defs_linux_loong64.patch +0042-fixup-fix-test-issue11656-for-loong64.patch +0043-runtime-fixed-func-breakpoint-implementation-on-loon.patch +0044-update-vendor-golang.org-x-sys-for-byteorder-fix.patch +0045-cmd-compile-remove-atomic-Cas-Xchg-and-Xadd-intrinsi.patch +0046-runtime-fix-asyncPreempt-implementation-for-errors-o.patch +0047-cmd-internal-obj-add-FuncInfo-SPWRITE-flag-for-linux.patch +0048-runtime-add-missing-TOPFRAME-NOFRAME-flag-for-linux-.patch +0049-cmd-compile-fix-loong64-constant-folding-in-division.patch +0050-runtime-fix-the-vDSO-symbol-version-on-loong64.patch +0051-internal-cpu-fix-cpu-cacheLineSize-for-loong64.patch +0052-syscall-runtime-internal-syscall-always-zero-the-hig.patch +0053-runtime-clean-up-unused-function-gosave-on-loong64.patch +0054-debug-pe-add-IMAGE_FILE_MACHINE_LOONGARCH-64-32.patch +0055-oldabi-fixup-stack-growth-after-fork-in-runtime.sigf.patch +0056-runtime-internal-atomic-enable-atomic-64bit-types-fo.patch +0057-cmd-compile-add-missing-tail-calls-flag-for-linux-lo.patch +0058-cmd-compile-remove-the-resultInArg0-register-checks-.patch +0059-runtime-remove-the-fake-mstart-caller-in-systemstack.patch +0060-runtime-minor-refactoring-of-_rt0_loong64_linux.patch +0061-runtime-fix-gcWriteBarrier-frame-size-on-loong64-mip.patch +0062-cmd-internal-obj-loong64-remove-invalid-branch-delay.patch +0063-cmd-compile-cmd-internal-obj-rename-loong64-instruct.patch +0064-math-implement-Sqrt-in-assembly-for-loong64.patch +0065-cmd-asm-add-RDTIME-L-H-.W-RDTIME.D-support-for-loong.patch +0066-runtime-use-StableCounter-implement-cputicks-on-linu.patch +0067-debug-elf-add-new-style-LoongArch-reloc-types.patch +0068-cmd-link-recognize-the-new-R_LARCH_32_PCREL-type-on-.patch +0069-runtime-fix-runtime.usleep-on-linux-loong64.patch +0070-cmd-internal-obj-remove-redundant-cnames-on-loong64.patch +0071-runtime-save-fetch-g-register-during-VDSO-on-loong64.patch +0072-runtime-save-restore-callee-saved-registers-in-loong.patch +0073-runtime-add-comment-for-sys_linux_loong64.patch +0074-runtime-add-support-for-buildmode-c-shared-on-loong6.patch +0075-cmd-compile-add-support-for-buildmode-c-shared-on-lo.patch +0076-cmd-internal-obj-loong64-cmd-internal-objabi-add-c-s.patch +0077-cmd-link-add-support-for-buildmode-c-shared-on-loong.patch +0078-cmd-internal-sys-enable-c-shared-feature-on-loong64.patch +0079-cmd-dist-misc-cgo-testcshared-enable-c-shared-test-o.patch +0080-cmd-internal-obj-loong64-add-MASKEQZ-and-MASKNEZ-ins.patch +0081-cmd-internal-obj-loong64-add-ROTR-ROTRV-instructions.patch +0082-cmd-compile-intrinsify-Add64-on-loong64.patch +0083-cmd-compile-intrinsify-Sub64-on-loong64.patch +0084-cmd-link-detect-glibc-vs-musl-ldso-at-link-time.patch +0085-runtime-mark-morestack_noctxt-SPWRITE-for-linux-loon.patch +0086-runtime-using-wyrand-for-fastrand-on-linux-loong64.patch +0087-cmd-compile-cmd-dist-cmd-go-enable-pie-buildmode-for.patch diff --git a/loongarch64.tar.gz b/loongarch64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0721cb7a94124a84de23eeee5d6272585d9bd90e Binary files /dev/null and b/loongarch64.tar.gz differ