Skip to content
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

The problem with creating the ipkg package: configure: error: cannot run C compiled programs. #1

Closed
Steel551454 opened this issue Jan 8, 2018 · 9 comments

Comments

@Steel551454
Copy link

Steel551454 commented Jan 8, 2018

I wanted to assemble a separate package with a suricata, but at the creation stage an error occurs.
To issue i put the output of the command "make package/suricata/compile -j1 V=s" and file "config.log".
Output:

make[1]: Entering directory '/home/openwrt/openwrt'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/toolchain'
echo "libc" >> /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/toolchain'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/zlib'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/zlib'
make[2]: Entering directory '/home/openwrt/openwrt/feeds/packages/libs/file'
make[2]: Leaving directory '/home/openwrt/openwrt/feeds/packages/libs/file'
make[2]: Entering directory '/home/openwrt/openwrt/feeds/packages/libs/jansson'
make[2]: Leaving directory '/home/openwrt/openwrt/feeds/packages/libs/jansson'
make[2]: Entering directory '/home/openwrt/openwrt/feeds/packages/libs/pcre'
make[2]: Leaving directory '/home/openwrt/openwrt/feeds/packages/libs/pcre'
make[2]: Entering directory '/home/openwrt/openwrt/feeds/packages/libs/yaml'
make[2]: Leaving directory '/home/openwrt/openwrt/feeds/packages/libs/yaml'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/libmnl'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/libmnl'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/libnfnetlink'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/libnfnetlink'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/libnetfilter-queue'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/libnetfilter-queue'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/libpcap'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/libpcap'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/gettext'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/gettext'
make[2]: Entering directory '/home/openwrt/openwrt/package/libs/libiconv'
make[2]: Leaving directory '/home/openwrt/openwrt/package/libs/libiconv'
make[2]: Entering directory '/home/openwrt/openwrt/package/suricata'
rm -f /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/.configured_*
rm -f /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/stamp/.suricata_installed
(cd /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2; rm -f aclocal.m4; if [ -f ./configure.ac ] || [ -f ./configure.in ]; then [ -d ./autom4te.cache ] && rm -rf autom4te.cache; [ -e ./config.rpath ] || ln -s /home/openwrt/openwrt/scripts/config.rpath ./config.rpath; touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; AUTOM4TE=/home/openwrt/openwrt/staging_dir/host/bin/autom4te AUTOCONF=/home/openwrt/openwrt/staging_dir/host/bin/autoconf AUTOMAKE=/home/openwrt/openwrt/staging_dir/host/bin/automake ACLOCAL=/home/openwrt/openwrt/staging_dir/host/bin/aclocal AUTOHEADER=/home/openwrt/openwrt/staging_dir/host/bin/autoheader LIBTOOLIZE=/home/openwrt/openwrt/staging_dir/host/bin/libtoolize LIBTOOL=/home/openwrt/openwrt/staging_dir/host/bin/libtool M4=/home/openwrt/openwrt/staging_dir/host/bin/m4 AUTOPOINT=true /home/openwrt/openwrt/staging_dir/host/bin/autoreconf -v -f -i -s -B /home/openwrt/openwrt/staging_dir/host/share/aclocal -I /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/host/share/aclocal -I /home/openwrt/openwrt/staging_dir/hostpkg/share/aclocal -I /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/share/aclocal -I m4 -I . . || true; fi; );
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /home/openwrt/openwrt/staging_dir/host/bin/aclocal -I /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/host/share/aclocal -I /home/openwrt/openwrt/staging_dir/hostpkg/share/aclocal -I /home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/share/aclocal -I m4 -I . --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: adding subdirectory libhtp to autoreconf
autoreconf: Entering directory `libhtp'
autoreconf: running: /home/openwrt/openwrt/staging_dir/host/bin/libtoolize --force
OpenWrt-libtoolize: putting auxiliary files in `.'.
OpenWrt-libtoolize: linking file `./ltmain.sh'
OpenWrt-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
OpenWrt-libtoolize: linking file `m4/libtool.m4'
OpenWrt-libtoolize: linking file `m4/ltoptions.m4'
OpenWrt-libtoolize: linking file `m4/ltsugar.m4'
OpenWrt-libtoolize: linking file `m4/ltversion.m4'
OpenWrt-libtoolize: linking file `m4/lt~obsolete.m4'
autoreconf: running: /home/openwrt/openwrt/staging_dir/host/bin/autoconf --include=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/host/share/aclocal --include=/home/openwrt/openwrt/staging_dir/hostpkg/share/aclocal --include=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/share/aclocal --include=m4 --include=. --prepend-include=/home/openwrt/openwrt/staging_dir/host/share/aclocal --force
autoreconf: running: /home/openwrt/openwrt/staging_dir/host/bin/autoheader --include=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/host/share/aclocal --include=/home/openwrt/openwrt/staging_dir/hostpkg/share/aclocal --include=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/share/aclocal --include=m4 --include=. --prepend-include=/home/openwrt/openwrt/staging_dir/host/share/aclocal --force
autoreconf: running: /home/openwrt/openwrt/staging_dir/host/bin/automake --add-missing --force-missing
autoreconf: Leaving directory `libhtp'
OpenWrt-libtoolize: putting auxiliary files in `.'.
OpenWrt-libtoolize: linking file `./ltmain.sh'
OpenWrt-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
OpenWrt-libtoolize: linking file `m4/libtool.m4'
OpenWrt-libtoolize: linking file `m4/ltoptions.m4'
OpenWrt-libtoolize: linking file `m4/ltsugar.m4'
OpenWrt-libtoolize: linking file `m4/ltversion.m4'
OpenWrt-libtoolize: linking file `m4/lt~obsolete.m4'
autoreconf: Leaving directory `.'
(cd /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/./; if [ -x ./configure ]; then find /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/ -name config.guess | xargs -r chmod u+w; find /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/ -name config.guess | xargs -r -n1 cp --remove-destination /home/openwrt/openwrt/scripts/config.guess; find /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/ -name config.sub | xargs -r chmod u+w; find /home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/ -name config.sub | xargs -r -n1 cp --remove-destination /home/openwrt/openwrt/scripts/config.sub; AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2:suricata-3.2 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include" LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm" CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc" CXX="mips-openwrt-linux-musl-g++" RANLIB="mips-openwrt-linux-musl-gcc-ranlib" STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2:suricata-3.2 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2:suricata-3.2 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include " CPPFLAGS="-I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/include -I/home/openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.5.0_musl/usr/include -I/home/openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.5.0_musl/include/fortify -I/home/openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.5.0_musl/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include " LDFLAGS="-L/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib -L/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/lib -L/home/openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.5.0_musl/usr/lib -L/home/openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.5.0_musl/lib -znow -zrelro -L/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/lib -Wl,-rpath-link=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/lib -L/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/lib -Wl,-rpath-link=/home/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/lib "   ./configure --prefix="/usr" --sysconfdir="/etc" --enable-nfqueue --enable-gccprotect --enable-debug --enable-geoip --enable-pie  ; fi; )
configure: loading site script /home/openwrt/openwrt/include/site/mips
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... mips-openwrt-linux-musl-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Makefile:62: recipe for target '/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/.configured_a17fb5ef857664f03cd0ce37cc5ea591' failed
make[2]: *** [/home/openwrt/openwrt/build_dir/target-mips_24kc_musl/suricata-3.2/.configured_a17fb5ef857664f03cd0ce37cc5ea591] Error
[config.log](https://github.com/seanlinmt/suricata/files/1611758/config.log)
 1
make[2]: Leaving directory '/home/openwrt/openwrt/package/suricata'
package/Makefile:109: recipe for target 'package/suricata/compile' failed
make[1]: *** [package/suricata/compile] Error 2
make[1]: Leaving directory '/home/openwrt/openwrt'
/home/openwrt/openwrt/include/toplevel.mk:216: recipe for target 'package/suricata/compile' failed
make: *** [package/suricata/compile] Error 2

config.log

What could be the error. Please help

@seanlinmt
Copy link
Owner

Does the same problem occur when building other packages? I'll need to setup my build environment again.

@Steel551454
Copy link
Author

Steel551454 commented Jan 20, 2018

if you succeed in assembling a package, then send detailed instructions how you did it, please)

@seanlinmt
Copy link
Owner

please?

@Steel551454
Copy link
Author

please

@Steel551454
Copy link
Author

Can you help?

@seanlinmt
Copy link
Owner

Oh yes. Sorry. I almost forgot about this. I'm actually having problems building OpenWRT even without this package. I moved over to Arch Linux. I'm unsure what's wrong at the moment. But what I would do is just build OpenWRT first without including suricata. And then have a look at https://wiki.openwrt.org/doc/devel/feeds and follow the instructions there.

By the way, I'm curious what device you are building this for. I realised only after I got this working that I realise that the device I have does not meet the requirement for suricata.

@Steel551454
Copy link
Author

Steel551454 commented Feb 8, 2018

I first compile the package on a virtual machine under ubuntu 14.04. After a series of setbacks I switched to a docker with debian jessie.
Also, I wanted to try ipkg-builder in npm.

My work is connected with network security. We have a couple of IDS solutions, but they are too cumbersome. Therefore, I was tasked with assembling a compact version of IDS

@seanlinmt
Copy link
Owner

It seems configure needed to know the architecture of the build. It compiles now. I've also updated it to suricata 4.0.4. But I have not tested the firmware to see if I needed to update the running config too. You may need to downgrade it to suricata 3.2 if it doesn't run

@seanlinmt
Copy link
Owner

It seems configure needed to know the architecture of the build. It compiles now. I've also updated it to suricata 4.0.4. But I have not tested the firmware to see if I needed to update the running config too. You may need to downgrade it to suricata 3.2 if it doesn't run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants