Open
Description
We currently used (a subset of) supercop for the ADSNARK ppzksnark. It is fetched and compiled by prepare-depends.sh, resulting in ./depinst/lib/libsupercop.a
. This is then make install
ed into $PREFIX/lib
.
When trying to make libsnark a single libsnark.so including all dependencies, we noticed that supercop doesn't support that, because its internal qhasm routines haven't been adapted for position-independent code. We get errors like:
/usr/bin/ld: libsnark.a(sc25519_barrett.o): relocation R_X86_64_32S against crypto_sign_ed25519_amd64_51_30k_batch_MU3' can not be used when making a shared object; recompile with -fPIC
libsnark.a(sc25519_barrett.o): error adding symbols: Bad value
(See http://stackoverflow.com/a/9341970 for a discussion of such situations.)
Suggested actions:
- For now, Document that building a dynamic library requires either linking apps using
-lsupercop
or building libsnark usingNO_SUPERCOP=1.
- In the planned makefile/CMake cleanup, have an explicit --enable-adsnark, off by default. Unless enabled, supercop is not even built.
- Eventually, change the supercop asm routines to be PIC-compatible (at what cost in performance?).