Problem
Excerpt |
---|
|
jasper library that has been linked statically is trying to be linked into a dynamic libgrib_api.so. Libraries linked to a dynamic library must use "relocatable" code, and normally static libraries aren't. Possible solutions |
Getting an "relocation R_X86_64_32 against `.bss' cannot be used when making a shared object; recompile with -fPIC"
Solution
Like for example the following case
Code Block |
---|
/usr/bin/ld: /usr/local/lib/libjasper.a(jas_image.o): relocation R_X86_64_32 against `.bss' cannot be used when making a shared object; recompile with -fPIC
/usr/local/lib/libjasper.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make1: *** libgrib_api.la Error 1
make1: Leaving directory `src'
make: *** install-recursive Error 1
|
Solution
Panel |
---|
|
A jasper library that has been linked statically is trying to be linked into a dynamic libgrib_apilibeccodes.so. Libraries linked to a dynamic library must use "relocatable" code, and normally static libraries aren't. Possible solutions are: - If possible, use a dynamic version of jasper. Build it with support for static libraries. Most rpm or deb packages already include a dynamic version that will be taken in preference. Or
- Build jasper with the "-fPIC" CFLAG. In that case even the static library will be relocatable.
- Use the "--disable-shared" option in grib_apiDisable shared libraries in ecCodes. In this case no dynamic library will be produced (just the static version) and the problem won't be applicable any more.
|
Related articles
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | ~usa |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = in ("kb-troubleshooting-article","eccodes-faqs","jasper","installation","shared-libraries","relocation","fpic") and type = "page" and space = "UDOC" |
---|
labels | kb-troubleshooting-article |
---|
|
...