Skip to content

Commit 8f38f29

Browse files
PeixinQiaobryanpkc
authored andcommitted
[Driver] Remove the "-lompstub" in the driver
In some workloads, users get "-lompstub" by running "flang -v" and link it explicitly, which may cause failure when compiling programs with OpenMP (flang -fopenmp test.f90 -lompstub). There is no runtime call in ompstub.c generated when "-fopenmp" is not added to compile the program. When "-fopenmp" is added to compile the program, the runtime in llvm/openmp(libomp.so) will be used. If users use some runtime library routines such as "omp_get_thread_num" and compiles it without the option "-fopenmp", both gfortran and ifort report errors of "undefined reference to ...". After remove "-lompstub" in the driver, classic-flang reports the error, too. So, it's safe to remove the "-lompstub" in the driver.
1 parent 6254c4f commit 8f38f29

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,6 @@ void ToolChain::AddFortranStdlibLibArgs(const ArgList &Args,
13511351
CmdArgs.push_back("-lpgmath");
13521352
if (useOpenMP)
13531353
CmdArgs.push_back("-lomp");
1354-
else
1355-
CmdArgs.push_back("-lompstub");
13561354
if (staticFlangLibs)
13571355
CmdArgs.push_back("-Bdynamic");
13581356

0 commit comments

Comments
 (0)