Hi Martin,
> -----Original Message-----
> From: [email protected] [mailto:tech-talk-
> [email protected]] On Behalf Of Martin Konrad
> Sent: Sunday, February 07, 2010 7:30 AM
> To: EPICS tech-talk
> Subject: cross compiling base on linux for win32
>
> Hi,
> I just succeeded in cross compiling base and my IOC for win32-x86 on
> linux-x86 and linux-x86_64 using MinGW.
>
> For all of you who want to give it a try, here is what I did:
>
> 1. Copy the attached files to <base>/configure/os/ 2. Set
> CROSS_COMPILER_TARGET_ARCHS=win32-x86-mingw in
> <base>/configure/CONFIG_SITE 3. cd <base> && make && make install
>
> Everything works fine and my IOC seems to run cleanly under Windows 7
> but I would feel better if I can run some tests. Are there any tools
> for testing cross builds?
>
> I want to build my IOC for Linux _and_ Windows but this requires some
> files to be different (e.g. st.cmd). Is there a way to build for both
> platforms from one source directory?
>
> Best regards
>
> Martin
>
> P.S.: I'm still using mingw32 3.4.4.20050522.1-2, mingw32-binutils
> 2.16.91-20050827.1-2 and mingw32-runtime 3.8-1 even with Ubuntu 9.10
> (Karmic) because newer packages in Debian/Ubuntu seem to be broken
> (some important libs for C++ exceptions etc. are missing).
This is the result of a change in the way Mingw 4.x does libstdc++ (not
sure if this is Debian or upstream) and the way EPICS builds (-D_DLL).
The issue is that setting -D_DLL causes all the system headers to expect
to link against a DLL. For some reason some (all?) symbols associated
with libstd++ are only available in a static library.
A simple workaround is to statically link everything. Another way is to
statically link the system libraries only. I'm don't think this is the
best solution, but it is as far as I got. See the attached patch.
I did this work last spring and haven't looked at it since. I may not
be remembering everything, but at the time it seemed to be working. I
could run the unit tests and softIoc under Wine. I tried again today
and running softIoc fails. I think this is a Wine issue though. It
seems to be failing when system() gets called with a NULL pointer.
Michael Davidsaver
NSLSII Controls Group
Brookhaven National Lab
Attachment:
0001-fix-mingw32-cross-build-dll-usage.patch
Description: 0001-fix-mingw32-cross-build-dll-usage.patch
- References:
- cross compiling base on linux for win32 Martin Konrad
- Navigate by Date:
- Prev:
StreamDevice and IRQs Benjamin Franksen
- Next:
epics build with cmake Davidsaver, Michael
- 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
- Navigate by Thread:
- Prev:
cross compiling base on linux for win32 Martin Konrad
- Next:
StreamDevice and IRQs Benjamin Franksen
- 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
|