LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   aircrack-ng installation error: undefined reference to 'cpuinfo' please help... (https://www.linuxquestions.org/questions/linux-software-2/aircrack-ng-installation-error-undefined-reference-to-cpuinfo-please-help-4175620904/)

toshi382 01-04-2018 06:17 AM

aircrack-ng installation error: undefined reference to 'cpuinfo' please help...
 
I am using Fedora 27, I want to compile aircrack-ng-1.2-rc4 from the source since the yum and dnf installation has some bugs specially on airodump and airbase.

below are the output and errors when I enter make command...

[root@fedora aircrack-ng-1.2-rc4]# make
make -C src all
make[1]: Entering directory '/home/aircrack-ng-1.2-rc4/src'
gcc -g -w -Wall -O3 -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 crypto.o common.o uniqueiv.o aircrack-ptw-lib.o memory.o simd-intrinsics.o aircrack-ng-core.o wpapsk-simd.o sha1-sse2.S -o aircrack-ng-simd -lpthread -lssl -lcrypto -lstdc++ liblinecount.a
aircrack-ng-core.o: In function `crack_wpa_thread':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuid_simdsize'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4128: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4131: undefined reference to `cpuinfo'
aircrack-ng-core.o:/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4221: more undefined references to `cpuinfo' follow
aircrack-ng-core.o: In function `main':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:5217: undefined reference to `cpuid_getinfo'
wpapsk-simd.o: In function `init_wpapsk':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:518: undefined reference to `cpuinfo'
wpapsk-simd.o: In function `wpapsk_sse':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:218: undefined reference to `cpuinfo'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:186: aircrack-ng-simd] Error 1
make[1]: Leaving directory '/home/aircrack-ng-1.2-rc4/src'
make: *** [Makefile:25: all] Error 2

TB0ne 01-04-2018 06:36 AM

Quote:

Originally Posted by toshi382 (Post 5801632)
[root@fedora aircrack-ng-1.2-rc4]# make
make -C src all
make[1]: Entering directory '/home/aircrack-ng-1.2-rc4/src'
gcc -g -w -Wall -O3 -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 crypto.o common.o uniqueiv.o aircrack-ptw-lib.o memory.o simd-intrinsics.o aircrack-ng-core.o wpapsk-simd.o sha1-sse2.S -o aircrack-ng-simd -lpthread -lssl -lcrypto -lstdc++ liblinecount.a
aircrack-ng-core.o: In function `crack_wpa_thread':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuid_simdsize'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4128: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4131: undefined reference to `cpuinfo'
aircrack-ng-core.o:/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4221: more undefined references to `cpuinfo' follow
aircrack-ng-core.o: In function `main':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:5217: undefined reference to `cpuid_getinfo'
wpapsk-simd.o: In function `init_wpapsk':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:518: undefined reference to `cpuinfo'
wpapsk-simd.o: In function `wpapsk_sse':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:218: undefined reference to `cpuinfo'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:186: aircrack-ng-simd] Error 1
make[1]: Leaving directory '/home/aircrack-ng-1.2-rc4/src'
make: *** [Makefile:25: all] Error 2

Read the "Question Guidelines" link in my posting signature; without details, no one can help you.

You say nothing about version/distro of Linux, which is important, since the missing package name will vary by distro. Further, the software you're trying to compile is probably already available as a package...which we can't tell you how to find/install because we know nothing about your setup. Also, doing basic research first is a good thing, since the very error you mention has been filed as a bug-report:
https://github.com/aircrack-ng/aircrack-ng/issues/155

jefro 01-04-2018 03:57 PM

toshi382, hello and welcome to LQ.

Have you ever compiled from source? What is your skill level?

toshi382 01-04-2018 08:32 PM

Hello,

Sorry for the incompleteness.

I am using Fedora 27, I want to compile aircrack-ng-1.2-rc4 from the source since the yum and dnf installation has some bugs specially on airodump and airbase.

Yes I am new with Linux so I need your guidance about this problem. Thanks.

jefro 01-04-2018 08:43 PM

I have a lot of questions here, you have a lot going on.

FC27 is pretty new. Usually when you get a new distro you also have to put in a lot of development support. A default install usually won't let you build from source. Do you have some web site or tutorial that tells you how to set up a build environment?


I see an .rpm listed here. Have you tried it? https://rpmfind.net/linux/rpm2html/s...ry=aircrack-ng
I assume it is the same as https://fedora.pkgs.org/27/fedora-x8...86_64.rpm.html

Might be better plan easier to just get a distro that doesn't have problems if you really want to use this program.

What issues with this do you have by the way, it may have nothing to do with this program. As you can see however it is an RC release. Unstable.

toshi382 01-04-2018 09:02 PM

I already installed the rpm. However, same error with the yum and dnf installation.

Airodump and airbase don't work with this installation because my laptop does not support AVX instruction.

Aircrack wiki suggested that I need to compile from the source and edit some of its configuration and source file before installation.

So I need to know what is an undefined reference to 'cpuinfo' mean...

_roman_ 01-04-2018 10:19 PM

Quote:

/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038
Most likely line 4038 in file /home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c

Have you checked out with geany for example what that line does?

--

I have a reason why I use gentoo, It ships with a working toolchain. I wanted to do the same with ubuntu many years ago and ditched that for obvious reasons.

And some stuff does not compile from git and other stuff. I usually only build from git or use gentoo based packages, or gentoo overlay packages. IF I do not find it there it is usually some git stuff. And that only sometimes build. some stuff needs a lot of patches or is not proplery coded. happened several times.

--

Have you reported back to your distro, so they may fix your issue?

toshi382 01-04-2018 10:28 PM

yes, I already replaced the file aircrack-ng.c with the latest git source code. I reported this issue to aircrack-ng.org. But no replies yet.

_roman_ 01-05-2018 01:20 AM

https://github.com/aircrack-ng/aircr.../aircrack-ng.c
Quote:

#if defined(__i386__) || defined(__x86_64__)
// Set SIMD size to match what we can support, 1/4/8 (MMX/SSE2/AVX2)
cpuinfo.simdsize = cpuid_simdsize(0);

// if (shasse2_cpuid()>=2)
// nparallel = 4;
#else
cpuinfo.simdsize = 1;
#endif
https://en.wikipedia.org/wiki/SIMD

When you know what you are doing you could set that by hand in the code.

Could be interesting where the issue is at the end.



Quote:

model name : Intel(R) Pentium(R) CPU N3700 @ 1.60GHz
Quote:

[toshi82@fedora ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)
Just a suggestion:

Have you tried to set active the else path? does it run than?

Quote:

cpuinfo.simdsize = 1;
and "deactivate" the other stuff from the if statement?

toshi382 01-05-2018 06:04 AM

I tried to deactivate other stuff but it gives the same result...

toshi382 01-05-2018 08:18 AM

I think I solved the

Quote:

undefined reference to 'cpuinfo'
by declaring

Quote:

struct _cpuinfo cpuinfo;
in aircrack-ng.h

However, I cannot solved the problem on the following error lines

Quote:

aircrack-ng-core.o: In function `crack_wpa_thread':
/home/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4039: undefined reference to `cpuid_simdsize'
aircrack-ng-core.o: In function `main':
/home/aircrack-ng-1.2-rc4/src/aircrack-ng.c:5218: undefined reference to `cpuid_getinfo'

Terry Coats 01-05-2018 08:29 AM

Quote:

Originally Posted by toshi382 (Post 5801632)
I am using Fedora 27, I want to compile aircrack-ng-1.2-rc4 from the source since the yum and dnf installation has some bugs specially on airodump and airbase.

below are the output and errors when I enter make command...

[root@fedora aircrack-ng-1.2-rc4]# make
make -C src all
make[1]: Entering directory '/home/aircrack-ng-1.2-rc4/src'
gcc -g -w -Wall -O3 -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 crypto.o common.o uniqueiv.o aircrack-ptw-lib.o memory.o simd-intrinsics.o aircrack-ng-core.o wpapsk-simd.o sha1-sse2.S -o aircrack-ng-simd -lpthread -lssl -lcrypto -lstdc++ liblinecount.a
aircrack-ng-core.o: In function `crack_wpa_thread':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuid_simdsize'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4038: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4088: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4128: undefined reference to `cpuinfo'
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4131: undefined reference to `cpuinfo'
aircrack-ng-core.o:/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:4221: more undefined references to `cpuinfo' follow
aircrack-ng-core.o: In function `main':
/home/toshi82/aircrack-ng-1.2-rc4/src/aircrack-ng.c:5217: undefined reference to `cpuid_getinfo'
wpapsk-simd.o: In function `init_wpapsk':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:518: undefined reference to `cpuinfo'
wpapsk-simd.o: In function `wpapsk_sse':
/home/toshi82/aircrack-ng-1.2-rc4/src/wpapsk.c:218: undefined reference to `cpuinfo'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:186: aircrack-ng-simd] Error 1
make[1]: Leaving directory '/home/aircrack-ng-1.2-rc4/src'
make: *** [Makefile:25: all] Error 2

I just downloaded aircrack-ng-1.2-rc4 and it compiled ok on
my linuxfromscratch system here. Did you edit the make file
before you ran make? I'm asking because your compile attempt
seems to be missing a step. On my first attempt make ran
"autocfg" while your output shows yours did not. Here's mine:
Code:

terry [ /sources/blfs/sources/xc/aircrack-ng-1.2-rc4 ]$ make
make -C src all
make[1]: Entering directory '/sources/blfs/sources/xc/aircrack-ng-1.2-rc4/src'
sh ../autocfg gcc ..
gcc -g -W -Wall -O3  -mavx -DJOHN_AVX -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 -DSIMD_CORE  -c -o aircrack-ng.o aircrack-ng.c
....more stuff here

Notice the "sh ../autocfg gcc .."
I don't know if that's part of your problem but I thought
I'd point it out to you. By the way, I did a make clean
and reran make and the autocfg did not get run the 2nd
time so it only happens at the first make.

toshi382 01-05-2018 09:46 PM

Guys I found the problem.

I edited the MULTIBIN in the common.mak and change the value to "true" as suggested in https://aircrack-ng.blogspot.com/201...rovements.html for non-AVX unit. However, changing the MULTIBIN value into "true" will result to the error presented above. So, changing the vlaue of MULTIBIN is not a good idea IMO.

Thanks guys... Solve...


All times are GMT -5. The time now is 03:07 PM.