Bug 313231 - Unable to link against libhspell
Summary: Unable to link against libhspell
Alias: None
Product: Fedora
Classification: Fedora
Component: hspell (Show other bugs)
(Show other bugs)
Version: 9
Hardware: All Linux
Target Milestone: ---
Assignee: Dan Kenigsberg
QA Contact: Fedora Extras Quality Assurance
: 189233 430354 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2007-09-30 18:04 UTC by Greg Martyn
Modified: 2008-10-27 22:54 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-27 22:54:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
this would work I reckon (295.40 KB, application/x-rpm)
2008-05-14 15:48 UTC, Caolan McNamara
no flags Details

Description Greg Martyn 2007-09-30 18:04:06 UTC
Description of problem:
unable to link against libhspell

Version-Release number of selected component (if applicable):
hspell-devel x86_64 1.0-6.fc7

How reproducible:

Steps to Reproduce:
1.try to compile kde4
Actual results:
Linking CXX shared module ../../../lib/kspell_hspell.so
/usr/bin/ld: /usr/lib64/libhspell.a(gimatria.o): relocation R_X86_64_32S 
against `a local symbol' can not be used when making a shared object; 
recompile with -fPIC
/usr/lib64/libhspell.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/kspell_hspell.so] Error 1

Expected results:
sweet silence

Additional info:

Comment 1 Nadav Har'El 2007-10-01 06:40:59 UTC
On some systems (I believe i386 isn't one of these, but maybe "x86_64" is?), for
code to be in a shared library it needs to be compiled as "position independent
code", with the "-fPIC" parameter.

We can give two kinds of replies to this bug report.

The first is "this is not a bug" - libhspell.a is not position-independent-code,
and was not meant for inclusion in a shared library. kspell_hspell.so (whatever
that is) can use libhspell.a but cannot include it, and the program using this
library will need to statically link with libhspell.a

The second kind of reply is that this *is* a problem, because presumably
kspell_hspell.so is some sort of plug in that can come instead of
kspell_english.so (or whatever) at run-time, and we cannot ask the compilation
to also include libhspell.a. So in this sense, it might make sense to solve this
problem. And I can see two ways to do this. One is to continue creating an
archive (libhspell.a), just compile the individual source files with -fPIC (if
configure finds that such an option is available - usually in gcc). 
The second way is to use libtool (for example) and create a full-fleged share
library in a portable way.
There's a patch in hspell's bugzilla to do these things. However, I want to
avoid using "automake" at all cost (I personally think it's a redundant tool),
and would rather use -fPIC and/or libtool directly.
There's a small performance penalty for the resulting code compiled with -fPIC
(reportedly, around 5%) but it's negligable.

Comment 2 Kevin Kofler 2007-10-18 20:09:25 UTC
I just hit this while trying to package KDE 4.0 Beta 3. I had to drop the 

I disagree about this not being a bug:
1. packages shouldn't ship static libraries only in the first place and
2. if they do, the static library MUST be compiled with -fPIC, or both 
PIC/non-PIC versions be provided, there's no way around it, and this bug is 
exactly why.

Comment 3 Dan Kenigsberg 2007-10-29 18:53:14 UTC
pardon my ignorance, but would adding something brutal like
gcc -shared -o libhspell.so dict_radix.o gimatria.o corlist.o libhspell.o
to the spec file suffice? (and make with CFLAGS="-O2 -fPIC")

Comment 4 Kevin Kofler 2008-01-27 03:37:31 UTC
*** Bug 430354 has been marked as a duplicate of this bug. ***

Comment 5 Caolan McNamara 2008-01-28 08:21:27 UTC
There's a quick-and-dirty-hack suggestion in 430354 FWIW. enchant's hspell
integration suffers from the same problem now also.

Comment 6 Caolan McNamara 2008-02-14 12:28:25 UTC
*** Bug 189233 has been marked as a duplicate of this bug. ***

Comment 7 Bug Zapper 2008-05-14 14:35:06 UTC
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Kevin Kofler 2008-05-14 15:43:27 UTC
Not fixed yet, bumping.

Comment 9 Caolan McNamara 2008-05-14 15:48:49 UTC
Created attachment 305374 [details]
this would work I reckon

Comment 10 Kevin Kofler 2008-10-24 04:29:56 UTC
I see that a fix was committed on May 14 (version 1.0-9), but never actually got built (Rawhide has only 1.0-8.fc9), can this be built?

Then support for hspell could also be reenabled in enchant. However, it should be an optional enchant-hspell subpackage, just like aspell and voikko.

As for KDE, I think linking KDE directly against hspell is not useful if it's supported through enchant. Sonnet (KDE's spellchecking code) uses enchant for a reason.

Note You need to log in before you can comment on or make changes to this bug.