Skip to content

Commit f59dca9

Browse files
estewart08gregrodgers
authored andcommitted
[Clang]-Added libm to the do not search for SDL list because of automation. If the user adds -lm to the ld flags, this will avoid a double inclusion of the device lib (libm-amdgcn-gfxXXX) during the clang-build-select-link step and allow for the -lm flag to be added for the ld step of C compilation. Note: -lm on the ld link step is added by default with clang++ (ROCm#38)
(cherry picked from commit 2d0e37737776784b6f2b17bf12ea0a12b55f820f)
1 parent 2d3b0bf commit f59dca9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1795,8 +1795,8 @@ void tools::AddStaticDeviceLibs(Compilation *C,
17951795
// Build list of Static Device Libraries SDLs specified by -l option
17961796
SmallVector<std::string, 16> SDL_Names;
17971797
for (std::string SDL_Name : DriverArgs.getAllArgValues(options::OPT_l)) {
1798-
// No SDL for -lomp or -lcudart, they only have host libs
1799-
if (SDL_Name != "omp" && SDL_Name != "cudart") {
1798+
// No SDL for -lomp or -lcudart, they only have host libs, SDL for -lm added automatically
1799+
if (SDL_Name != "omp" && SDL_Name != "cudart" && SDL_Name != "m") {
18001800
bool inSDL_Names = false;
18011801
for (std::string OldName : SDL_Names) {
18021802
if (OldName == SDL_Name)

0 commit comments

Comments
 (0)