EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Building a self-contained shareable library
From: Janet Anderson <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: [email protected]
Date: Thu, 27 Sep 2012 10:08:21 -0500
You could try adding the following lines to the Makefile that creates the shareable library.

SHARED_LIBRARIES = YES
STATIC_BUILD = YES
<libraryname>_LDFLAGS = $(STATIC_LDFLAGS)

On 09/26/2012 05:56 PM, Andrew Johnson wrote:
Hi Mark,

On 2012-09-26 Mark Rivers wrote:
I would like to build an EPICS shareable library on Linux that is
self-contained, i.e. it does not depend on any other shareable library.
For example, with IDL I would like libezcaIDL.so to not depend on
libca.so, libCom.so, libezca.so, and libEzcaScan.so.
...
But I am looking for a cleaner solution.  When EPICS is built with
SHARED_LIBRARIES=YES it actually builds both .a and .so files for every
library.  I would like a way to specify that ezcaIDL should be built as a
.so file, but it should be linked with .a files for everything it depends
on.

Is there a way to do this?

You can change the command that we use to link a shared library by modifying
the variable LINK.shrlib in your Makefile.  The value for this variable is set
in one or more of the Base/configure/os/CONFIG.* files according to your
platform.  For GNU-based platforms we actually use g++ to do the linking
because it has to do more than the ld program normally does when linking C++
code.

Your replacement linker command should use the the -Wl,-Bstatic command-line
option (or any of its synonyms which I won't list here) immediately before any
-l options naming libraries that you want to statically link against, then -
Wl,-Bdynamic (or its synonyms) before the -l options naming shared libraries.
You'll probably want to run this manually to get the right combination.

The EPICS build system doesn't have a way to do this automatically, and I
think it would be rather complicated to try to make it do so.  Note that the
resulting Makefile rule probably won't be portable; the above options apply to
the GNU linker, you may have to adjust them for other platforms you want to
use.

HTH,

- Andrew

Replies:
RE: Building a self-contained shareable library Mark Rivers
References:
Building a self-contained shareable library Mark Rivers
Re: Building a self-contained shareable library Andrew Johnson

Navigate by Date:
Prev: EPICS Collaboration Meeting October 2012 : Agenda update Ilyou Kim
Next: RE: Building a self-contained shareable library Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Building a self-contained shareable library Andrew Johnson
Next: RE: Building a self-contained shareable library Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·