vusec / ridl

RIDL test suite and exploits
https://mdsattacks.com
354 stars 54 forks source link

Make error #11

Open mattparlane opened 5 years ago

mattparlane commented 5 years ago

Not sure if I'm doing something wrong, but this is on Ubuntu 16.04 LTS inside a VM (Linode):

root@localhost:~/ridl/build# make
Scanning dependencies of target mdstool-cli
[  4%] Building C object CMakeFiles/mdstool-cli.dir/source/bitmap.c.o
[  8%] Building C object CMakeFiles/mdstool-cli.dir/source/human.c.o
[ 12%] Building C object CMakeFiles/mdstool-cli.dir/source/system.c.o
[ 16%] Building C object CMakeFiles/mdstool-cli.dir/source/topology.c.o
[ 20%] Building C object CMakeFiles/mdstool-cli.dir/source/x86/gcc/cpuid.c.o
/root/ridl/source/x86/gcc/cpuid.c: In function ‘cpuidex’:
/root/ridl/source/x86/gcc/cpuid.c:12:2: warning: implicit declaration of function ‘__get_cpuid_count’ [-Wimplicit-function-declaration]
  __get_cpuid_count(leaf, subleaf, regs + 0, regs + 1, regs + 2, regs + 3);
  ^
[ 24%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/l1tf.c.o
[ 28%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/meltdown.c.o
[ 32%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/memory.c.o
[ 36%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/microcode.c.o
[ 40%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/spectre.c.o
[ 44%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/ssb.c.o
[ 48%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/topology.c.o
[ 52%] Building C object CMakeFiles/mdstool-cli.dir/source/linux/vuln.c.o
[ 56%] Building C object CMakeFiles/mdstool-cli.dir/source/unix/os.c.o
[ 60%] Building C object CMakeFiles/mdstool-cli.dir/source/x86/cpuid.c.o
[ 64%] Building C object CMakeFiles/mdstool-cli.dir/source/x86/meltdown.c.o
[ 68%] Building C object CMakeFiles/mdstool-cli.dir/source/x86/ridl.c.o
[ 72%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/l1tf.c.o
[ 76%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/main.c.o
[ 80%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/meltdown.c.o
[ 84%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/ridl.c.o
[ 88%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/spectre.c.o
[ 92%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/ssb.c.o
[ 96%] Building C object CMakeFiles/mdstool-cli.dir/source/cli/system.c.o
[100%] Linking C executable mdstool-cli
CMakeFiles/mdstool-cli.dir/source/x86/gcc/cpuid.c.o: In function `cpuidex':
cpuid.c:(.text+0x11f): undefined reference to `__get_cpuid_count'
collect2: error: ld returned 1 exit status
CMakeFiles/mdstool-cli.dir/build.make:692: recipe for target 'mdstool-cli' failed
make[2]: *** [mdstool-cli] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mdstool-cli.dir/all' failed
make[1]: *** [CMakeFiles/mdstool-cli.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Thanks!

StephanvanSchaik commented 5 years ago

So apparently I have to implement that for older versions for gcc. You are on gcc 5.4, right?

mattparlane commented 5 years ago

Correct. It's Ubuntu 16.04LTS, which I know is old, but it's still supported till April 2021.

root@localhost:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
StephanvanSchaik commented 5 years ago

OK, this should be fixed in 2c155e849d55185e203449ce2faced5698341176.