Skip to content

Commit

Permalink
LCC: link with -lgfortran instead of -llfortran since 1.26.03
Browse files Browse the repository at this point in the history
Since LCC 1.26.03, compiler developers decided to rename
liblfortran to libgfortran (internal reference: mcstbug#131633),
and despite it's stated that "-llfortran will be automatically
treated as -lgfortran", it actually does not work (and there's
even no symlinks like liblfortran.* -> libgfortran.*); so we
have to explicitly choose which library we have to link in.

Fixes: #23646
  • Loading branch information
makise-homura authored and bradking committed Jun 27, 2022
1 parent 8321c3d commit 57da7a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/Platform/Linux-LCC-Fortran.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include(Platform/Linux-LCC)
__linux_compiler_lcc(Fortran)
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "1.26.03")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran")
else()
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-lgfortran")
endif()

0 comments on commit 57da7a4

Please sign in to comment.