Red Hat Bugzilla – Bug 242305
Compile libantlr with -fPIC
Last modified: 2007-11-30 17:12:06 EST
libantlr.a, as it is now, cannot be linked into a shared object (on x86_64, at
least). Can it be compiled with -fPIC?
PIC has an additional overhead that may not be desirable for others. I have
therefore added an extra libantlr-pic.a archive.
The fix is in antlr-2.7.7-1jpp.3.fc7.1 which has been pushed to updates-testing.
If you use rawhide, the fix is in antlr-2.7.7-1jpp.4.fc8. Please verify and let
me know if there are any problems.
Unfortunately that's enough configuration overhead to make it not worth using to me. I am willing to
perform a general test to see if libantlr exists on the system (and use it if it's available). I'm not going to
go down the path of checking for distribution-specific library names.
If Fedora doesn't want libantlr.a compiled with PIC, I submit that the Right Thing is to provide libantlr.so
antlr-2.7.7-1jpp.3.fc7.1 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report.
Reopening. The idea is that using -lantlr when linking a shared library ought to work.
Sorry for the delayed response, and thanks for re-opening. I have un-pushed the
package until this gets resolved.
Regarding why I did not use PIC in libantlr, I am following the Debian way, and
for the exact same reasons they have, as stated in the last comment here:
It didn't seem right to introduce performance penalties for existing users who
do not need PIC (judging from the fact that this is the first bug asking for it
As far as the perception of low demand is concerned, I suspect most folks who
use libantlr have been doing the same thing I've been doing for years: including
it with their packages. And as it happens, I'm in the process of replacing antlr
in my project. So, don't fix this on my account.
That said, I do think it's important that "-lantlr" work when creating a shared
library. While one way to do that would be to compile libantlr.a with -fPIC,
another way would be simply to provide libantlr.so (which would necessarily be
compiled with -fPIC).
Though, once libantlr.so is available, I think the necessity of libantlr.a's
continued existence may be questionable (with respect to Fedora's policies
regarding static libraries).
I see your point about -lantlr working.
I toyed with the idea of providing a .so, but have decided against it for the
time being, as v2 doesn't seem like it is being actively worked on. A .so would
be better provided in the v3 rpm when it is available.
In the mean time, I've removed the libantlr-pic.a (the update was never pushed
publically, so there is no compatibility issue). libantlr.a is now compiled with
-fPIC. The package should appear in updates-testing and rawhide soon; please
give it a try and let me know if there are any problems.
antlr-2.7.7-1jpp.3.fc7.2 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report.
antlr-2.7.7-1jpp.3.fc7.2 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.