<div dir="ltr">Hi,<div><br></div><div>I wanted to try to fix a problem I reported on swift-users@ and in <a href="https://bugs.swift.org/browse/SR-638">SR-638</a> where Glibc doesn&#39;t have a tgmath overlay.  This means that, for example, sin(Float(1.23)) works on Darwin but won&#39;t compile on Linux.</div><div><br></div><div><div>As an experiment, I tried just symlinking the Darwin tgmath to Glibc and fixing some things to make it compile and test. You can take a look here: <a href="https://github.com/tchagnon/swift/commit/742eff3914f2a62e799980523badaca4eeee95fe">https://github.com/tchagnon/swift/commit/742eff3914f2a62e799980523badaca4eeee95fe</a></div><div><br></div><div>I ran into a couple issues that I had questions about or couldn&#39;t figure out:</div><div><br></div><div>1. What&#39;s the best way for tgmath.swift.gyb to be shared between both Darwin and Glibc? Move it to a common location and symlink? Would it be better to have a common Math module? It would be a lot nicer if I could just import Math instead of the preprocessor block to switch between Darwin/Glibc.</div><div><br></div><div>2. @_silgen_name doesn&#39;t appear to work on Linux. I get linker errors or hidden symbol `_swift_Glibc_ilogb&#39; isn&#39;t defined if I try to set up an extern function in Misc.c. Is this known? How do I work around this to avoid the ambiguous overloading in the case of ilogb(CDouble) -&gt; CInt.</div></div><div><br></div><div>Thanks,</div><div>Tim</div></div>