stefano-garzarella / snp-svsm-vtpm

0 stars 1 forks source link

Error building `ms-tpm-20-ref/TPMCmd` #2

Closed tylerfanelli closed 4 months ago

tylerfanelli commented 4 months ago

In prepare.sh, I've ran into a problem that seems to stem around the build of ms-tpm-20-ref/TPMCmd. Here is my log:

  (cd /home/tfanelli/qemu-svsm/snp-svsm-vtpm/svsm/libmstpm/deps/ms-tpm-20-ref/TPMCmd && \                                                                                                                                                     
        ./bootstrap && \                                                                                                                                                                                                                      
        ./configure \                                      
                CFLAGS="-g -O0 -DDEBUG=YES -static -nostdinc -fno-stack-protector -fPIE -mno-sse -DSIMULATION=NO -DFILE_BACKED_NV=NO -I/home/tfanelli/qemu-svsm/snp-svsm-vtpm/svsm/libmstpm/deps/libcrt/include -I/home/tfanelli/qemu-svsm/snp-svsm-vtpm/svsm/libmstpm/deps/openssl/include" \           
                LIBCRYPTO_LIBS="")
  Generating file lists: src.mk
  Setting up build                                         
  Setting default vendor strings
  make[1]: Leaving directory '/home/tfanelli/qemu-svsm/snp-svsm-vtpm/svsm/libmstpm'                                    

  --- stderr                                               
  crypto/init.c: In function 'OPENSSL_atexit':
  crypto/init.c:763:11: warning: variable 'handlersym' set but not used [-Wunused-but-set-variable]                    
    763 |         } handlersym;
        |           ^~~~~~~~~~
  ar: creating libcrypto.a                                 
  ar: creating libssl.a                                    
  configure.ac:44: error: possibly undefined macro: AC_SUBST                                                           
        If this token and others are legitimate, please use m4_pattern_allow.                                          
        See the Autoconf documentation.
  configure.ac:55: error: possibly undefined macro: AS_IF
  configure:4613: error: possibly undefined macro: AC_MSG_WARN                                                         
  configure:4614: error: possibly undefined macro: AC_MSG_ERROR                                                        
  autoreconf: error: /usr/bin/autoconf failed with exit status: 1                                                      
  configure: error: cannot find required auxiliary files: missing install-sh compile                                   
  make[1]: *** [Makefile:115: /home/tfanelli/qemu-svsm/snp-svsm-vtpm/svsm/libmstpm/deps/ms-tpm-20-ref/TPMCmd/Makefile] Error 1
  thread 'main' panicked at libmstpm/build.rs:18:9:
  explicit panic                                           
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                        
make: *** [Makefile:118: bin/svsm-kernel.elf] Error 101
stefano-garzarella commented 4 months ago

This is happening during SVSM build, right? What gcc version do you have?

stefano-garzarella commented 4 months ago

I just replicated on Fedora 40, and I have exactly the same issue with the upstream SVSM: https://github.com/coconut-svsm/svsm.git

I'll investigate.

stefano-garzarella commented 4 months ago

aaaaarg, some missing dependencies...

This should fix it:

sudo dnf install autoconf automake autoconf-archive

I'll update the readme.

stefano-garzarella commented 4 months ago

also bindgen-cli package is needed, just added in the README.

so, I suggest these steps:

sudo dnf install autoconf automake autoconf-archive bindgen-cli
rm -rf svsm
./prepare.sh
tylerfanelli commented 4 months ago

Fixed, thanks :)