EPICS Home

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  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 
<== Date ==> <== Thread ==>

Subject: Cross compiling
From: Florian Feldbauer via Tech-talk <tech-talk@aps.anl.gov>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 29 Aug 2019 20:33:08 +0200
Dear all,

I have a question concerning cross-compiling EPICS base. I'm trying to cross-comile base 7.03. for linux-arm on my linux-x86_64 host system.

My configure/os/CONFIG_SITE.linux-x86-64.linux-arm looks like this

GNU_TARGET = arm-angstrom-linux-gnueabi
GNU_BIN = /opt/cross-compiler/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi
COMMANDLINE_LIBRARY = READLINE_NCURSES
USR_CFLAGS += -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/iseg/cross-compiler/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi USR_CXXFLAGS += -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/iseg/cross-compiler/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi

Looking at the compiler commands executed by make below, only the USR_CFLAGS are used when compiling c files, but the CXXFLAGS are ignored.

/opt/iseg/cross-compiler/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE         -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/opt/iseg/cross-compiler/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -DUNIX  -Dlinux     -O3 -g   -Wall     -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/opt/iseg/cross-compiler/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -fPIC -I. -I../O.Common -I. -I../../src/osi/compiler/gcc -I../../src/osi/compiler/default -I. -I../../src/osi/os/Linux -I../../src/osi/os/posix -I../../src/osi/os/default -I.. -I../../src/as -I../../src/bucketLib -I../../src/calc -I../../src/cvtFast -I../../src/cppStd -I../../src/cxxTemplates -I../../src/dbmf -I../../src/ellLib -I../../src/env -I../../src/error -I../../src/fdmgr -I../../src/flex -I../../src/freeList -I../../src/gpHash -I../../src/iocsh -I../../src/log -I../../src/macLib -I../../src/misc -I../../src/osi -I../../src/pool -I../../src/ring -I../../src/taskwd -I../../src/timer -I../../src/yacc -I../../src/yacc -I../../src/yajl -I/opt/epics/base/include/compiler/gcc -I/opt/epics/base/include/os/Linux -I/opt/epics/base/include -I/opt/epics/base/include/compiler/gcc -I/opt/epics/base/include/os/Linux -I/opt/epics/base/include         -c ../../src/yajl/yajl_parser.c

/opt/iseg/cross-compiler/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-g++ -o libCom.so.3.17.5 -shared -fPIC -L/opt/epics/base/lib/linux-arm -Wl,-rpath,/opt/epics/base/lib/linux-arm -rdynamic          asLib.o asTrapWrite.o bucketLib.o postfix.o calcPerform.o cvtFast.o resourceLib.o epicsSingletonMutex.o dbmf.o ellLib.o ellSort.o envSubr.o envData.o errlog.o errSymLib.o errSymTbl.o fdmgr.o fdManager.o freeListLib.o gpHashLib.o iocsh.o initHooks.o registry.o libComRegister.o iocLog.o logClient.o macCore.o macEnv.o macUtil.o alarmString.o aToIPAddr.o adjustment.o cantProceed.o epicsConvert.o epicsExit.o epicsStdlib.o epicsString.o truncateFile.o ipAddrToAsciiAsynchronous.o epicsUnitTest.o epicsThread.o epicsMutex.o epicsEvent.o epicsTime.o epicsMessageQueue.o epicsMath.o epicsAtomicOSD.o epicsGeneralTime.o osiClockTime.o osdSock.o osdSockAddrReuse.o osiSock.o systemCallIntMech.o epicsSocketConvertErrnoToString.o osdAssert.o osdFindSymbol.o osdInterrupt.o osdPoolStatus.o osdSignal.o osdEnv.o epicsReadline.o epicsTempFile.o epicsStdio.o osdStdio.o osdThread.o osdThreadExtra.o osdThreadHooks.o osdMutex.o osdSpin.o osdEvent.o osdTime.o osdMonotonic.o osdProcess.o osdNetIntf.o osdMessageQueue.o devLibVME.o devLibVMEOSD.o epicsStackTrace.o osdBackTrace.o osdFindAddr.o poolJob.o threadPool.o epicsRingPointer.o epicsRingBytes.o taskwd.o epicsTimer.o timer.o timerQueue.o timerQueueActive.o timerQueueActiveMgr.o timerQueuePassive.o yajl.o yajl_alloc.o yajl_buf.o yajl_encode.o yajl_gen.o yajl_lex.o yajl_parser.o       -lpthread   -lreadline -lncurses -lm -lrt -ldl -lgcc
The last command breaks because the --sysroot option is missing and the compiler doesn't find it's libraries.

Did I do something wrong? What is the correct way to define default C compiler and C++ compiler flags when cross-compiling?

Best regards,
Florian

--
Dr. Florian Feldbauer

Ruhr-Universität Bochum
Experimentalphysik I AG
Universitätsstr. 150
Fach-Nr. 125
D-44801 Bochum

Office: NB 2/134
Phone:  (+49)234 / 32-23563
Fax:    (+49)234 / 32-14170
https://paluma.ruhr-uni-bochum.de


Replies:
Re: Cross compiling Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: RE: Force AsynPortDriver to write an output record's value to the device instead of fetching it Mark Rivers via Tech-talk
Next: Re: Cross compiling Johnson, Andrew N. 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 
Navigate by Thread:
Prev: Re: Force AsynPortDriver to write an output record's value to the device instead of fetching it Mark Rivers via Tech-talk
Next: Re: Cross compiling Johnson, Andrew N. 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