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: Cross-compilation, static build, etc
From: Bruno Seiva Martins <[email protected]>
To: [email protected]
Date: Thu, 2 Aug 2012 09:32:31 -0300
Hi

I'm back =) I'm having a problem deploying an IOC that I developed. I'm using a 64-bits Linux box as a host and I want to target a 32-bits Linux box. EPICS build system compiles my 32-bits executable just fine, but when I try to run it in my 32-bits box (without any EPICS software whatsoever), I get errors. Specifically:

/lib/libc.so.6: version 'GLIBC_2.15' not found (required by lib/libCom.o)

Obviously, I have a version problem regarding the GLIBC: the host's version is 2.15 and the target's is 2.7. Investigating further on, the culprit is a symbol inside libCom.so:

$ objdump -T libCom.so | fgrep GLIBC_2.15
00000000      DF *UND* 00000000  GLIBC_2.15  __fdelt_chk

This is the only symbol that requires GLIBC 2.15. I looked at other symbols from libCom.so and from other EPICS shared objects and it seemed that they required versions below 2.5, which my target's GLIBC 2.7 could handle nicely.


Nevertheless, I looked around for solutions:

1. Upgrade GLIBC version in the target

The Linux distribution used does not provide an easy way to do so. The highest version I found easily available was 2.9. If all else fails, I might try this again. I would like to stick with this distribution, if possible.


2. Downgrade host's GLIBC

I'm using Ubuntu. It seems a long gap between 2.7 and 2.15 versions of GLIBC, so I couldn't find a package to just 'apt-get' it. Again, I might investigate this further if no other solution comes around.


3. Copy my host's GLIBC into my target

That was a long shot. Didn't work.


4. Static build my IOC

That is the option I like the best. Ideally I would want to just compile everything into an executable, drop that executable in my target box and then run it.  Seems that a statically buily executable would nicely fulfill that purpose. I really don't care about the file size.

I'm not familiar with the EPICS build system, so I tried to statically build my IOC by just adding 'LDFLAGS= -static' to my Makefile. This produced scary warnings and a million errors about the linker not finding pthread symbols.

Then I tried to put a 'STATIC_BUILD=YES' somewhere, but didn't know where exactly. I decided to put it in my application's configure/CONFIG_SITE. After I ran make again, the only difference I noted was the addition of '-Bstatic' to the g++ flags.

According to the manual (man g++):

---
VxWorks Options

       The options in this section are defined for all VxWorks targets.  Options specific to the target hardware are listed with the other options for
       that target.

       (...)

       -Bstatic
       -Bdynamic
           These options are passed down to the linker.  They are defined for compatibility with Diab.
---

Well, my target definitely isn't VxWorks...




So, finally, my questions:

Is it possible to make a static build of an IOC for x86 from a 64bits host? I searched EPICS documentation, but without much success...
Are there other solutions/alternatives? Maybe (most likely) I'm missing something here... 



Thanks in advance!




--
Bruno Seiva Martins



Replies:
RE: Cross-compilation, static build, etc Mark Rivers

Navigate by Date:
Prev: How to scale waveform of integers to float? Benjamin Franksen
Next: Re: How to scale waveform of integers to float? Dirk Zimoch
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: How to scale waveform of integers to float? Dirk Zimoch
Next: RE: Cross-compilation, static build, etc 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 ·