pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 47 forks source link

Compilation error for buffetfsm "forward declaration of 'sigaltstack'" #6

Open r-marques opened 6 years ago

r-marques commented 6 years ago

When running ./install_buffet.sh in an up to date Fedora 27 with gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC) I get this error:

home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:239:22: error: variable has incomplete type
  COMPILE:   clang_linux/san-x86_64/x86_64: /home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cc                
      'struct sigaltstack'                                                                                                                                                          
  struct sigaltstack handler_stack;                                                                                                                                                 
                     ^                                                                                                                                                              
/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h:23:8: note: forward declaration of 'sigaltstack'                 
struct sigaltstack;                                                                                                                                                                 
       ^                                                                                                                                                                            
1 error generated.                                                                                                                                                                  
make[5]: *** [Makefile:268: /home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/tools/clang/runtime/compiler-rt/clang_linux/san-x86_64/x86_64/SubDir.lib__sanitizer_common/
sanitizer_stoptheworld_linux_libcdep.o] Error 1                                                                                                                                     
make[5]: *** Waiting for unfinished jobs....                                                                                                                                        
make[5]: Leaving directory '/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/projects/compiler-rt'                                                                            
make[4]: *** [Makefile:168: BuildRuntimeLibraries] Error 2                                                                                                                          
rm /home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/Release+Asserts/lib/clang/3.5.0/lib/linux/.dir                                                                      
make[4]: Leaving directory '/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/tools/clang/runtime/compiler-rt'                                                           
make[3]: *** [/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/Makefile.rules:936: compiler-rt/.makeall] Error 2                                                              
make[3]: Leaving directory '/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/tools/clang/runtime'                                                                       
make[2]: *** [/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/Makefile.rules:877: all] Error 1                                                                               
make[2]: Leaving directory '/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/tools/clang'                                                                               
make[1]: *** [/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/Makefile.rules:936: clang/.makeall] Error 2                                                                    
make[1]: Leaving directory '/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm-build/tools'                                                                                     
make: *** [/home/rodmar/code/repos/pequin/compiler/buffetfsm/llvm/Makefile.rules:877: all] Error 1 
maxhowald commented 6 years ago

Thanks for reporting this!

Buffet is implemented as a set of patches against a version of clang that is now quite out of date, so it's not surprising that new compilers might fail to compile it.

We're working on a fix (either patching the old version of clang we use or making our patches work against a newer version), but in the meantime the best workaround I can offer is to use an older version of gcc (<= 6).

FYI, I was able to reproduce the build error you got using the exact OS and gcc version you mentioned, but not on Debian unstable with gcc 7.2.0.

r-marques commented 6 years ago

I tried to compile against the latest version of llvm patched and the entire build process is working. I created pr #9 if you want to take a look.

r-marques commented 6 years ago

I also had a problem with the build process when compiling libsnark. My issue was the same as https://github.com/scipr-lab/libsnark/issues/82 and https://github.com/scipr-lab/libsnark/issues/86#issuecomment-319532767

I also updated the installation scripts to use the latest version of libsnark and created a pr #10

With these two changes the entire build process works. My only problem now is when trying to run the examples it cannot find the libsnark headers. I see that they are installed under $DEPS_DIR.

amirm20 commented 6 years ago

I also when running ./install_buffet.sh in Ubuntu 17.10 I get this error: screenshot from 2018-06-08 19-03-59

Please answer me as soon as possible.thank you