-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Link game, cgame, ui modules to $(LIBS) #461
base: main
Are you sure you want to change the base?
Conversation
I have versions of this patch for OpenArena and iortcw, which I'll send to their respective developers at some point, but I wanted to see whether there were comments on the best approach to this in ioquake3 first. @ensiform, FYI: OpenJK doesn't seem to need a similar change, because all your linking is done with the C++ compiler, which pulls in |
If people would prefer this, please say. |
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. Based on ioquake3 pull request <ioquake/ioq3#461>. Bug-Debian: https://bugs.debian.org/966150 Bug-Debian: https://bugs.debian.org/966173
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. Similar to ioquake3 PR <ioquake/ioq3#461>. Bug-Debian: https://bugs.debian.org/966150 Bug-Debian: https://bugs.debian.org/966173
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. Similar to ioquake3 PR <ioquake/ioq3#461>. Bug-Debian: https://bugs.debian.org/966150 Bug-Debian: https://bugs.debian.org/966173
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.
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.
Or I could separate out $(LIBM) (defined to
-lm
or empty, depending on platform) from $(LIBS), if preferred; please let me know.