UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
625 Views
Registered: ‎01-09-2014

Petalinux-build control

Hello Xilinx, Hello all,


I am not exactly a Linux guru and I am struggling to answer this question, can anyone help/shed some more light on the issue?

How can I modify the include path(s) when building via petalinux-build? What petalinux-build does and how can I steer it?

  •  I can view/check some stuff via the build.log obviously
  • I, obviously, can set some (or actually quite plenty) via petalinux-config





I've already read these:

 

  1. https://forums.xilinx.com/t5/Embedded-Linux/Source-code-of-Petalinux-kernel/td-p/419449
  2. https://forums.xilinx.com/t5/Embedded-Processor-System-Design/Is-it-possible-to-get-SOURCE-CODE-for-petalinux-create-and-other/td-p/779312
  3. https://www.xilinx.com/support/answers/55977.html

 

 

I does not contain any help in my case.


To clarify little more what I mean. The story is as follows.

 

  1. I use petalinux-2015.4-final, Vivado 2015.4.1, SDK 2015.4, Uboot 2015.07... standard 2015.4 Petalinux build system, except for kernel
  2. Petalinux is configured, via petalinux-config, to use kernel xilinx-v2017.3
    - downloaded from https://github.com/Xilinx/linux-xlnx/tree/xilinx-v2017.3
    - it works swell and well, no probs, with only few little tweaks in the dev-tree
  3. I can do:
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
source /opt/Xilinx/Vivado/2015.4/settings64.sh
source /opt/Xilinx/PetaLinux/petalinux-v2015.4-final/settings.sh
arm-xilinx-linux-gnueabi-cpp -v

in order to see the 'default' include paths:

#include "..." search starts here:
#include <...> search starts here:
 /opt/Xilinx/PetaLinux/petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/include
 /opt/Xilinx/PetaLinux/petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/include-fixed
 /opt/Xilinx/PetaLinux/petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/../../../../arm-xilinx-linux-gnueabi/include
 /opt/Xilinx/PetaLinux/petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../arm-xilinx-linux-gnueabi/libc/usr/include

the last line is the essential line I will reference as the "tools" include path



4. As an example let's look for ptp_clock.h

  • the kernel is configured appropriately (I think), meaning that PHC subsystem is compiled=in
  • I use old ETH driver - xemac - with PTP PHY compiled-in
  • The ETH PHY is Marvell - PicoZed with Z7030 board settings
  • so it all compiles OK, no probs, and it actually works (tested ptp4l, no probs)


5. First I build everything via petalinux-build

6. Then I locate ptp_clock.h

it is in various places on my system but the only ones I am interested in are found here:

the ones found in build output:

./pico-hardware/build/linux/rootfs/stage/usr/include/linux/ptp_clock.h
./pico-hardware/build/linux/rootfs/stage/usr/src/debug/strace/4.9-r0/strace-4.9/linux/ptp_clock.h


the ones found in Petalinux path, in tools and in kernel source:

/opt/Xilinx/PetaLinux/petalinux-v2015.4-final/components/linux-kernel/linux-xlnx/include/uapi/linux/ptp_clock.h
/opt/Xilinx/PetaLinux/petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi/libc/usr/include/linux/ptp_clock.h


the ones in build happens to be the same from tools, and NOT from kernel source



So the question is - how to I steer petalinux-build?

What & where can I change, add as a parameter, etc,  in order for the whole project, not just an app, to be built truly against NEW kernel-source

 

So in the end I am not sure against what includes the kernel has actually been built !

 


A. I know that when I make an app I could include/re-arrange include paths via custom MAKEFILE and change includes, I am not asking on how to do that

B. linuxptp v1.8 (just a sanity check),
- outside petalinux-build, just via bare arm-xilinx-linux-gnueabi-gcc
- I download linuxptp v1.8
- I source & export the stuff from point 3.
- I add "-H -fsyntax-only" to CC in makefile just to confirm what will be the include path of the ptp_clock.h and indeed it is the include from tools (NOT from the kernel source), as per *-cpp -v output (obviously), so settings scripts do not seem to change anything



0 Kudos