08-23-2017 08:45 AM
I am using the zcu102 es1 board and I have created a linux kernel with Petalinux BSP and successfully download the kernel to the zcu102 platform.
Then, I tried to compile some simple C code, ie Hello World, in the kernel but I cannot find the gcc. I am wondering how to add the gcc to the kernel, because it seems like I cannot use any command like apt-get to install the tools I want.
Thank you in advance
08-23-2017 09:26 AM
Then, I tried to compile some simple C code, ie Hello World, in the kernel ...
You normally do not compile C code 'in the kernel' you compile it in userspace (petalinux in your case)
... but I cannot find the gcc.
Most likely it was not selected and thus not installed into the image.
I am wondering how to add the gcc to the kernel ...
You don't add it to the kernel, you add it as recipe to the petalinux configuration
it seems like I cannot use any command like apt-get to install the tools I want.
If you install a package manager like apt, you can probably use that as well, but I doubt that you want to do that.
Hope this clarifies,
08-23-2017 12:00 PM
Thank you for your reply. I am wondering how to add the gcc to the kernel image generated by petalinux, since I didn't see this option in petalinux-config. Are there any example?
08-23-2017 12:12 PM
Thank you for your reply.
I am wondering how to add the gcc to the kernel image generated by petalinux,
You can add basically anything to petalinux with a proper recipe.
since I didn't see this option in petalinux-config.
Yes, it doesn't seem to be available, probably because Xilinx assumes that you don't want to run a compiler on the target.
Are there any example?
Maybe, haven't seen any gcc specific examples.
Maybe consider putting a full fledged distro like Ubuntu or Arch on the target where you have all the nice tools like compilers and build systems already available as packages?
08-25-2017 03:26 AM
I just checked the packages within the petalinux rootfs and it doesn't seem to have any gcc compiler option in order to add it to you Linux image. Nevertheless that is a strange use case as the target machine in a embedded system is unlikely used for application compilation, and cross-compilation is used for that.
For cross-compilation, you can either use the following options:
1. Petalinux. Refer to UG1144 (adding custom applications) where is explained how to compile applications
2. Xilinx SDK. Create a linux application for your target board and compile it, then you can just copy it to your target.
3. Command line compilation with the cross-compiler.
10-18-2017 01:02 PM
So you are basically telling me to edit any user app I create on PetaLinux, I need to exit out of the QEMU/on-Zynq OS, make my changes, rebuilding with cross-compilation, then rebooting. I guess with the SDK, loading apps is easy, but this seems a pain if you want to do a PetaLinux/QEMU run
10-18-2017 03:17 PM
We "side load" pre-compiled binaries (compiled in XSDK on a host/development machine) via FTP to the target board. We've got a physical hardware target, so the specifics of our setup aren't very relevant, but if you've got a network connection to the host through QEMU then you can try that as well. Not as quick as compiling on the target itself, but at least you don't have to rebuild the entire system.
10-19-2017 12:58 AM
As I pointed in the previous post, development in a ARM based target is not a usual use case as the most common use case is to use a development IDE for the development process. This way not only compilation can be done, debugging can be also done or different kind of analysis.
I do agree that development process with petalinux compilation is not a good approach but we do have the SDK for that use case. Use the SDK for the development process and use also the TCF debugging capabilities, once the application is done you can integrate it in your petalinux build flow in order to generate the final binary file.
04-18-2018 04:41 PM
1) Create this file: meta-user/recipes-core/images/petalinux-user-image.bbappend
2) Add the following line to this file:
IMAGE_INSTALL += "packagegroup-core-buildessential"
It will add in the following packages to your build, and you will be able to run GCC on the target system.
RDEPENDS_packagegroup-core-buildessential = "\
05-03-2018 01:22 PM
Could you tell more about this? When I try to build a kernel with this file, I get the following message: WARNING: No recipes available for: ....
05-03-2018 06:56 PM - edited 05-07-2018 10:16 AM
If you want to compile hello world program on ZCU102 target this means you need self host packages. If so then enable from
petalinux-config -c rootfs ---> Filesystem Packages ---> misc ---> [*] packagegroup-petalinux-self-hosted
Note: With this your image size will increase.
If you want to build application on host refer UG1144 petalinux apps creation section.
05-07-2018 10:17 AM