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  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Issues building statically linked IOC
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: Érico Nogueira Rolim <erico.rolim at lnls.br>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 19 Oct 2022 08:49:17 -0700
On 10/18/22 07:16, Érico Nogueira Rolim wrote:
On 17/10/2022 17:49, Michael Davidsaver wrote:
On 10/17/22 11:08, Érico Nogueira Rolim via Tech-talk wrote:
Did I miss something about building a static IOC? Having to mess around
in the epics-base files doesn't seem ideal... To cover all my bases, I
also tried doing this on epics-base 7.0.7, which required the same steps
to spit out a static executable.

The developers of glibc try to discourage completely static linking
as some parts of libc.so will implicitly try to load plugin libraries
for things like user account database and hostname lookup.  There are
also some hardcoded paths which distro libraries may have changed.


I am aware of the glibc stance, but IMHO that's no reason for the build
system to keep me from building things statically myself. I'm not sure
what the current progress on this is, but a built-in DNS resolver for
statically linked applications was even being considered, seeing as
statically linked binaries have their place and that was a rather large
limitation for no good reason.

Of course "large limitation" is a matter of prospective :)
I guess at option like "STATIC_BUILD=REALLY" could be added.

STATIC_LDLIBS_REALLY = -static

My only slight reservation is about adding yet another build system
option which would likely not get much testing.  Then again, we have
no shortage of these already, so what is one more?


I'm interested in getting epics to work on musl libc as well (it just
needs some handling around the <execinfo.h> bits iirc), which is
statically linking friendly, and again the build system would be the
only thing stopping that from working out of the box once the source
issues are fixed.

Speaking of awareness of stances...

https://bugs.launchpad.net/epics-base/+bug/1892190

Since musl doesn't identify itself, you can define "__UCLIBC_MAJOR__"
as musl and uclibc have a similar set of idiosyncrasies.

OP_SYS_CPPFLAGS += -D__UCLIBC_MAJOR__



https://stackoverflow.com/questions/57476533/why-is-statically-linking-glibc-discouraged


(the first google result for "glibc static linking")

Of course, there are some cases where this may not practically be
avoided.  Such as you describe where (I assume) you don't have
access to the toolchain which was used to build the system libraries.

In such a case I guess you will have to hope for the best!


Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.


References:
Issues building statically linked IOC Érico Nogueira Rolim via Tech-talk
Re: Issues building statically linked IOC Michael Davidsaver via Tech-talk
Re: Issues building statically linked IOC Érico Nogueira Rolim via Tech-talk

Navigate by Date:
Prev: Re: Help compiling synApps for linux-arm: opcua missing S7-1500-server.db Marco A. Barra Montevechi Filho via Tech-talk
Next: Re: Db/Makefile infinite loop Han Lee via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: Issues building statically linked IOC Érico Nogueira Rolim via Tech-talk
Next: RE: Issues building statically linked IOC Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 19 Oct 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·