fixes #22798; Duplicate libraries linker warning (i.e., '-lm') on macOS (#23292)

fixes #22798

Per
https://stackoverflow.com/questions/33675638/gcc-link-the-math-library-by-default-in-c-on-mac-os-x
and
https://stackoverflow.com/questions/30694042/c-std-library-dont-appear-to-be-linked-in-object-file

> There's no separate math library on OSX. While a lot of systems ship
functions in the standard C math.h header in a separate math library,
OSX does not do that, it's part of the libSystem library, which is
always linked in.

required by https://github.com/nim-lang/Nim/pull/23290
This commit is contained in:
ringabout
2024-06-02 09:36:20 +08:00
committed by GitHub
parent cdfc886f88
commit de4c7dfdd9
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@
## The types, vars and procs are bindings for the C standard library
## [<fenv.h>](https://en.cppreference.com/w/c/numeric/fenv) header.
when defined(posix) and not defined(genode):
when defined(posix) and not defined(genode) and not defined(macosx):
{.passl: "-lm".}
var

View File

@@ -155,7 +155,7 @@ func fac*(n: int): int =
{.push checks: off, line_dir: off, stack_trace: off.}
when defined(posix) and not defined(genode):
when defined(posix) and not defined(genode) and not defined(macosx):
{.passl: "-lm".}
const