Skip to content

How to cross-build .tar.bz2 sorce package (ipset) for EPC 1502?

Hello,

I want to use the "ipset" command, which is a utility software assisting the "iptables" command, on PLCnext EPC 1502 (OS: 2022.0.7 LTS).


To achieve it, I'm trying to cross-compile the source package of the "ipset" command, but I had a problem at the "./configure" step with the following message,


"checking whether we are cross compiling... configure: error: in /home/yumoto/ipset_exp/ipset-7.9':"

"configure: error: cannot run C compiled programs."

"If you meant to cross compile, use `--host'."

"See `config.log' for more details"


The target machine is EPC 1502, and the platform on which the compiler runs is Ubuntu 18.0.6 LTS on Virtual Box on a Windows 11 PC.

The platform to compile was setup with

* pkg-config, libtool, xz-utils, python3, build-essential, libunwind8, and shpass, etc. by "sudo apt install ..." ,

* PLCnext_Toolchain_Linux_2022.0.sh ,

* pxc-glibc-x86_64-epc1502-image-sdk-corei7-64-epc1500-64-toolchain-2022.0.sh ,

and I confirmed that it could cross-compile a simple C source code, "2048" downloaded from "https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c"


Then, I tried the following steps to build "ipset",


1. Download the "ipset "software source code package, extract it, and "cd" to the directory.

> wget http://ftp.netfilter.org/pub/ipset/ipset-7.9.tar.bz2

> tar jxvf ipset-7.9.tar.bz2

> cd ipset-7.9


2. Prepare the cross-compile environment with the PLCnext-SDK's script,

> source /opt/pxc/sdk/EPC1502/2022.0/environment-setup-corei7-64-pxc-linux


3. According to the README of the "ipset" package, run the "autogen.sh",

> ./autogen.sh


4. Run the "configure",

> ./configure


Then, I got the following messages.

"checking whether we are cross compiling... configure: error: in /home/yumoto/ipset_exp/ipset-7.9':"

"configure: error: cannot run C compiled programs."

"If you meant to cross compile, use `--host'."

"See `config.log' for more details"


I felt `--host' is something important, but I have not found any idea to solve it.

Do you have any idea?


Additionary, when I tried the same procedure with ipset-7.17.tar.bz2, it resulted in the same. With ipset-6.9.1.tar.bz2, it fails with the message, "configure: error: The kernel source directory /lib/modules/5.4.0-137-generic/build is not patched with netlink.patch to support ipset" at the same step, "./configure."


Thanks a lot.

Sign In or Register to comment.