celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Broekhuis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CELIX-4) Problems building Celix on x86_64 Linux
Date Wed, 25 May 2011 20:37:47 GMT

    [ https://issues.apache.org/jira/browse/CELIX-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039317#comment-13039317
] 

Alexander Broekhuis commented on CELIX-4:
-----------------------------------------

Hi Rob,

Thanks for the patch, looks good. -fPIC can be used for linking static libs to shared libs
on 32 bit as well, so the 32/64 bit check isn't really needed. Although some pages disagree
and some even mention that a static lib shouldn't be linked to a shared lib at all. If that
is really the case, we have to look at how we use the dependency manager. Building it as a
shared library by itself does work, but there are problems related to dynamically loading
multiple libraries from 1 bundle.

For now linking static libs to shared libs seems to work on linux 32 and 64, so I will leave
it as is (with the -fPIC fix for 64bit).

Background info: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3

> Problems building Celix on x86_64 Linux
> ---------------------------------------
>
>                 Key: CELIX-4
>                 URL: https://issues.apache.org/jira/browse/CELIX-4
>             Project: Celix
>          Issue Type: Bug
>         Environment: Linux xray 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Rob ten Hove
>            Priority: Minor
>         Attachments: fix_cmake_x86_64.patch
>
>
> Tried building Celix today on 64bit Linux, but encountered two problems:
> 1) Directory "deployer" is mentioned in /CMakeLists.txt, but doesn't exist:
> CMake Error at CMakeLists.txt:63 (add_subdirectory):
>   add_subdirectory given source "deployer" which is not an existing
>   directory.
> 2) Running cmake and then make causes linking problems:
> Linking C shared library libtracker_depman.so
> /usr/bin/ld: ../../dependency_manager/libdependency_manager.a(service_component.c.o):
relocation R_X86_64_32S against `service_init' can not be used when making a shared object;
recompile with -fPIC
> ../../dependency_manager/libdependency_manager.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[2]: *** [whiteboard/tracker_depman/libtracker_depman.so] Error 1
> make[1]: *** [whiteboard/tracker_depman/CMakeFiles/tracker_depman.dir/all] Error 2
> make: *** [all] Error 2
> Adding a global CFLAGS=-fPIC works, but I guess this is not a feasible solution. Building
a shared lib instead of a static one for dependency_manager works, but don't know if this
is feasible too.
> Solution that could work is adding a check for the platform for dependency_manager, and
then specifically adding -fPIC for that lib in case the platform is 64bit Unix.
> Found the latter suggestion on http://www.cmake.org/pipermail/cmake/2007-May/014350.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message