guardianproject / LUKS

no longer maintained, check the forks for maintained versions
GNU General Public License v3.0
91 stars 38 forks source link

cryptsetup does not compile with me #5

Closed aelmahmoudy closed 9 years ago

aelmahmoudy commented 10 years ago

First I had to edit external/Makefile as follows: NDK_TOOLCHAIN=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(NDK_UNAME)-x86_64

Then, compilation failed at libgcrypt-1.4.6:

/bin/bash ../libtool --tag=CC   --mode=link /opt/android-ndk//toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android-ndk//platforms/android-9/arch-arm -I/usr/local/include -I/tmp/LUKS/external/include -fvisibility=hidden -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wformat -Wno-format-y2k -Wformat-security -W -Wextra -Wbad-function-cast -Wwrite-strings -Wdeclaration-after-statement -Wno-missing-field-initializers -Wno-sign-compare -Wpointer-arith  -L/tmp/LUKS/external/lib -Wl,--rpath,/tmp/LUKS/external/lib -o register register.o ../src/libgcrypt.la  
/opt/android-ndk//toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android-ndk//platforms/android-9/arch-arm -I/usr/local/include -I/tmp/LUKS/external/include -fvisibility=hidden -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wformat -Wno-format-y2k -Wformat-security -W -Wextra -Wbad-function-cast -Wwrite-strings -Wdeclaration-after-statement -Wno-missing-field-initializers -Wno-sign-compare -Wpointer-arith -Wl,--rpath -Wl,/tmp/LUKS/external/lib -o .libs/register register.o  -L/tmp/LUKS/external/lib ../src/.libs/libgcrypt.so
register.o:register.c:function check_run: error: undefined reference to 'gpg_strerror'
register.o:register.c:function check_run: error: undefined reference to 'gpg_strerror'
register.o:register.c:function check_run: error: undefined reference to 'gpg_strerror'
collect2: error: ld returned 1 exit status
Makefile:432: recipe for target 'register' failed
make[3]: *** [register] Error 1
make[3]: Leaving directory '/tmp/LUKS/external/libgcrypt-1.4.6/tests'
Makefile:317: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/LUKS/external/libgcrypt-1.4.6'
Makefile:247: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/LUKS/external/libgcrypt-1.4.6'
Makefile:110: recipe for target 'libgcrypt-build' failed
make: *** [libgcrypt-build] Error 2
eighthave commented 10 years ago

Sounds like you need to build libgpg-error first. gpg_strerror() comes from libgpg-error.

aelmahmoudy commented 10 years ago

libgpg-error did get built successfully, it is in external/lib/ (both static & dynamic libs)

eighthave commented 10 years ago

Hmm, like you said before -lgpg-error seems to be missing from that compile command line. We haven't touched this project in years but it would be great to see it revived. The thing to do is to check how we are going native builds on our other projects, and port this to the modern style. Here are some example projects: IOCipher, gnupg-for-android, Lil' Debi.

aelmahmoudy commented 10 years ago

Ok, I managed to build most of the stuff except for a few issues: 1) running autogen.sh in util-linux-ng causes a fork bomb, so I skipped autogen.sh, and directly patched some Makefile.in files 2) cryptsetup binary didn't link because it cannot find 'getline' during linking. I am stuck at that point This got fixed by running autoreconf for cryptsetup

aelmahmoudy commented 10 years ago

I have a question though, while building util-linux, I got several errors about missing *mntent symbols, so what I've done is patched config.h to have:

undef HAVE_MNTENT_H

is that the right thing ? or shall I add definitions for those functions as in https://github.com/guardianproject/lildebi/blob/master/external/003-mount-umount-fsck-df.patch ?

eighthave commented 10 years ago

I would try first using #undef HAVE_MNTENT_H, and if everything you need works, then that's the simplest route. Otherwise, you'll have to do something like I did to patch busybox. I got those patches from someone else, so I can't speak to this issue in any more detail.