OpenWrt Forum Archive

Topic: Compiling aircrack-ng 1.2 RC 2

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Compiling aircrack-ng 1.2 RC 2 fails

i486-openwrt-linux-uclibc-gcc -Os -pipe -march=geode -mmmx -m3dnow -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable  -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/include -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/include -I/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/include  -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -DCONFIG_LIBNL30 -DCONFIG_LIBNL -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/include/libnl3  -fstack-protector -Wno-unused-but-set-variable -Wno-array-bounds -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -DCONFIG_LIBNL30 -DCONFIG_LIBNL -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/include/libnl3  -fstack-protector -Wno-unused-but-set-variable -Wno-array-bounds -Iinclude -L/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/lib -L/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/lib -L/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/lib  aircrack-ng.o crypto.o common.o uniqueiv.o aircrack-ptw-lib.o sha1-sse2.S -o aircrack-ng -lpthread -lssl -lcrypto -L/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/lib -L/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/lib -L/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/lib 
/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/i486-openwrt-linux-uclibc/4.8.3/../../../../i486-openwrt-linux-uclibc/bin/ld: cannot find -lssp_nonshared
/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/i486-openwrt-linux-uclibc/4.8.3/../../../../i486-openwrt-linux-uclibc/bin/ld: cannot find -lssp
/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
collect2: error: ld returned 1 exit status
make[5]: *** [aircrack-ng] Error 1
make[5]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2'
make[3]: *** [/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/.built] Error 2
make[3]: Leaving directory `/home/user/openwrt/feeds/packages/net/aircrack-ng'
make[2]: *** [package/feeds/packages/aircrack-ng/compile] Error 2
make[2]: Leaving directory `/home/user/openwrt'
make[1]: *** [/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/user/openwrt'
make: *** [world] Error 2

modify the CFLAGS via
- adding/editing stuff in OpenWrt Makefile
and/or
- write a patch that changes CFLAGS in airvpn build system

Error is probably

 -fstack-protector

is selected somewhere in aircrack-ng Makefilebut your OpenWrt buildroot did not enable that (didnt build libssp) so when doing cross compile it naturally cannot find the needed library

zloop: I have added CFLAGS="$(TARGET_CFLAGS) -Wall -Iinclude/ $(TARGET_CPPFLAGS) -D_REVISION=0" \ in the make file

i486-openwrt-linux-uclibc-gcc -Os -pipe -march=geode -mmmx -m3dnow -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wall -Iinclude/ -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/usr/include -I/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/include -I/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/user/openwrt/staging_dir/toolchain-i386_geode_gcc-4.8-linaro_uClibc-0.9.33.2/include -D_REVISION=0   -c -o file.o file.c
file.c: In function 'file_read':
file.c:77:7: error: 'LINKTYPE_IEEE802_11' undeclared (first use in this function)
  case LINKTYPE_IEEE802_11:
       ^
file.c:77:7: note: each undeclared identifier is reported only once for each function it appears in
file.c:81:7: error: 'LINKTYPE_RADIOTAP_HDR' undeclared (first use in this function)
  case LINKTYPE_RADIOTAP_HDR:
       ^
file.c:98:7: error: 'LINKTYPE_PRISM_HEADER' undeclared (first use in this function)
  case LINKTYPE_PRISM_HEADER:
       ^
file.c:107:7: error: 'LINKTYPE_PPI_HDR' undeclared (first use in this function)
  case LINKTYPE_PPI_HDR:
       ^
file.c:116:7: error: 'LINKTYPE_ETHERNET' undeclared (first use in this function)
  case LINKTYPE_ETHERNET:
       ^
file.c: In function 'file_open':
file.c:249:19: error: 'TCPDUMP_MAGIC' undeclared (first use in this function)
  if (pfh.magic != TCPDUMP_MAGIC)
                   ^
make[7]: *** [file.o] Error 1
make[7]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/src/osdep'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/src/osdep'
make[5]: *** [osdep/libosdep.a] Error 2
make[5]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2'
make[3]: *** [/home/user/openwrt/build_dir/target-i386_geode_uClibc-0.9.33.2/aircrack-ng-1.2-rc2/.built] Error 2
make[3]: Leaving directory `/home/user/openwrt/feeds/packages/net/aircrack-ng'
make[2]: *** [package/feeds/packages/aircrack-ng/compile] Error 2
make[2]: Leaving directory `/home/user/openwrt'
make[1]: *** [/home/user/openwrt/staging_dir/target-i386_geode_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/user/openwrt'
make: *** [world] Error 2

Hello,
iam successful compiled aircrack-ng_1.2rc2 with your CFLAG add... :-)
I have compare all my changes into a update.patch ...
You can download it under:

http://pastebin.com/WceE7KuW

This Patch contains fully update-changes from Offical Package-Feed aircrack-ng_rc1 to rc2 ....
You need to patch it simple in your root source folder (e.g. .../path/to/your/source-trunk $ patch -p1 < update-openwrt-feed-aircrack-ng-rc1-to-rc2.patch )

Mfg Master X :-)


:::::::: EDIT ::::::::::::
I had seen a little mistake in the Deepens for aircrack.... To Run airmon-ng you need the binary lsusb...
However... install the usbutils package and now all works fine...
And to Make All Correctly ADD usbutils to Deepends :

( DEPENDS:=+libpcap +libpthread +libopenssl +libnl +wireless-tools +ethtool +libpcre +libsqlite3 +usbutils )

Sooo and now Happy offline Hacking.... ;-)

(Last edited by MasterX1987 on 8 Aug 2015, 10:01)

Hi MasterX1987,
I'm new at Openwrt and linux.

Can u please explain to me what steps is needed to upgrade my Aircrack-ng 1.2 rc 1 to the newer one.
I tried to figure your explain, but it was to difficult to me

My Openwrt is run on TL-wdr4300

Tnx,
Moraneus

I am a newbie and I am trying to compile aircrack for my TP-LINK archer router. I am getting following errors:

cihan@cihan-N550JV:~/Downloads/aircrack-ng-1.2-rc4$ make
make -C src all
make[1]: Entering directory '/home/cihan/Downloads/aircrack-ng-1.2-rc4/src'
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/bin/mips-openwrt-linux-gcc -g -W -Wall -O3  -DOLD_SSE_CORE=1 -pthread -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -DCONFIG_LIBNL30 -DCONFIG_LIBNL -I/usr/include/libnl3 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -Iinclude -I/home/cihan/openwrt/projects/source/staging_dir/target-mips_24kc_musl-1.1.16/usr/include/ -I/home/cihan/openwrt/projects/source/staging_dir/host/include/ -Isrc/include -L/home/cihan/openwrt/projects/source/staging_dir/host/lib aircrack-ng.o cpuid.o crypto.o common.o  uniqueiv.o aircrack-ptw-lib.o liblinecount.a sha1-sse2.S -o aircrack-ng -lpthread -lssl -lcrypto -L/home/cihan/openwrt/projects/source/staging_dir/host/lib  -lstdc++
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: skipping incompatible /home/cihan/openwrt/projects/source/staging_dir/host/lib/libssl.a when searching for -lssl
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: skipping incompatible /home/cihan/openwrt/projects/source/staging_dir/host/lib/libssl.a when searching for -lssl
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: cannot find -lssl
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: skipping incompatible /home/cihan/openwrt/projects/source/staging_dir/host/lib/libcrypto.a when searching for -lcrypto
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: skipping incompatible /home/cihan/openwrt/projects/source/staging_dir/host/lib/libcrypto.a when searching for -lcrypto
/home/cihan/openwrt/projects/source/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.4.0/../../../../mips-openwrt-linux-musl/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
Makefile:173: recipe for target 'aircrack-ng' failed
make[1]: *** [aircrack-ng] Error 1
make[1]: Leaving directory '/home/cihan/Downloads/aircrack-ng-1.2-rc4/src'
Makefile:25: recipe for target 'all' failed
make: *** [all] Error 2




any ideas?

(Last edited by papates on 17 Feb 2017, 14:19)

The discussion might have continued from here.