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: Fwd: Re: Fwd: cross-compiling (kind of) with Buildroot
From: Jeong Han Lee via Tech-talk <[email protected]>
To: Pierrick M Hanlet <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 12 Aug 2019 17:44:11 +0200
Hi Pierrick,

I cannot answer the direct answer for this, because I don't have much experience on buildroot, but I would like to have one hint you may get help from this.

You can compile the pcre as a standard library within your cross compiling tools and put in somewhere (I think, your rootfs and target source path, then the default BASE configuration will find that library and header files while they are compiling StreamDevice.

You can select the branch pcre-8.38 in my personal "cloned" pcre repo : https://github.com/jeonghanlee/pcre


  HTH,
  Han


On 8/12/19 5:08 PM, Pierrick M Hanlet via Tech-talk wrote:
Hi all,
I've managed to get all of my support modules built apart from StreamDevice.
I can build it if I manually change the link statement to pick up the target
pcre library (the one in red), but I'd really like to fix it properly. This problem stems from the fact that Buildroot segregates its build tools and its target
binaries/libraries in separate directories:
  - /X/output/host/usr/686-buildroot-linux-uclibc/lib
and
  - /X/output/staging/usr/lib
where /X/ represents the full path.

/usr/local/products/elsd/conc405x/linux-3.16.7_generic/output/host/usr/bin/i686-buildroot-linux-uclibc-g++ -o streamApp -L/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/StreamDevice-2-8/lib/linux-686 -L/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/asyn4-35/lib/linux-686 -L/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/calc-R3-7-1/lib/linux-686 -L/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/sscan-2-11-2/lib/linux-686 -L/scratch/home/hanlet/platforms/conc405x/epicsDEV/base-3.14.12.8/lib/linux-686 -Wl,-rpath,/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/StreamDevice-2-8/lib/linux-686 -Wl,-rpath,/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/asyn4-35/lib/linux-686 -Wl,-rpath,/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/calc-R3-7-1/lib/linux-686 -Wl,-rpath,/scratch/home/hanlet/platforms/conc405x/epicsDEV/Support/sscan-2-11-2/lib/linux-686 -Wl,-rpath,/scratch/home/hanlet/platforms/conc405x/epicsDEV/base-3.14.12.8/lib/linux-686 -m32 -L/usr/local/products/elsd/conc405x/linux-3.16.7_generic/output/host/usr/i686-buildroot-linux-uclibc/lib streamApp_registerRecordDeviceDriver.o streamAppMain.o   -lstream -lasyn -lcalc -lsscan -lrecIoc -lsoftDevIoc -lmiscIoc -lrsrvIoc -ldbtoolsIoc -lasIoc -ldbIoc -lregistryIoc -ldbStaticIoc -lca -lCom  -lpcre -lpcre /scratch/products/elsd/conc405x/linux-3.16.7_generic/output/host/usr/bin/../lib/gcc/i686-buildroot-linux-uclibc/4.8.3/../../../../i686-buildroot-linux-uclibc/bin/ld: cannot find -lpcre /scratch/products/elsd/conc405x/linux-3.16.7_generic/output/host/usr/bin/../lib/gcc/i686-buildroot-linux-uclibc/4.8.3/../../../../i686-buildroot-linux-uclibc/bin/ld: cannot find -lpcre
collect2: error: ld returned 1 exit status

I've attempted to fix it by creating a RELEASE.Common.linux-686 file with:
PCRE_TARGET_LIB=/usr/local/products/elsd/conc405x/linux-3.16.7_generic/output/staging/usr/lib
PCRE_TARGET_INCLUDE=/usr/local/products/elsd/conc405x/linux-3.16.7_generic/output/staging/usr/include
but that didn't help.  I've also tried modifying to the streamApp/Makefile:
ifdef PCRE
PROD_LIBS += pcre
else
ifneq ($(words $(PCRE_LIB) $(PCRE_INCLUDE)),0)
PROD_SYS_LIBS_DEFAULT += pcre
PROD_SYS_LIBS_WIN32 += $(PCRE_LIB)\\pcre
SHRLIB_DEPLIB_DIRS += $(PCRE_LIB)
endif
ifneq ($(words $(PCRE_TARGET_LIB) $(PCRE_TARGET_INCLUDE)),0)
PROD_SYS_LIBS_DEFAULT += pcre
SHRLIB_DEPLIB_DIRS += $(PCRE_TARGET_LIB)
SHRLIB_DEPLIB_DIRS += $(OP_SYS_LDLIBS)
endif
endif
where the red text is my change.

Clearly, I don't understand what I'm doing.  Somehow StreamDevice build is different from other
modules.

Thanks,
Pierrick



On 7/8/19 12:12 PM, Johnson, Andrew N. wrote:
On 7/8/19 11:39 AM, Pierrick M Hanlet wrote:
My problems stem from when the cross compiler attempts to build test or examples.  I first saw it in seq (using 2.2.5) and then in asyn  (using 4-35).  The XXX.st and XXX.i files don't get copied to O.linux-686 directory.  So for seq, I copied in by hand (using the syntax which worked for HOST) all of the files in the list of TESTPROD_CROSS in ./seq/test/compiler/Makefile; the following attempt to compile, the next failure came from the next file that wasn't explicitly in the TESTPROD_CROSS
list in the Makefile.

For asyn:
/usr/local/products/elsd/vmivme7805/linux-3.16.7_generic/output/host/usr/bin/i686-buildroot-linux-uclibc-gcc -x c -E  -D_GNU_SOURCE -D_DEFAULT_SOURCE            -D_X86_  -DUNIX -Dlinux   -I. -I../O.Common -I. -I.. -I../../../include/os/Linux -I../../../include -I/home/hanlet/platforms/vmivme7805/epicsDEV/base/include/os/Linux -I/home/hanlet/platforms/vmivme7805/epicsDEV/base/include /usr/local/products/elsd/vmivme7805/linux-3.16.7_generic/output/staging/usr/include -I/usr/local/products/elsd/vmivme7805/linux-3.16.7_generic/output/host/usr/i686-buildroot-linux-uclibc/include ../array.st > array.i cc1: fatal error: /usr/local/products/elsd/vmivme7805/linux-3.16.7_generic/output/staging/usr/include: No such file or directory
compilation terminated.
make[3]: *** [array.i] Error 1
This particular error is due to a missing -I in the preprocessor command-line. The cc1 command above is complaining that /usr/local/.../output/staging/usr/includeis missing, although my guess is that it's a directory that does exist. However if you look carefully at the command line that path appears in the middle of the set of -I <path>options but doesn't itself have a -Iin front of it.

Work out where in your Base target configuration you are providing that path (probably when setting a <something>_INCLUDES variable) and fix it. There are a couple of different ways we prepend the -I to include directory paths in the Base builds. In CONFIG.CrossCommon we use
    CROSS_INCLUDES = $(GNU_TARGET_INCLUDE_DIR:%=-I%)
while in other places where the source variable may have multiple paths in it we use a construct like this
    xxx_INCLUDES = $(addprefix -I, $(wildcard $(xxx_DIRS)))

Not sure whether this will fix all your problems, but it definitely needs resolving.

- Andrew

The build for seq did work when I commented out the test and examples in the ./seq/Makefile.

I hope that this is enough information, and again, thank you for your assistance.
Pierrick


On 7/8/19 11:14 AM, Johnson, Andrew N. wrote:
Hi Pierrick,

On 7/8/19 10:51 AM, Pierrick M Hanlet wrote:
Thanks again for your assistance earlier; I've successfully built base.
Great.

I've a new, but related problem which is to find the correct flags so that I can build all of my support modules also.  I had hoped that the information
which you gave me for building base would have sufficed to allow me to
build my support modules, but alas, the build failed early on.  Are there any generic flags from base CONFIG* files that will prevent me from having to
modify individual CONFIG* files in each support module?
Without know what modules you're building, how you're configuring them and seeing the actual build failures I can't be of much help. However you shouldn't normally have to add target-specific configuration files to your modules, all settings should be pulled from copy of Base that your module's configure/RELEASE file points to. However there might be gotcha's if you're trying to use a target-specific RELEASE file for instance.

For us to help we need more information about what you've done and what messages or errors you're seeing (and please copy/paste too much of the output rather than too little, it saves time in case you miss something that you don't realize is important, or we may be able to use some other build output to infer something else about your build that we need to know/check).

- Andrew
--
Complexity comes for free, Simplicity you have to work for.

--
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile

"Whether you think you can or think you can't, you're right" -- Henry Ford


--
Complexity comes for free, Simplicity you have to work for.

--
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile

"Whether you think you can or think you can't, you're right" -- Henry Ford


References:
Fwd: Re: Fwd: cross-compiling (kind of) with Buildroot Pierrick M Hanlet via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Phoebus Radiobutton cannot set mbbi record Florian Feldbauer via Tech-talk
Next: Re: [EXTERNAL] Phoebus Radiobutton cannot set mbbi record Kasemir, Kay 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: Fwd: Re: Fwd: cross-compiling (kind of) with Buildroot Pierrick M Hanlet via Tech-talk
Next: Re: Fwd: Re: Fwd: cross-compiling (kind of) with Buildroot Hill, Bruce 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, 14 Aug 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·