Skip to content

Commit

Permalink
[Clang]-Added libm to the do not search for SDL list because of autom…
Browse files Browse the repository at this point in the history
…ation. 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)
  • Loading branch information
estewart08 authored and gregrodgers committed Oct 29, 2019
1 parent 2d3b0bf commit f59dca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,8 +1795,8 @@ void tools::AddStaticDeviceLibs(Compilation *C,
// Build list of Static Device Libraries SDLs specified by -l option
SmallVector<std::string, 16> SDL_Names;
for (std::string SDL_Name : DriverArgs.getAllArgValues(options::OPT_l)) {
// No SDL for -lomp or -lcudart, they only have host libs
if (SDL_Name != "omp" && SDL_Name != "cudart") {
// No SDL for -lomp or -lcudart, they only have host libs, SDL for -lm added automatically
if (SDL_Name != "omp" && SDL_Name != "cudart" && SDL_Name != "m") {
bool inSDL_Names = false;
for (std::string OldName : SDL_Names) {
if (OldName == SDL_Name)
Expand Down

0 comments on commit f59dca9

Please sign in to comment.