Bug 34120 - patches to build with gcc-2.96 on Red Hat Linux 7.1
Summary: patches to build with gcc-2.96 on Red Hat Linux 7.1
Status: RESOLVED NOTABUG
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-09 20:49 UTC by William Bader
Modified: 2011-02-11 13:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patches to build with gcc-2.96 on Red Hat Linux 7.1 (3.48 KB, patch)
2011-02-09 20:49 UTC, William Bader
Details | Splinter Review

Description William Bader 2011-02-09 20:49:04 UTC
Created attachment 43181 [details] [review]
patches to build with gcc-2.96 on Red Hat Linux 7.1

These patches allow poppler to build on older systems.
Add checks in goo/TiffWriter.cc that newer tiff macros exist before trying to use them.
Add definition of isfinite() in poppler/SplashOutputDev.cc for glibc < 2.3.
Add definitions of fmax() and fmin() in poppler/TextOutputDev.cc for glibc < 2.3
Use [i] instead of at(i) for vectors in poppler/XRef.cc for glibc < 2.3
Comment 1 Albert Astals Cid 2011-02-10 01:06:16 UTC
I doubt we are interesting in adding extra cruft to our code to support something that is 10 years old.
Comment 2 William Bader 2011-02-10 06:19:42 UTC
>I doubt we are interesting in adding extra cruft 

OK.  If you want, I can resubmit two of the changes that might be useful for other systems and do not refer to gcc parts with just the patches for TiffWriter.cc and the patches to XRef.cc (modified to use [] instead of at() in all cases instead of checking the glibc version).

The RH7 system is one of my oldest build servers.  I still have some old systems to support.  I compile C programs with gcc-4.4.5, but for C++, I need to use the old RH7 gcc so that I don't have to rebuild and distribute all of the libraries.  RH7 generates incorrect code for poppler (and for xpdf) unless I compile with -O0.

If anyone needs to do a build on an old system, this is what I built, in the order that I built it:
m4-1.4.15
autoconf-2.68
automake-1.11.1
libtool-2.4
gettext-0.18.1.1
pkg-config-0.25
freetype-2.4.4
fontconfig-2.8 (configure with HASDOCBOOK=no, comment "DOCSRC = doc" in Makefile, link with -Wl,-rpath,/usr/local/lib/ to avoid picking up the older freetype in /usr/lib)
poppler (compile with -O0, link with -Wl,-rpath,/usr/local/lib/)
Comment 3 Albert Astals Cid 2011-02-10 16:23:56 UTC
I am confused by the [] -> at() change. I very much doubt this has nothing to do with glibc since std::vector is not in the "C library" but in the "C++ library", right?
Comment 4 William Bader 2011-02-10 18:47:05 UTC
>I am confused by the [] -> at() change. I very much doubt this has nothing to
do with glibc since std::vector is not in the "C library" but in the "C++
library", right?

Yes, RedHat Linux 7.1 has version 3 of the gnu g++ library, and it contains a 1996 version of STL.  As far as I can tell, it does not make any version numbers available as macros.  I searched all of the files in /usr/include/g++-3.  If you have suggestions of what to test for, I can check the files.

I was thinking to replace at() with [] unconditionally.  It should be safe because at() is used in only two loops, and the upper limit of both loops is the size() of the vector, so the bounds check provided by at() shouldn't be necessary.
Comment 5 Albert Astals Cid 2011-02-11 11:44:23 UTC
Personally i don't think we should commit any of these patches since those products are too old that i would say they are unsupported. But if you really disagree please mail the poppler mailing list and see if you can find any other supporter. Meanwhile i will close the bug and we can reopen it if the majority thinks it is worth supporting such old setups.
Comment 6 William Bader 2011-02-11 13:20:27 UTC
>i don't think we should commit any of these patches

That is ok.  The RH 7.1 system was my oldest server, and I was using it to do builds that could run on all of the servers, but since its old gcc-2.96 generated bad code unless I compiled with -O0, and since pdftops is cpu intensive, it wouldn't make sense to run the unoptimized RH 7.1 pdftops on a newer system.
My second oldest build server has CentOS 4.8, and poppler builds on it without problems.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.