Skip to content

Commit eed757f

Browse files
committed
fix: Skip -fPIC flag for flang-new on Windows MSVC targets
1 parent b9d11e6 commit eed757f

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
@@ -288,10 +288,17 @@ function get_default_flags(self, release) result(flags)
288288
! Append position-independent code (PIC) flag, that is necessary
289289
! building shared libraries
290290
select case (self%id)
291-
case (id_gcc, id_f95, id_caf, id_flang, id_flang_new, id_f18, id_lfortran, &
291+
case (id_gcc, id_f95, id_caf, id_flang, id_f18, id_lfortran, &
292292
id_intel_classic_nix, id_intel_classic_mac, id_intel_llvm_nix, &
293293
id_pgi, id_nvhpc, id_nag, id_cray, id_ibmxl)
294294
pic_flag = " -fPIC"
295+
case (id_flang_new)
296+
! flang-new doesn't support -fPIC on Windows MSVC target
297+
if (get_os_type() == OS_WINDOWS) then
298+
pic_flag = ""
299+
else
300+
pic_flag = " -fPIC"
301+
end if
295302
case (id_intel_classic_windows, id_intel_llvm_windows)
296303
pic_flag = "" ! Windows does not use -fPIC
297304
case default

0 commit comments

Comments
 (0)