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  <20192020  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Linker error with vendor library
From: Michael Davidsaver via Tech-talk <[email protected]>
To: Mark Rivers <[email protected]>
Cc: tech-talk <[email protected]>
Date: Fri, 6 Dec 2019 23:47:38 -0800
On 12/6/19 7:24 PM, Mark Rivers via Tech-talk wrote:
> Folks,
> 
> 
> I am trying to build the EPICS Xspress3 driver.  It builds fine on Centos 7 with gcc 4.5
> 
> 
> On Ubuntu 18 with gcc 7.4 I get this error:
> 
> 
> *************
> 
> /usr/bin/ld: /corvette/home/epics/devel/areaDetector-3-8/xspress3-2-2/lib/linux-x86_64-ub18/libimg_mod.a(img_mod_linux.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> /corvette/usr/local/epics-devel/base-7.0.3.1/configure/RULES_BUILD:212: recipe for target 'xspress3App' failed
> make[1]: *** [xspress3App] Error 1
> 
> *************
> 
> libimg_mod.a is a pre-built library provided by the vendor.  Is there something I can change in the link options to avoid this error, or do we need to get a new library from the vendor?

You could try passing '-no-pie' when linking the xspress3App executable.

Having libimg_mod.a recompiled with -fPIC would probably be the desirable long term solution.

Running

> readelf -r libimg_mod.a |grep R_X86_64_32

might show something interesting, like whether the relocation
is referring to an internal name, or eg. something from libc

Replies:
Re: Linker error with vendor library Mark Rivers via Tech-talk
References:
Linker error with vendor library Mark Rivers via Tech-talk

Navigate by Date:
Prev: Linker error with vendor library Mark Rivers via Tech-talk
Next: Re: Linker error with vendor library 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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Linker error with vendor library Mark Rivers via Tech-talk
Next: Re: Linker error with vendor library 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  <20192020  2021  2022  2023  2024 
ANJ, 07 Dec 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·