Jetson Linux API Reference

35.4.1 Release
Setting Up Cross-Platform Support

This section describes how to set up the cross-compilation environment for Multimedia API on the host system. It uses the following terms:

  • Host system means the x86 based server where you are going to do cross-compilation.
  • Jetson board means the target board where your samples will run.

Before proceeding, you must ensure that you can build samples natively without issues on your Jetson board. If you have not already set up a complete compilation environment on your Jetson board, please do so now. For more information, see Building and Running.

The following steps are executed on your host system:

  1. Clone the target rootfs on your Jetson board to your host system.

    Follow the instructions "To clone a Jetson device and flash" under Basic Flashing Procedures in the Jetson Linux Driver Package Developer Guide to clone the target rootfs.

    These instructions yield two sparsed copies of the image. One has a name you specified, such as clone.img; the other has the same name with the suffix .raw.

  2. Mount the .raw image with the following commands:
    $ cd $HOME
    $ mkdir -p jetson
    $ sudo mount -t ext4 clone.img.raw jetson
    $ sudo chown -R $USER:$USER .
    $ export TARGET_ROOTFS=$HOME/jetson
  3. Export the path of cross-compiler tool chain with the following commands:

    $ mkdir $HOME/l4t-gcc
    $ cd $HOME/l4t-gcc
    $ tar xf <toolchain_archive>
    $ export CROSS_COMPILE=$HOME/l4t-gcc/bin/aarch64-buildroot-linux-gnu-

    You can download the prebuilt tool chain from the following website.
  4. Make the following symbolic links:
    $ cd ${TARGET_ROOTFS}/usr/local
    $ rm cuda
    $ ln -sf cuda-11.4 cuda
    $ cd ${TARGET_ROOTFS}/usr/lib/
    $ ln -sf aarch64-linux-gnu/crti.o crti.o
    $ ln -sf aarch64-linux-gnu/crt1.o crt1.o
    $ ln -sf aarch64-linux-gnu/crtn.o crtn.o
    $ cd ${TARGET_ROOTFS}/usr/lib/aarch64-linux-gnu
    $ ln -sf
  5. Navigate to the directory for a sample and run make to cross-compile.

    You can also use NGC docker to cross-compile samples.