EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
<== Date ==> <== Thread ==>

Subject: LINKER_USE_RPATH ignored on darwin systems
From: Colby Sparks via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Thu, 21 Nov 2024 16:22:53 -0800
I am building a motor driver which makes use of a 3rd party library
that requires its runtime load path be specified during linking.

For linux builds this works fine. If LINKER_USE_PATH=YES, then the
build system will add rpath arguments for all of the libs in
PROD_DEPLIB_DIRS
(https://urldefense.us/v3/__https://github.com/epics-base/epics-base/blob/b7cc33c3c9c1a6cc14290b9a558e97bd89171e80/configure/os/CONFIG.Common.linuxCommon*L26-L27__;Iw!!G_uCfscf7eWS!aQd1UvUH3P8dEftuqQH-HKm-bSaFaUum_-Rbr4CXcTjCNXcCMGwnJd665ADvo-z9AGElFxGyMqYTQFWiMSzxAGm2xBE$ ).
For darwin builds, however, it seems that the default build
configuration ignores LINKER_USE_RPATH and will never add rpaths. This
means an IOC which uses my driver will fail to load its shared libs at
runtime.

I could add the following to my example IOC's CONFIG_SITE file and
make a note that users do the same:

ifneq ($(filter darwin-%, $(T_A)),)
PRODDIR_RPATH_LDFLAGS_YES += $(PROD_DEPLIB_DIRS:%=-Wl,-rpath,%)
PRODDIR_LDFLAGS += $(PRODDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH))
endif

But I am wondering if this is ill-advised. I am not very familiar with
the EPICS build system, so I imagine that there is a better way to
make this work. I am also curious why LINKER_USE_RPATH is ignored by
default when building for macOS.

System:
Apple M3 Pro, macOS 14.4.1, clang 15.0.0

Colby Sparks

Replies:
Re: LINKER_USE_RPATH ignored on darwin systems Michael Davidsaver via Core-talk

Navigate by Date:
Prev: Build failed: EPICS Base 7 base-7.0-1372 AppVeyor via Core-talk
Next: Build failed: EPICS Base 7 base-7.0-1373 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
Navigate by Thread:
Prev: Build failed: EPICS Base 7 base-7.0-1372 AppVeyor via Core-talk
Next: Re: LINKER_USE_RPATH ignored on darwin systems Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025