You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Lee Doron (JIRA)" <xe...@xml.apache.org> on 2011/01/25 01:54:45 UTC

[jira] Created: (XERCESC-1956) 64-bit binary distribution can't be statically linked into a shared library

64-bit binary distribution can't be statically linked into a shared library
---------------------------------------------------------------------------

                 Key: XERCESC-1956
                 URL: https://issues.apache.org/jira/browse/XERCESC-1956
             Project: Xerces-C++
          Issue Type: Bug
          Components: Build
    Affects Versions: 3.1.1
         Environment: Linux x86_64
            Reporter: Lee Doron
             Fix For: 3.1.2


I'm creating a shared object library that uses Xerces-C++. I'd prefer to link my code to the static library (libxerces-c.a). However, when I try to do that, I get a link error: "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC". (I've encountered this on Linux so far, but this is actually cross-platform code that will also run on Windows and Mac, so if there would be a similar problem on those platforms, please consider this bug to include them.) It appears that it is impossible to statically link a shared object against 64-bit code that is position dependent, since the shared object must contain only position-independent code. The static libraries can only be linked directly into an executable.

To fix this, I suggest that you please compile the static libraries for 64-bit Intel binary distributions such that they have position-independent code (the -fPIC option on gcc, as mentioned in the error above). Then it will be possible to link them either into an executable or into a shared object library. Thanks!


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1956) x86-64 binary distribution can't be statically linked into a shared library

Posted by "Lee Doron (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lee Doron updated XERCESC-1956:
-------------------------------

    Summary: x86-64 binary distribution can't be statically linked into a shared library  (was: 64-bit binary distribution can't be statically linked into a shared library)

> x86-64 binary distribution can't be statically linked into a shared library
> ---------------------------------------------------------------------------
>
>                 Key: XERCESC-1956
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1956
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.1.1
>         Environment: Linux x86-64
>            Reporter: Lee Doron
>             Fix For: 3.1.2, 3.2.0
>
>
> I'm creating a shared object library that uses Xerces-C++. I'd prefer to link my code to the static library (libxerces-c.a). However, when I try to do that, I get a link error: "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC". (I've encountered this on Linux so far, but this is actually cross-platform code that will also run on Windows and Mac, so if there would be a similar problem on those platforms, please consider this bug to include them.) It appears that it is impossible to statically link a shared object against 64-bit code that is position dependent, since the shared object must contain only position-independent code. The static libraries can only be linked directly into an executable.
> To fix this, I suggest that you please compile the static libraries for 64-bit Intel binary distributions such that they have position-independent code (the -fPIC option on gcc, as mentioned in the error above). Then it will be possible to link them either into an executable or into a shared object library. Thanks!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1956) 64-bit binary distribution can't be statically linked into a shared library

Posted by "Lee Doron (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lee Doron updated XERCESC-1956:
-------------------------------

    Fix Version/s: 3.2.0
      Environment: Linux x86-64  (was: Linux x86_64)

> 64-bit binary distribution can't be statically linked into a shared library
> ---------------------------------------------------------------------------
>
>                 Key: XERCESC-1956
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1956
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.1.1
>         Environment: Linux x86-64
>            Reporter: Lee Doron
>             Fix For: 3.1.2, 3.2.0
>
>
> I'm creating a shared object library that uses Xerces-C++. I'd prefer to link my code to the static library (libxerces-c.a). However, when I try to do that, I get a link error: "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC". (I've encountered this on Linux so far, but this is actually cross-platform code that will also run on Windows and Mac, so if there would be a similar problem on those platforms, please consider this bug to include them.) It appears that it is impossible to statically link a shared object against 64-bit code that is position dependent, since the shared object must contain only position-independent code. The static libraries can only be linked directly into an executable.
> To fix this, I suggest that you please compile the static libraries for 64-bit Intel binary distributions such that they have position-independent code (the -fPIC option on gcc, as mentioned in the error above). Then it will be possible to link them either into an executable or into a shared object library. Thanks!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org