porting gnupg to Android, is pth required?

Hans-Christoph Steiner hans at guardianproject.info
Wed Jan 18 23:52:06 CET 2012


On 01/18/2012 10:56 AM, Werner Koch wrote:
> On Wed, 18 Jan 2012 16:05, hans at at.or.at said:
> 
>> Well, I got pth built so I think it'll work.  For now I'll keep it, unless you think the Android port would be better without it.
> 
> We will switch with the next beta.  Anyway using the new lib should be
> easier than Pth.  Keep it for now.
> 
>> --disable-dirmngr.  We want keyserver support for sure, and openldap
>> is built for Android now.  Does gnupg need any of the openldap client
>> or server programs?  I only installed the libraries.
> 
> No, we only need the library.  --disable-ldap should also work.  It is a
> still a development version and thus I don't care too much about these
> little bugs.
> 
>> Ah, ok so 'gl' stands for gnulib.  I've done quite a bit of porting,
>> but haven't used gnulib before.  I've never seen a project that makes
>> its own versions of system headers like alloca.h, is this behavior
>> inherited from gnulib?
> 
> Yes, I think so. gnulib is GNU's portability layer.  It is the successor
> of the old libiberty.  See http://gnu.org/software/gnulib (you need to
> wait until tomorrow due to the SOPA blackout, though).  It is much newer
> than GnuPG and thus we don't make full use of it and possible have
> modified some files.

Updating using the latest gnulib unfortunately just makes for new
strange errors.  Also the 'allocsa' module seem to have become the
'malloca' module, so that's what I used.  Any idea how much work it is
to remove gnulib?

Here's the build log part with the errors:

make[4]: Entering directory
`/media/share/code/guardianproject/gnupg-for-android/external/gnupg/gl'
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
--sysroot=/usr/local/android-ndk/platforms/android-9/arch-arm
-DHAVE_CONFIG_H -I. -I..     -DANDROID
-I/media/share/code/guardianproject/gnupg-for-android/external/include
-O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wformat
-Wno-format-y2k -Wformat-security -W -Wno-sign-compare
-Wno-missing-field-initializers -Wdeclaration-after-statement
-Wno-pointer-sign -Wpointer-arith -MT malloca.o -MD -MP -MF
.deps/malloca.Tpo -c -o malloca.o malloca.c
In file included from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/sys/time.h:33,
                 from ./sys/time.h:39,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:32,
                 from ./time.h:40,
                 from ./stdint.h:527,
                 from
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/strings.h:42,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h:42,
                 from ./stdlib.h:35,
                 from malloca.h:24,
                 from malloca.c:23:
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/linux/time.h:20:
error: expected specifier-qualifier-list before 'time_t'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/linux/time.h:26:
error: expected specifier-qualifier-list before 'time_t'
In file included from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/asm/siginfo.h:15,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:35,
                 from ./time.h:40,
                 from ./stdint.h:527,
                 from
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/strings.h:42,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h:42,
                 from ./stdlib.h:35,
                 from malloca.h:24,
                 from malloca.c:23:
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/asm-generic/siginfo.h:51:
error: expected specifier-qualifier-list before 'pid_t'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/asm-generic/siginfo.h:56:
error: expected specifier-qualifier-list before 'timer_t'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/asm-generic/siginfo.h:64:
error: expected specifier-qualifier-list before 'pid_t'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/asm-generic/siginfo.h:70:
error: expected specifier-qualifier-list before 'pid_t'
In file included from ./time.h:40,
                 from ./stdint.h:527,
                 from
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/strings.h:42,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h:42,
                 from ./stdlib.h:35,
                 from malloca.h:24,
                 from malloca.c:23:
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:40:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'time'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:70:
error: expected ')' before '__time1'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:71:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mktime'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:73:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:74:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:76:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:77:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:82:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:83:
error: expected ';', ',' or ')' before '*' token
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:94:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'clock'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:107:
error: expected declaration specifiers or '...' before 'timer_t'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:109:
error: expected ')' before 'timerid'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:110:
error: expected ')' before 'timerid'
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/time.h:111:
error: expected ')' before 'timerid'
In file included from ./stdint.h:527,
                 from
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/strings.h:42,
                 from
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h:42,
                 from ./stdlib.h:35,
                 from malloca.h:24,
                 from malloca.c:23:
./time.h:409: error: 'time_t' undeclared here (not in a function)
./time.h:409: error: bit-field '__floating_time_t_unsupported' width not
an integer constant
./time.h:409: error: expected ',', ';' or '}' before numeric constant
malloca.c: In function 'mmalloca':
malloca.c:85: warning: cast increases required alignment of target type
malloca.c:89: warning: cast increases required alignment of target type
malloca.c: In function 'freea':
malloca.c:129: warning: cast increases required alignment of target type
malloca.c:133: warning: cast increases required alignment of target type
make[4]: *** [malloca.o] Error 1
make[4]: Leaving directory
`/media/share/code/guardianproject/gnupg-for-android/external/gnupg/gl'
make[3]: *** [all-recursive] Error 1



More information about the Gnupg-devel mailing list