diff --git a/SOURCES/gcc11-static-libquadmath.patch b/SOURCES/gcc11-static-libquadmath.patch new file mode 100644 index 0000000..f6152b6 --- /dev/null +++ b/SOURCES/gcc11-static-libquadmath.patch @@ -0,0 +1,178 @@ +2022-08-17 Francois-Xavier Coudert + Jakub Jelinek + + PR fortran/46539 +gcc/ + * common.opt (static-libquadmath): New option. + * gcc.cc (driver_handle_option): Always accept -static-libquadmath. + * config/darwin.h (LINK_SPEC): Handle -static-libquadmath. +gcc/fortran/ + * lang.opt (static-libquadmath): New option. + * invoke.texi (-static-libquadmath): Document it. +libgfortran/ + * acinclude.m4 (LIBQUADSPEC): From $FC -static-libgfortran -### + output determine -Bstatic/-Bdynamic, -bstatic/-bdynamic, + -aarchive_shared/-adefault linker support or Darwin remapping + of -lgfortran to libgfortran.a%s and use that around or instead + of -lquadmath in LIBQUADSPEC. + * configure: Regenerated. + +--- gcc/common.opt.jj 2022-06-15 13:59:50.547031453 +0200 ++++ gcc/common.opt 2022-09-29 18:26:29.765433518 +0200 +@@ -3446,6 +3446,10 @@ static-libgfortran + Driver + ; Documented for Fortran, but always accepted by driver. + ++static-libquadmath ++Driver ++; Documented for Fortran, but always accepted by driver. ++ + static-libstdc++ + Driver + +--- gcc/gcc.c.jj 2022-09-29 18:26:35.427356120 +0200 ++++ gcc/gcc.c 2022-09-29 18:27:53.506289363 +0200 +@@ -4482,10 +4482,13 @@ driver_handle_option (struct gcc_options + case OPT_static_libgcc: + case OPT_shared_libgcc: + case OPT_static_libgfortran: ++ case OPT_static_libquadmath: + case OPT_static_libstdc__: +- /* These are always valid, since gcc.c itself understands the +- first two, gfortranspec.c understands -static-libgfortran and +- g++spec.c understands -static-libstdc++ */ ++ /* These are always valid, since gcc.c itself understands the ++ first two, gfortranspec.c understands -static-libgfortran, ++ d-spec.cc understands -static-libphobos, g++spec.c ++ understands -static-libstdc++ and libgfortran.spec handles ++ -static-libquadmath. */ + validated = true; + break; + +--- gcc/config/darwin.h.jj 2022-06-15 13:59:50.557031352 +0200 ++++ gcc/config/darwin.h 2022-09-29 18:26:29.778433340 +0200 +@@ -298,6 +298,7 @@ extern GTY(()) int darwin_ms_struct; + %:replace-outfile(-lobjc libobjc-gnu.a%s); \ + :%:replace-outfile(-lobjc -lobjc-gnu ) } }\ + %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\ ++ %{static|static-libgcc|static-libquadmath:%:replace-outfile(-lquadmath libquadmath.a%s)}\ + %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\ + %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\ + %{!Zdynamiclib: \ +--- gcc/fortran/lang.opt.jj 2021-10-20 08:45:00.976203338 +0200 ++++ gcc/fortran/lang.opt 2022-09-29 18:26:29.799433051 +0200 +@@ -850,6 +850,10 @@ static-libgfortran + Fortran + Statically link the GNU Fortran helper library (libgfortran). + ++static-libquadmath ++Driver ++Statically link the GCC Quad-Precision Math Library (libquadmath). ++ + std=f2003 + Fortran + Conform to the ISO Fortran 2003 standard. +--- gcc/fortran/invoke.texi.jj 2021-04-20 10:32:57.166451910 +0200 ++++ gcc/fortran/invoke.texi 2022-09-29 18:26:29.790433175 +0200 +@@ -170,7 +170,7 @@ and warnings}. + + @item Link Options + @xref{Link Options,,Options for influencing the linking step}. +-@gccoptlist{-static-libgfortran} ++@gccoptlist{-static-libgfortran -static-libquadmath} + + @item Runtime Options + @xref{Runtime Options,,Options for influencing runtime behavior}. +@@ -1389,6 +1389,20 @@ configured, this option has no effect. + @end table + + ++@table @gcctabopt ++@item -static-libquadmath ++@opindex @code{static-libquadmath} ++On systems that provide @file{libquadmath} as a shared and a static ++library, this option forces the use of the static version. If no ++shared version of @file{libquadmath} was built when the compiler was ++configured, this option has no effect. ++ ++Please note that the @file{libquadmath} runtime library is licensed under the ++GNU Lesser General Public License (LGPL), and linking it statically introduces ++requirements when redistributing the resulting binaries. ++@end table ++ ++ + @node Runtime Options + @section Influencing runtime behavior + @cindex options, runtime +--- libgfortran/acinclude.m4.jj 2022-09-29 18:26:35.449355819 +0200 ++++ libgfortran/acinclude.m4 2022-09-29 18:31:23.831416332 +0200 +@@ -338,11 +338,32 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ + ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag + ]) + ++ dnl Determine -Bstatic ... -Bdynamic etc. support from gfortran -### stderr. ++ touch conftest1.$ac_objext conftest2.$ac_objext ++ LQUADMATH=-lquadmath ++ $FC -static-libgfortran -### -o conftest \ ++ conftest1.$ac_objext -lgfortran conftest2.$ac_objext 2>&1 >/dev/null \ ++ | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd ++ if grep "conftest1.$ac_objext.* -Bstatic -lgfortran -Bdynamic .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" ++ elif grep "conftest1.$ac_objext.* -bstatic -lgfortran -bdynamic .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" ++ elif grep "conftest1.$ac_objext.* -aarchive_shared -lgfortran -adefault .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" ++ elif grep "conftest1.$ac_objext.*libgfortran.a .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" ++ fi ++ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd ++ + dnl For static libgfortran linkage, depend on libquadmath only if needed. + if test "x$libgfor_cv_have_as_needed" = xyes; then +- LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" ++ LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} $LQUADMATH %{static-libgfortran:$libgfor_cv_no_as_needed_option}" + else +- LIBQUADSPEC="-lquadmath" ++ LIBQUADSPEC="$LQUADMATH" + fi + if test -f ../libquadmath/libquadmath.la; then + LIBQUADLIB=../libquadmath/libquadmath.la +--- libgfortran/configure.jj 2022-09-29 18:26:35.482355368 +0200 ++++ libgfortran/configure 2022-09-29 18:31:59.230932780 +0200 +@@ -26200,10 +26200,30 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_as_needed" >&5 + $as_echo "$libgfor_cv_have_as_needed" >&6; } + ++ touch conftest1.$ac_objext conftest2.$ac_objext ++ LQUADMATH=-lquadmath ++ $FC -static-libgfortran -### -o conftest \ ++ conftest1.$ac_objext -lgfortran conftest2.$ac_objext 2>&1 >/dev/null \ ++ | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd ++ if grep "conftest1.$ac_objext.* -Bstatic -lgfortran -Bdynamic .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" ++ elif grep "conftest1.$ac_objext.* -bstatic -lgfortran -bdynamic .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" ++ elif grep "conftest1.$ac_objext.* -aarchive_shared -lgfortran -adefault .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" ++ elif grep "conftest1.$ac_objext.*libgfortran.a .*conftest2.$ac_objext" \ ++ conftest.cmd >/dev/null 2>&1; then ++ LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" ++ fi ++ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd ++ + if test "x$libgfor_cv_have_as_needed" = xyes; then +- LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" ++ LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} $LQUADMATH %{static-libgfortran:$libgfor_cv_no_as_needed_option}" + else +- LIBQUADSPEC="-lquadmath" ++ LIBQUADSPEC="$LQUADMATH" + fi + if test -f ../libquadmath/libquadmath.la; then + LIBQUADLIB=../libquadmath/libquadmath.la diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec index aa189be..dc90bca 100644 --- a/SPECS/gcc.spec +++ b/SPECS/gcc.spec @@ -134,7 +134,7 @@ Summary: GCC version 11 Name: %{?scl_prefix}gcc Version: %{gcc_version} -Release: %{gcc_release}%{?dist} +Release: %{gcc_release}.1%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -339,6 +339,7 @@ Patch15: gcc11-pr101786.patch Patch16: gcc11-stringify-__VA_OPT__.patch Patch17: gcc11-stringify-__VA_OPT__-2.patch Patch18: gcc11-Wbidi-chars.patch +Patch19: gcc11-static-libquadmath.patch Patch100: gcc11-fortran-fdec-duplicates.patch Patch101: gcc11-fortran-flogical-as-integer.patch @@ -713,6 +714,7 @@ to NVidia PTX capable devices if available. %patch16 -p0 -b .stringify-__VA_OPT__~ %patch17 -p0 -b .stringify-__VA_OPT__-2~ %patch18 -p1 -b .bidi~ +%patch19 -p0 -b .static-libquadmath~ %patch100 -p1 -b .fortran-fdec-duplicates~ %patch101 -p1 -b .fortran-flogical-as-integer~ @@ -2894,6 +2896,9 @@ fi %endif %changelog +* Mon Oct 3 2022 Marek Polacek 11.2.1-9.1 +- add -static-libquadmath (#2131091) + * Fri Jan 28 2022 Marek Polacek 11.2.1-9 - update from releases/gcc-11-branch (#2047298) - PRs fortran/104127, fortran/104212, fortran/104227, target/101529