From 596d9a873da8a909c16afee519cd71546e540079 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Wed, 14 Oct 2020 00:13:47 +0800 Subject: [PATCH 1/2] Fix gcc10 -fno-common compile issue until upstream fixes this change has given better compatible with gcc10 toolchain, should be maintained util upstream fixes 'multiple definition ...' warnings Default to -fno-common A common mistake in C is omitting extern when declaring a global variable in a header file. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions this error is ignored. GCC 10 defaults to -fno-common, which means a linker error will now be reported. To fix this, use extern in header files when declaring global variables, and ensure each global is defined in exactly one C file. If tentative definitions of particular variables need to be placed in a common block, __attribute__((__common__)) can be used to force that behavior even in code compiled without -fcommon. As a workaround, legacy C code where all tentative definitions should be placed into a common block can be compiled with -fcommon. int x; // tentative definition - avoid in header files extern int y; // correct declaration in a header file refer url: https://gcc.gnu.org/gcc-10/porting_to.html Signed-off-by: weitao zhou --- texlive.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/texlive.spec b/texlive.spec index aad80beb..0e8bf4e4 100644 --- a/texlive.spec +++ b/texlive.spec @@ -1,3 +1,5 @@ +%define anolis_release .0.1 +%define _legacy_common_support 1 %global tl_epoch 7 %global source_date 20180414 %global source_name texlive-%{source_date}-source @@ -15,7 +17,7 @@ Name: texlive Version: %{source_date} -Release: 25%{?dist} +Release: 25%{anolis_release}%{?dist} Epoch: %{tl_epoch} Summary: TeX formatting system Group: Applications/Publishing @@ -27199,6 +27201,9 @@ fi %doc %{_texdir}/texmf-dist/doc/context/ %changelog +* Tue Apr 19 2022 Weitao Zhou - 7:20180414-25.0.1 +- Fix gcc10 -fno-common compile issue for compatible with gcc10 build + * Thu Dec 02 2021 Than Ngo - 7:20180414-25 - Resolves: #2025493 - eps file does not show up when using xdvi -- Gitee From fa1e9a3aaa77c8fc4384d19dee7a14aebd4d1b3d Mon Sep 17 00:00:00 2001 From: yxliu Date: Thu, 25 Nov 2021 16:02:50 +0800 Subject: [PATCH 2/2] build: support loongarch64 Signed-off-by: yxliu --- texlive.spec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/texlive.spec b/texlive.spec index 0e8bf4e4..62c39c51 100644 --- a/texlive.spec +++ b/texlive.spec @@ -23803,8 +23803,13 @@ done %build +%ifarch loongarch64 +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11 -fno-strict-aliasing" +%else export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Werror=format-security" export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11 -fno-strict-aliasing -Werror=format-security" +%endif %if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 export LDFLAGS="%{build_ldflags}" %endif @@ -23841,8 +23846,10 @@ cd work --with-system-potrace \ --with-pic \ --with-xdvi-x-toolkit=xaw \ +%ifnarch loongarch64 --with-system-mpfr \ --with-system-gmp \ +%endif --disable-xindy \ --disable-xindy-docs \ --disable-xindy-make-rules \ @@ -23856,7 +23863,7 @@ cd work --disable-biber \ --disable-ptexenc \ --disable-largefile \ - %ifarch aarch64 %{mips} %{power64} s390 s390x + %ifarch aarch64 %{mips} %{power64} s390 s390x loongarch64 --disable-luajittex \ --disable-mfluajit \ %endif @@ -23923,7 +23930,7 @@ popd # drop i386-linux packages so we need to make symlinks manuall # luatex -%ifnarch aarch64 %{mips} %{power64} s390 s390x +%ifnarch aarch64 %{mips} %{power64} s390 s390x loongarch64 pushd %{buildroot}%{_bindir} for f in texluajit texluajitc ; do ln -fs luajittex $f @@ -25462,7 +25469,7 @@ fi %files luatex %license gpl2.txt %{_bindir}/dviluatex -%ifnarch aarch64 %{mips} %{power64} s390 s390x +%ifnarch aarch64 %{mips} %{power64} s390 s390x loongarch64 %{_bindir}/luajittex %{_bindir}/texluajit %{_bindir}/texluajitc @@ -26859,7 +26866,7 @@ fi %{_includedir}/synctex/ %{_includedir}/texlua52/ %{_includedir}/texlua53/ -%ifnarch aarch64 %{mips} %{power64} s390 s390x +%ifnarch aarch64 %{mips} %{power64} s390 s390x loongarch64 %{_includedir}/texluajit/ %endif %{_libdir}/*.so @@ -27202,6 +27209,7 @@ fi %changelog * Tue Apr 19 2022 Weitao Zhou - 7:20180414-25.0.1 +- anolis texlive add loongarch64(Yaxuan Liu) - Fix gcc10 -fno-common compile issue for compatible with gcc10 build * Thu Dec 02 2021 Than Ngo - 7:20180414-25 -- Gitee