build: Link game, cgame, ui modules to $(LIBS) #138
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All three modules call mathematical functions like
atan2()
. On glibcsystems, when compiled to native code with an ordinary C compiler
(as opposed to bytecode from
q3lcc
), they get the definition of thosefunctions from
libm
.Until now, they were not explicitly linked to
libm
, and instead reliedon 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 (whereatan2()
resolves to__atan2_finite()
), and used without recompilation on a post-2.31 versionof glibc (where
__atan2_finite()
has become a deprecated hidden symbolthat 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.Similar to ioquake3 PR ioquake/ioq3#461.
Bug-Debian: https://bugs.debian.org/966150
Bug-Debian: https://bugs.debian.org/966173