[Bug fortran/46539] libquadmath: Add -static-libquadmath
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 --- Comment #9 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:dd899c7de36d19ddf18e3bfab4a0c150096e2368 commit r13-2129-gdd899c7de36d19ddf18e3bfab4a0c150096e2368 Author: Jakub Jelinek Date: Sat Aug 20 21:20:04 2022 +0200 fortran: Drop -static-lib{gfortran,quadmath} from f951 [PR46539] As discussed earlier, all other -static-lib* options are Driver only, these 2 are Driver in common.opt and Fortran in lang.opt. The spec files never pass the -static-lib* options down to any compiler (f951 etc.), so the 2 errors below are reported only when one runs ./f951 -static-libgfortran by hand. The following patch just removes f951 support of these options, the gfortran driver behavior remains as before. For other -static-lib* option (and even these because it is never passed to f951) we never error if we can't support those options, and e.g. Darwin is actually able to handle those options through other means. 2022-08-20 Jakub Jelinek PR fortran/46539 * lang.opt (static-libgfortran, static-libquadmath): Change Fortran to Driver. * options.cc (gfc_handle_option): Don't handle OPT_static_libgfortran nor OPT_static_libquadmath here.
[Bug fortran/46539] libquadmath: Add -static-libquadmath
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 Jakub Jelinek changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED|RESOLVED CC||jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek --- Implemented now on the trunk.
[Bug fortran/46539] libquadmath: Add -static-libquadmath
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 --- Comment #7 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:745be54bd6634fe63d6be83615e264c83d2ae9f9 commit r13-2094-g745be54bd6634fe63d6be83615e264c83d2ae9f9 Author: Jakub Jelinek Date: Wed Aug 17 17:00:33 2022 +0200 fortran: Add -static-libquadmath support [PR46539] The following patch is a revival of the https://gcc.gnu.org/legacy-ml/gcc-patches/2014-10/msg00771.html patch. While trunk configured against recent glibc and with linker --as-needed support doesn't really need to link against -lquadmath anymore, there are still other targets where libquadmath is still in use. As has been discussed, making -static-libgfortran imply statically linking both libgfortran and libquadmath is undesirable because of the significant licensing differences between the 2 libraries. Compared to the 2014 patch, this one doesn't handle -lquadmath addition in the driver, which to me looks incorrect, libgfortran configure determines where in libgfortran.spec -lquadmath should be present if at all and with what it should be wrapped, but analyzes gfortran -### -static-libgfortran stderr and based on that figures out what gcc/configure.ac determined. 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. * options.cc (gfc_handle_option): Error out if -static-libquadmath is passed but we do not support 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. Co-Authored-By: Francois-Xavier Coudert
[Bug fortran/46539] libquadmath: Add -static-libquadmath
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 Andrew B changed: What|Removed |Added CC||andrew at blamsoft dot com --- Comment #6 from Andrew B --- It would be great to be able to share a binary with just operating system supplied dynamic libraries. After reading posts about it and looking at otool -L, it seems like this is what is needed.
[Bug fortran/46539] libquadmath: Add -static-libquadmath
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 Francois-Xavier Coudert changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2014-10-04 CC||fxcoudert at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |fxcoudert at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #5 from Francois-Xavier Coudert --- Patch proposed here: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00375.html
[Bug fortran/46539] libquadmath: Add -static-libquadmath
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 --- Comment #4 from Arnaud Desitter 2012-03-28 10:05:29 UTC --- Thanks for the workarounds. For information, the Intel Fortran compiler has "-static-intel" which links statically Intel provided libraries. Such option may be un-practical for gcc.
[Bug fortran/46539] libquadmath: Add -static-libquadmath
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 Tobias Burnus changed: What|Removed |Added CC||burnus at gcc dot gnu.org --- Comment #3 from Tobias Burnus 2012-03-22 17:31:41 UTC --- (In reply to comment #2) > I hit this problem. For the application I am dealing with, I need to link > statically the compiler provided libraries while linking dynamically the > system > ones (pthread, mpi, etc.). > > Linking with "gfortran -static-libgfortran -static-libgcc -Wl,-Bstatic > -lstdc++ > -Wl,-Bdynamic" solves the problem except for "libquadmath.so.0". Work arounds: You could try to link with "gcc" rather than with gfortran, but you then need to explicitly include the gfortran, quadmath and m(ath) library: gcc -static-libgcc -Wl,-Bstatic -lstdc++ -lgfortran -lquadmath -Wl,-Bdynamic -lm as that avoids "gfortran"'s special treatment of libquadmath. [You might consider to add -Wl,--as-needed ... -Wl,--no-as-needed. That avoids linking files when they are not needed.] An alternative is to modify libgfortran.spec - and add there the "-Bstatic" ... "-Bdynamic" unconditionally. Or you create your own .spec file and load it via -specs= (The "libgfortran.spec" file is a text file in the installed GCC tree; e.g. it could be /lib*/libgfortran.spec. If you use GCC/gfortran with "-v" the output should inform you about which file has been read - and how the linker is called.)
[Bug fortran/46539] libquadmath: Add -static-libquadmath
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 Arnaud Desitter changed: What|Removed |Added CC||arnaud02 at users dot ||sourceforge.net --- Comment #2 from Arnaud Desitter 2012-03-22 16:40:41 UTC --- I hit this problem. For the application I am dealing with, I need to link statically the compiler provided libraries while linking dynamically the system ones (pthread, mpi, etc.). Linking with "gfortran -static-libgfortran -static-libgcc -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic" solves the problem except for "libquadmath.so.0". Linking with "-Wl,-Bstatic -lquadmath -Wl,-Bdynamic" does not help. The only workaround I found is to configure gcc with "configure --disable-libquadmath-support". Could you please implement "-static-libquadmath" or make "-Wl,-Bstatic -lquadmath -Wl,-Bdynamic" work?
[Bug fortran/46539] libquadmath: Add -static-libquadmath
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 --- Comment #1 from Tobias Burnus 2010-11-25 11:22:08 UTC --- cf. http://gcc.gnu.org/ml/fortran/2010-11/msg00348.html