Skip to content

Commit e8069d5

Browse files
authored
fix: Skip -fPIC flag for flang-new on Windows MSVC targets (#1167)
2 parents 09d5485 + eed757f commit e8069d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/fpm_compiler.F90

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,17 @@ function get_default_flags(self, release) result(flags)
294294
! Append position-independent code (PIC) flag, that is necessary
295295
! building shared libraries
296296
select case (self%id)
297-
case (id_gcc, id_f95, id_caf, id_flang, id_flang_new, id_f18, id_lfortran, &
297+
case (id_gcc, id_f95, id_caf, id_flang, id_f18, id_lfortran, &
298298
id_intel_classic_nix, id_intel_classic_mac, id_intel_llvm_nix, &
299299
id_pgi, id_nvhpc, id_nag, id_cray, id_ibmxl)
300300
pic_flag = " -fPIC"
301+
case (id_flang_new)
302+
! flang-new doesn't support -fPIC on Windows MSVC target
303+
if (get_os_type() == OS_WINDOWS) then
304+
pic_flag = ""
305+
else
306+
pic_flag = " -fPIC"
307+
end if
301308
case (id_intel_classic_windows, id_intel_llvm_windows)
302309
pic_flag = "" ! Windows does not use -fPIC
303310
case default

0 commit comments

Comments
 (0)