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 2022 <2023> 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 2022 <2023> 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Why does libca.so depend on libreadline.so? |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | Simon Rose <Simon.Rose at ess.eu>, "Dmitry Yu. Bolkhovityanov" <D.Yu.Bolkhovityanov at inp.nsk.su> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Fri, 12 May 2023 15:06:29 +0000 |
I now recall that when I built my IOCs with base 7.0.7 command line recall did not work on Centos 7. The automatic detection of
the readline support does not work with older versions of gcc.
I posted the issue to core-talk:
Thus, on the advice of Michael Davidsaver I made this edit:
diff --git a/configure/toolchain.c b/configure/toolchain.c
index 2f76b475b..da4e8bb2c 100644
--- a/configure/toolchain.c
+++ b/configure/toolchain.c
@@ -45,5 +45,5 @@ COMMANDLINE_LIBRARY ?= READLINE
COMMANDLINE_LIBRARY ?= EPICS
# endif
#else
-COMMANDLINE_LIBRARY ?= EPICS
+COMMANDLINE_LIBRARY ?= $(strip $(if $(wildcard $(if $(GNU_DIR),$(GNU_DIR)/include/readline/readline.h)), READLINE, EPICS))
#endif
With that edit command line recall does work, and base 7.0.7 libCom.so does depend on libreadline.
This is base 7.0.7 on Centos 7. It depends on libreadline.so.6.
corvette:local/epics-devel/base-7.0.7>ldd lib/linux-x86_64/libCom.so
linux-vdso.so.1 => (0x00007ffe673d6000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f171eec5000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f171ec7f000)
librt.so.1 => /lib64/librt.so.1 (0x00007f171ea77000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f171e873000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f171e56b000)
libm.so.6 => /lib64/libm.so.6 (0x00007f171e269000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f171e053000)
libc.so.6 => /lib64/libc.so.6 (0x00007f171dc85000)
/lib64/ld-linux-x86-64.so.2 (0x00007f171f355000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f171da5b000)
This is base 7.0.7 on Centos 8. It depends on libreadline.so.7.
Last login: Sun Apr 30 16:49:17 2023 from 164.54.160.82
[epics@viper ~]$ cd /corvette/usr/local/epics-devel/base-7.0.7
[epics@viper base-7.0.7]$ ldd lib/linux-x86_64-centos8/libCom.so
linux-vdso.so.1 (0x00007ffc88315000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa3a7c94000)
libreadline.so.7 => /lib64/libreadline.so.7 (0x00007fa3a7a45000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa3a783d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa3a7639000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fa3a72a4000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa3a6f22000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa3a6d0a000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa3a6945000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3a812a000)
libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fa3a6718000)
This is Ubuntu 22. It depends on libreadline.so.8.
TahoeU18:/corvette/usr/local/epics-devel/base-7.0.7> ldd lib/linux-x86_64-ub18/libCom.so
linux-vdso.so.1 (0x00007ffc6bbf9000)
libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (0x00007f2b0101d000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2b00df3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2b00d0c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2b00cec000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2b00ac2000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f2b00a90000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2b0110a000)
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Dmitry Yu. Bolkhovityanov via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, May 12, 2023 9:29 AM To: Simon Rose <Simon.Rose at ess.eu> Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: Re: Why does libca.so depend on libreadline.so? Hi Simon,
On Fri, 12 May 2023, Simon Rose wrote: > Hi Dmitry - > > I do not get the same results as you. When I build various version of EPICS base (e.g. 7.0.4, 7.0.5) for linux-x86_64, libCom also depends on readline at that point. I don't think the change that Michael linked is the source of this dependency. The key is 7.0.7: even 7.0.6.1's libCom.so does have a dependency on libreadline.so, while 7.0.7 do not. How Michael's patch achieves such an effect -- that's another question. I still don't understand the mechanism; I even did a "diff -Naurb base-7.0.6.1 base-7.0.7" (just sources, of course) and there's nothing regarding "readline" besides what patch does. In short -- as I understood it -- the patch just moves the "readline detection" from makefiles (which checked for .../include/readline/readline.h presence) into .c-files (via __has_include() builtin). But how the detection method (which is orthogonal to dependence) manages to relieve libCom.so from libreadline.so dependency -- I yet have to fugure out. With best regards, Dmitry |