<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/162733>162733</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang][openmp] double precision sinh fails to link when offloading to amdgpu
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          VeeEM
      </td>
    </tr>
</table>

<pre>
    ```
program use_sinh
implicit none
real :: x
x = 0.5
!$omp target map(x)
x = sinh(x)
!$omp end target
print *, x
end program
```

```
$ flang -fdefault-real-8 -fopenmp --offload-arch=gfx90a use_sinh.f90 
ld.lld: error: undefined symbol: sinh
>>> referenced by /tmp/a.out.amdgcn.gfx90a-1b4acf.img.lto.o:(__omp_offloading_eeba6730_c800bec3__QQmain_l5)
>>> referenced by /tmp/a.out.amdgcn.gfx90a-1b4acf.img.lto.o:(__omp_offloading_eeba6730_c800bec3__QQmain_l5)
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
/pfs/lustrep1/scratch/project_462000700/vimaylis/llvm/install_20251009/bin/clang-linker-wrapper: error: 'clang' failed
flang-22: error: linker command failed with exit code 1 (use -v to see invocation)
```

There used to be a stub for a double precision sinh in libm, but this has since been removed, breaking sinh.

I noticed that cosh still works and that flang treats it a bit differently from sinh. For cosh a call to ROCDL is generated instead of a libm call. Changing sinh to work like cosh in this regard fixes the problem. I have a patch for this.


</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVM2O4zYTfBr60pBAU5Z_Djp41ytgge9DsEGQq9ASmxIz_BFIyuN5-4CSdyYTILcAAXiwSVazqlTdGKMeHVHD6i-svu1wSZMPze9E3_6_6718a9iRPxe_zsGPAS0skbqo3cT4VdvZ6EEncN4R49dAaIBVV1Zd4cH49QGsugEva8avTOyZOHg7Q8IwUgKLMxPnBxOX95tr2fe9DwQ5-UStPLR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