Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows port #47

Open
wants to merge 1 commit into
base: obliv-c
Choose a base branch
from
Open

Conversation

calctopian
Copy link

Please note that the configure script may have some issues depending on your system:
- x86_64-w64-mingw32-gcc.exe (64 bits): detected size_t is "unsigned long long" but the configure doesn't accept it and cil.ml doesn't recognize it. Edit the configure script, search for "real_type=" and explicitly declare it (e.g., "real_type='unsigned long'"). Then run: "./configure CC=x86_64-w64-mingw32-gcc.exe" and "make RELEASE=1"
- i686-w64-mingw32 (32 bits): if you get the following error message "/usr/i686-w64-mingw32/sys-root/mingw/include/stdlib.h:336: Error: Undefined function", define out the function _abs64:
#ifdef __MINGW_INTRIN_INLINE
__MINGW_INTRIN_INLINE __int64 __cdecl _abs64(__int64 x) { return __builtin_llabs(x);}
#endif

Steps to generate oblivc.dll and oblivc.lib:

x86_64-w64-mingw32-gcc.exe -c -g atomic_queue.c -o atomic_queue.o -I .
x86_64-w64-mingw32-gcc.exe -c -g bcrandom.c -o bcrandom.o -I .
x86_64-w64-mingw32-gcc.exe -c -g commitReveal.c -o commitReveal.o -I .
x86_64-w64-mingw32-gcc.exe -c -g dualex.c -o dualex.o -I .
x86_64-w64-mingw32-gcc.exe -c -g nnob.c -o nnob.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_bits.c -o obliv_bits.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_network_utils.c -o obliv_network_utils.o -I .
x86_64-w64-mingw32-gcc.exe -c -g ot.c -o ot.o -I .
x86_64-w64-mingw32-gcc.exe -c -g privacy-free.c -o privacy-free.o -I .
x86_64-w64-mingw32-gcc.exe -c -g psi.c -o psi.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_add.c -o obliv_float_add.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_div.c -o obliv_float_div.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_eq.c -o obliv_float_eq.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_le.c -o obliv_float_le.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_lt.c -o obliv_float_lt.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_mult.c -o obliv_float_mult.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_neg.c -o obliv_float_neg.o -I .
x86_64-w64-mingw32-gcc.exe -c -g obliv_float_sub.c -o obliv_float_sub.o -I .

x86_64-w64-mingw32-gcc.exe -shared -g -o oblivc.dll *.o -Wl,--output-def,oblivc.def,--out-implib,oblivc.a -lgcrypt -pthread -lws2_32

lib /machine:x64 /def:oblivc.def

Compiling with Obliv-C:
Please note that the CIL compiler underlying Obliv-C doesn't support intrinsics: you may have to comment/define out all the intrinsics definitions from system's headers (e.g., avx512fintrin.h, avxintrin.h, emmintrin.h, f16cintrin.h, mm3dnow.h, xmmintrin.h)

Please note that the configure script may have some issues depending on your system:
	- x86_64-w64-mingw32-gcc.exe (64 bits): detected size_t is "unsigned long long" but the configure doesn't accept it and cil.ml doesn't recognize it. Edit the configure script, search for "real_type=" and explicitly declare it (e.g., "real_type='unsigned long'"). Then run: "./configure CC=x86_64-w64-mingw32-gcc.exe" and "make RELEASE=1"
	- i686-w64-mingw32 (32 bits): if you get the following error message "/usr/i686-w64-mingw32/sys-root/mingw/include/stdlib.h:336: Error: Undefined function", define out the function _abs64:
		#ifdef __MINGW_INTRIN_INLINE
		  __MINGW_INTRIN_INLINE __int64 __cdecl _abs64(__int64 x) { return __builtin_llabs(x);}
		#endif

Steps to generate oblivc.dll and oblivc.lib:

	x86_64-w64-mingw32-gcc.exe -c -g atomic_queue.c -o atomic_queue.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g bcrandom.c -o bcrandom.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g commitReveal.c -o commitReveal.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g dualex.c -o dualex.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g nnob.c -o nnob.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_bits.c -o obliv_bits.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_network_utils.c -o obliv_network_utils.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g ot.c -o ot.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g privacy-free.c -o privacy-free.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g psi.c -o psi.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_add.c -o obliv_float_add.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_div.c -o obliv_float_div.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_eq.c -o obliv_float_eq.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_le.c -o obliv_float_le.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_lt.c -o obliv_float_lt.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_mult.c -o obliv_float_mult.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_neg.c -o obliv_float_neg.o -I .
	x86_64-w64-mingw32-gcc.exe -c -g obliv_float_sub.c -o obliv_float_sub.o -I .

	x86_64-w64-mingw32-gcc.exe -shared -g -o oblivc.dll *.o -Wl,--output-def,oblivc.def,--out-implib,oblivc.a -lgcrypt -pthread -lws2_32

	lib /machine:x64 /def:oblivc.def

Compiling with Obliv-C:
	Please note that the CIL compiler underlying Obliv-C doesn't support intrinsics: you may have to comment/define out all the intrinsics definitions from system's headers (e.g., avx512fintrin.h, avxintrin.h, emmintrin.h, f16cintrin.h, mm3dnow.h, xmmintrin.h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant