-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross compilation of FRR #7141
Comments
this pretty much worked for me on a RASPI4 - there was some jiggery-pokery getting the right packages installed but give me a shout on the slack channel if you hit issues. |
While we ostensibly support |
Back to the previous question, I use command
And then when compiling in a new directory,as follow
The compiling platform is Ubuntu 18.04, and the host is armv8 64 bit system thanks |
@lucize
error as follow
thanks |
But did you find the exact error from config.log? |
hi,lucize. Judging from the error message above, it is probably the compiler's fault
I don't know what the problem is, I posted the log, please help to have a look In addition, I am not clear about whether the HOST_* parameter is necessary and how to fill it in. the environment variables we use are as follows
thanks |
this is a working rock64 configuration, maybe you can spot something here:
but from your config file it seems that you are missing at least the --target option or build only clippy first, not in the cross compile stage and specify it like I did in the second stage config for clippy only (for running on build system):
don't know exactly what variables are exported because I use Openwrt SDK in cross building it |
hi,lucize
is that all? thanks |
it can be like your example, but that is the mixed config setup |
Hi, I also have a cross-compilation issue. I don't know if it's the same described here, but I'll try to describe the problem. MACHINE = tilegx when I cross compile FRR, I face a mixed configuration when it's time to compile hosttools, because CC, LD, etc. are referring to the host machine instead of native one. --- a/configure.ac +AC_ARG_VAR([AR],[archiver command]) and then add following variables to configure command line: HOST_CC=gcc HOST_LD=ld HOST_AR=ar HOST_CXX=g++ HOST_OBJCOPY=objcopy HOST_OBJDUMP=objdump HOST_RANLIB=ranlib HOST_STRIP=strip In this way hosttools configure correctly copies HOST_LD to LD, HOST_AR to AR, etc.. ac_precious_vars='build_alias I hope that this can help and to have a feedback on my change. If it's the case I can push a patch. |
hi @emabo How do you set the configure parameter? thanks |
in the configure command line: configure --sysconfdir=/var/tmp/shells --localstatedir=/tmp --sbindir=/usr/local/6bin --bindir=/usr/local/6bin --libdir=/lib --host=tilegx-redhat-linux --build=x86_64-linux-gnu --srcdir=/home/emanu/ports/frr/src --enable-user=root --enable-group=root --enable-vtysh --enable-multipath=4 --enable-capabilities --disable-irdp --disable-rtadv --disable-doc --disable-ripd --disable-ripngd --disable-isisd --disable-pimd --disable-babeld --disable-ospfclient --disable-eigrpd --disable-nhrpd --disable-rr-semantics CFLAGS="-O2 -fomit-frame-pointer -Dlinux -Dlinux -Dunix -DEMBED LIBS="-l6whas -lxml2 -lxt -lm" HOST_CC=gcc HOST_LD=ld HOST_AR=ar HOST_CXX=g++ HOST_OBJCOPY=objcopy HOST_OBJDUMP=objdump HOST_RANLIB=ranlib HOST_STRIP=strip Ema |
hi @emabo I've added the following to line 28 of the configure.ac file
Use the following configure parameter
Also try changing the a parameter to HOST_* to be the same as yours
Encountered the following log
In addition,Why is your cross-compiler gcc, not something like aarch64-linux-gnu-gcc, powerpc-fsl-linux-gcc and so on. thanks |
I think it's a bit confusing, but from what I understood from configure.ac, HOST_xx contains the local tools and flags needed for building hosttools: configure:2996: checking build system type so, in my case CC=tile-gcc while HOST_CC=gcc. |
I again ask, did you tried with adding also --target? and some output variables: It was created by frr configure 7.4, which was
Output variables.
|
hi,lucize Sorry for the late recovery, I just tried it, the problem remains the same ../configure --host=aarch64-linux-gnu --build=x86_64-linux-gnu
thanks |
@nic1225 please try first native build of clippy only and then specify the clippy path and let's see |
also look at specific variables aarch64-* that you didn't defined in the config |
I understand the steps are as follows
and then, cross-compilation with clippy path ./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu --build=x86_64-linux-gnu CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ AR=aarch64-linux-gnu-ar LD=aarch64-linux-gnu-ld CFLAGS="-Os -g -mcpu=cortex-a53 -mfpu=neon -funroll-all-loops --param max-inline-insns-auto=550 -I/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main/usr/include -I/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main/usr/include/aarch64-linux-gnu" LDFLAGS="-L/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main/usr/local/lib -L$/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main/lib/aarch64-linux-gnu -L/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main/usr/lib" --prefix=/home/nick/nxp/flexbuild/build/rfs/rootfs_lsdk1909_LS_arm64_main --localstatedir=/var/run/frr --sysconfdir=/etc/frr/ --enable-multipath=1 --with-pkg-extra-version=-ctyun --enable-sysrepo=yes --enable-user=frr --enable-group=frr --enable-vty-group=frrvty --localstatedir=/var/run/frr --sysconfdir=/etc/frr/ log as follow:
thanks |
./configure --enable-clippy-only
|
hi,lucize
libjson failed as follow:
thanks |
the problem could be that you also need the dependencies to be compiled for aarch64, might I ask what is the board? can't it be used with openwrt sdk as there is already a layerscape target working ? |
This is a 4 core armv8 development board running Ubuntu18.04 version.It can also run Openwrt, but we're going to use its Ubuntu system for now. |
ok, so on openwrt I added this crosscompiled dependencies, depending on config: |
hi,@lucize
Does this have something to do with the fact that I was executing ./configure --enable-clippy-only thanks |
I already told you that you have to add the path of the clippy binary |
hi,@lucize
Could you send out the makefile file after execute configure, and I'll compare it to mine,Check to see if LIBRARY_PATH is assigned thanks |
libyang is built in a subfolder with CMAKE_OPTIONS += |
I encountered this error when cross-compiling FRR8.2. I installed the library during cross-compiling, but it was not found.
|
hi,
I want to cross compile FRR in ubuntu 18.04 to run in arm64 environment device,are there any compilation instructions?
Or how to configure the parameters of a
./configure
thanks
Nick.
The text was updated successfully, but these errors were encountered: