Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Link game, cgame, ui modules to $(LIBS)
All three modules call mathematical functions like atan2(). On glibc systems, when compiled to native code with an ordinary C compiler (as opposed to bytecode from q3lcc), they get the definition of those functions from libm. Until now, they were not explicitly linked to libm, and instead relied on the fact that libm is linked into the main executable. However, doing it this way defeats glibc's symbol-versioning mechanisms, and can fail in some situations, in particular binaries built with -ffast-math on a pre-2.31 version of glibc (where atan2() resolves to __atan2_finite()), and used without recompilation on a post-2.31 version of glibc (where __atan2_finite() has become a deprecated hidden symbol that is only available as a versioned symbol). When building shared libraries and loadable modules, it's most robust to link them explicitly to their dependencies, as is done here. $(LIBS) also includes -ldl, which is unnecessary but harmless.
- Loading branch information