On Wed, Sep 27, 2017 at 3:58 PM, Steve Pavao <ste...@korgrd.com> wrote:
> Hello,
>
> I am fairly new to Yocto, yet have been able to successfully add a custom 
> kernel object to my Yocto poky build, no problem.  However, I am having some 
> difficulty adding a shared library, namely mDNSResponder.
>
> Right now, my recipe is very simple and does not use autotools.  There are 
> just a few tweaks for cross-building which I’ve added to the supplied 
> mDNSResponder Makefile for mDNSPosix, in order to target 64-bit ARM hardware. 
>  Here is the build error I encounter.  Obviously the environment is not being 
> set 100% correctly, because it can not find stdio.h.  Is there an easy way to 
> avoid this problem?

You need to ensure that the Makefiles etc for the package you are
building respect the ${CC} environment variable defined by OE. It
includes not only the name of the cross compiler but also important
command line options, e.g. tuning for the correct target CPU and the
correct --sysroot option. From your build log the --sysroot option is
missing, therefore the compiler can not find standard include files
etc.

Unfortunately packages with build with custom Makefiles are so diverse
that there's no single approach to making them work. Sometimes you can
force CC=${CC} etc via the make command line to over-ride incorrect
defaults in the Makefile, sometime the Makefile needs to be patched,
etc. Even if the build succeeds it's wise to carefully check the build
log to ensure that all calls to the compiler, linker, etc contain the
flags defined by OE.

Note however that according to the layer index there does already seem
to be at least one recipe for mDNSResponder. It includes a Makefile
patch which looks like it will address your issue (and some others):

  
http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-iot-middleware/tree/recipes-connectivity/mdns/mdns_544.bb?h=master

>
> - Steve Pavao
> Korg R&D
>
> Log data follows:
> | DEBUG: Executing shell function do_compile
> | NOTE: make -j 4
> | ERROR: oe_runmake failed
> | make os=EmbeddedLinuxAarch64 Daemon libdns_sd -C mDNSPosix
> | make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
> rule.
> | make[1]: Entering directory 
> '/data/development/lfs/yocto/poky/build/tmp/work/aarch64-poky-linux/mDNSResponder/333.10-r0/mDNSPosix'
> | aarch64-poky-linux-gcc -I../mDNSCore -I../mDNSShared 
> -Iobjects/prod/EmbeddedLinuxAarch64 -fwrapv -W -Wall 
> -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" 
> -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX 
> -fno-strict-aliasing -Os -DMDNS_DEBUGMSGS=0   -c -o 
> objects/prod/EmbeddedLinuxAarch64/PosixDaemon.c.o PosixDaemon.c
> | PosixDaemon.c:31:19: fatal error: stdio.h: No such file or directory
> |  #include <stdio.h>
> |                    ^
> | compilation terminated.
> | Makefile:553: recipe for target 
> 'objects/prod/EmbeddedLinuxAarch64/PosixDaemon.c.o' failed
> | make[1]: *** [objects/prod/EmbeddedLinuxAarch64/PosixDaemon.c.o] Error 1
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to