Bug 3364 - PATCH: allow usage of system libjpeg
Status: RESOLVED WONTFIX
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: 1.34
Hardware: PC Linux
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2007-09-25 16:22 EDT by Hans de Goede
Modified: 2007-09-26 18:50:57 EDT
0 users

See Also:


Attachments
PATCH: allow usage of system libjpeg (11.81 KB, patch)
2007-09-25 16:23 EDT, Hans de Goede
New patch which makes system jpeg use quake3's Malloc and Free (12.80 KB, patch)
2007-09-26 11:07 EDT, Hans de Goede

Description Hans de Goede 2007-09-25 16:22:50 EDT
I'm the Fedora maintainer of tremulous and today I've been working on creating a quake3 package for Fedora.

For this quake3 package I've adapteded a patch from tremulous (already send to them) which allows the usage of the system libjpeg instead of using the private copy bundled with quake3. I'm not sure if my current testing of quake3 has actually exercised any code paths which are involved. But the source code changes applied cleanly from tremulous, and with tremulous atleast the jpeg reading part  of tr_image.c has been tested (my initial code was wrong and caused clearly visual problems in tremulous).
Comment 1 Hans de Goede 2007-09-25 16:23:37 EDT
Created attachment 1524 [details]
PATCH: allow usage of system libjpeg
Comment 2 Martin Doucha 2007-09-25 17:52:20 EDT
See bug 2408
Comment 3 Hans de Goede 2007-09-26 11:07:27 EDT
Created attachment 1525 [details]
New patch which makes system jpeg use quake3's Malloc and Free

Okay, here is a new version which makes the system libjpeg use quake's Malloc and Free, just like its done with the included libjpeg copy. This depends on Linux behavior that symbols in the executable will be used first when resolving symbols, even when resolving symbols for the library. I've verified this by adding printf's to these functions, and these got triggered. I don't know if this will work on other platforms so maybe using the system libjpeg should be made Linux only.

This should resolve the problem mentioned with this in bug 2408.
Comment 4 Tim Angus 2007-09-26 11:20:35 EDT
We've already rejected this before. libjpeg hasn't had an official release in nearly ten years so there aren't really any particularly compelling reasons to go down this route. If there are bugfixes/improvements to the libjpeg code that for whatever reason aren't present in ioq3 then feel free to submit patches.

Pros:
  * Marginally smaller binary and codebase
  * Updates to libjpeg inherited automatically

Cons:
  * Extra dependancy
  * Different code path needed for platforms that don't support dynamic linking and/or libjpeg
  * Extra glue required to deal with the fact libjpeg differs from the static jpeg code with q3
  * Bugs introduced by interfering with code that already "just works" on every platform
Comment 5 Joerg Dietrich 2007-09-26 13:22:14 EDT
May I respectfully suggest that we put this patch on the patches page?
IMHO this is a typical case the patches page was created for.
Comment 6 Tim Angus 2007-09-26 18:50:57 EDT
Yup, that makes sense.