Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

gpgme android build fails looking for /usr/local/lib/libgpg-error.la

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


hans at guardianproject

Feb 29, 2012, 5:29 PM

Post #1 of 6 (1050 views)
Permalink
gpgme android build fails looking for /usr/local/lib/libgpg-error.la

So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?

To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile

Here's the error in question:

libtool: link: /usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar cru .libs/libgpgme.a conversion.o get-env.o data.o data-fd.o data-stream.o data-mem.o data-user.o data-compat.o signers.o sig-notation.o wait.o wait-global.o wait-private.o wait-user.o op-support.o encrypt.o encrypt-sign.o decrypt.o decrypt-verify.o verify.o sign.o passphrase.o progress.o key.o keylist.o trust-item.o trustlist.o import.o export.o genkey.o delete.o edit.o getauditlog.o opassuan.o passwd.o engine.o engine-gpg.o status-table.o engine-gpgsm.o assuan-support.o engine-assuan.o engine-gpgconf.o engine-g13.o vfs-mount.o vfs-create.o gpgconf.o posix-util.o posix-sema.o posix-io.o dirinfo.o debug.o gpgme.o version.o error.o ath.o stpcpy.o
libtool: link: /usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ranlib .libs/libgpgme.a
/bin/sed: can't read /usr/local/lib/libgpg-error.la: No such file or directory
libtool: link: `/usr/local/lib/libgpg-error.la' is not a valid libtool archive

.hc


marcus.brinkmann at ruhr-uni-bochum

Mar 9, 2012, 10:23 AM

Post #2 of 6 (983 views)
Permalink
Re: gpgme android build fails looking for /usr/local/lib/libgpg-error.la [In reply to]

On 03/01/2012 02:29 AM, Hans-Christoph Steiner wrote:
>
> So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?
>
> To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
> https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile

It seems the libgpg-error configure is missing the --prefix=$(prefix) on
the configure command line.

That is necessary to set the path in gpg-error-config which is queried
by gpgme's configure to locate gpg-error.

I made a pull request on github (first time for me):

https://github.com/guardianproject/gnupg-for-android/pull/2

Thanks,
Marcus

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


hans at guardianproject

Mar 9, 2012, 11:04 AM

Post #3 of 6 (994 views)
Permalink
Re: gpgme android build fails looking for /usr/local/lib/libgpg-error.la [In reply to]

On Mar 9, 2012, at 1:23 PM, Marcus Brinkmann wrote:

> On 03/01/2012 02:29 AM, Hans-Christoph Steiner wrote:
>>
>> So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?
>>
>> To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
>> https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile
>
> It seems the libgpg-error configure is missing the --prefix=$(prefix) on the configure command line.
>
> That is necessary to set the path in gpg-error-config which is queried by gpgme's configure to locate gpg-error.
>
> I made a pull request on github (first time for me):
>
> https://github.com/guardianproject/gnupg-for-android/pull/2

Awesome, thank you! I merged it and am running a whole new build now.

.hc
_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


hans at at

Mar 9, 2012, 3:44 PM

Post #4 of 6 (998 views)
Permalink
Re: gpgme android build fails looking for /usr/local/lib/libgpg-error.la [In reply to]

On Mar 9, 2012, at 2:04 PM, Hans-Christoph Steiner wrote:

>
> On Mar 9, 2012, at 1:23 PM, Marcus Brinkmann wrote:
>
>> On 03/01/2012 02:29 AM, Hans-Christoph Steiner wrote:
>>>
>>> So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?
>>>
>>> To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
>>> https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile
>>
>> It seems the libgpg-error configure is missing the --prefix=$(prefix) on the configure command line.
>>
>> That is necessary to set the path in gpg-error-config which is queried by gpgme's configure to locate gpg-error.
>>
>> I made a pull request on github (first time for me):
>>
>> https://github.com/guardianproject/gnupg-for-android/pull/2
>
> Awesome, thank you! I merged it and am running a whole new build now.

Here's the next step:

- could you update config.sub and config.guess to the latest version? That's required for Android support, i.e. the host arm-linux-androidabi, otherwise ./configure dies like this:

checking host system type... Invalid configuration `arm-linux-androideabi':
system `androideabi' not recognized
configure: error: /bin/bash ./config.sub arm-linux-androideabi failed

- I needed to apply the attached simple patch to get things building since Android does not have SYS_gettid but does define __linux. It seems to be something in _GNU_SOURCE, so __gnu_linux__ seems an appropriate test.

- the *-config scripts don't seem to work when cross-compiling, since they use prefix= but they don't include DESTDIR, i.e. they assume that the libs are all installed into their final destination. Or am I missing something? I'm using ./configure --with-gpg-error-prefix=$(LOCAL) ($LOCAL is the full path, not just the prefix) but that doesn't seem to help because I get:

/bin/sed: can't read /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la: No such file or directory
libtool: link: `/data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la' is not a valid libtool archive

I've also tried using sed to replace the prefix= line in each *-config script to the full path, and it also gives a similar error. But I found that merely running "make -C gpgme" works...

.hc
Attachments: gpgme-android-fixes.patch (0.30 KB)


marcus.brinkmann at ruhr-uni-bochum

Mar 12, 2012, 8:52 AM

Post #5 of 6 (971 views)
Permalink
Re: gpgme android build fails looking for /usr/local/lib/libgpg-error.la [In reply to]

On 03/10/2012 12:44 AM, Hans-Christoph Steiner wrote:
>
> On Mar 9, 2012, at 2:04 PM, Hans-Christoph Steiner wrote:
>
>>
>> On Mar 9, 2012, at 1:23 PM, Marcus Brinkmann wrote:
>>
>>> On 03/01/2012 02:29 AM, Hans-Christoph Steiner wrote:
>>>>
>>>> So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?
>>>>
>>>> To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
>>>> https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile
>>>
>>> It seems the libgpg-error configure is missing the --prefix=$(prefix) on the configure command line.
>>>
>>> That is necessary to set the path in gpg-error-config which is queried by gpgme's configure to locate gpg-error.
>>>
>>> I made a pull request on github (first time for me):
>>>
>>> https://github.com/guardianproject/gnupg-for-android/pull/2
>>
>> Awesome, thank you! I merged it and am running a whole new build now.
>
> Here's the next step:
>
> - could you update config.sub and config.guess to the latest version? That's required for Android support, i.e. the host arm-linux-androidabi, otherwise ./configure dies like this:
>
> checking host system type... Invalid configuration `arm-linux-androideabi':
> system `androideabi' not recognized
> configure: error: /bin/bash ./config.sub arm-linux-androideabi failed

Fixed in gpgme ced1ad01aed32d1e4c5000f3b901db018ef7bf1e

> - I needed to apply the attached simple patch to get things building since Android does not have SYS_gettid but does define __linux. It seems to be something in _GNU_SOURCE, so __gnu_linux__ seems an appropriate test.

Or we just use __NR_gettid, which should work everywhere.
Fixed in gpgme ff0a640a18e7b7457e6c2edfdc8307bf44628b60

> - the *-config scripts don't seem to work when cross-compiling, since they use prefix= but they don't include DESTDIR, i.e. they assume that the libs are all installed into their final destination. Or am I missing something? I'm using ./configure --with-gpg-error-prefix=$(LOCAL) ($LOCAL is the full path, not just the prefix) but that doesn't seem to help because I get:
>
> /bin/sed: can't read /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la: No such file or directory
> libtool: link: `/data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la' is not a valid libtool archive
>
> I've also tried using sed to replace the prefix= line in each *-config script to the full path, and it also gives a similar error. But I found that merely running "make -C gpgme" works...

The way this is supposed to work is this:

At configure time, --prefix= should be used with the actual path where
the files will be found at the time you compile the next package.

make DESTDIR is for installing into a staging area for packaging. The
files will not be usable until they are relocated to the actual prefix.

For a cross-build, things are confused a bit, of course, as you want to
access the files in two locations, one path for the build system and one
for the host. Oh well. For Windows builds, we prefer the cross
environment and do the runtime lookup dynamically in cooperation with
the installer. For non-Windows systems, the other way around may be
more convenient. But then, you might have to do some work anyway to
make sure files are found in the android filesystem, which probably is
different from a normal Unix install.

So I'd say try the approach to set the cross build locations with
configure --prefix option, which is the least amount of hassle at build
time, and then patch things up for the android host install later, by
using configure options such as gpgme's --with-gpg or if necessary,
adjusting the code that locates various bits of the system in gpgme and
gpg (gpg-conf in particular). It depends on the packaging and how the
android filesystem works.

I might have a look at your build scripts and suggest something more
specific, but maybe you have already thought about how the android
packaging etc will work and can share some thoughts on that?

Thanks,
Marcus

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


hans at at

Mar 12, 2012, 9:18 AM

Post #6 of 6 (983 views)
Permalink
Re: gpgme android build fails looking for /usr/local/lib/libgpg-error.la [In reply to]

On Mar 12, 2012, at 11:52 AM, Marcus Brinkmann wrote:

> On 03/10/2012 12:44 AM, Hans-Christoph Steiner wrote:
>>
>> On Mar 9, 2012, at 2:04 PM, Hans-Christoph Steiner wrote:
>>
>>>
>>> On Mar 9, 2012, at 1:23 PM, Marcus Brinkmann wrote:
>>>
>>>> On 03/01/2012 02:29 AM, Hans-Christoph Steiner wrote:
>>>>>
>>>>> So gpgme is building fine on Android using the attached patch, it just doesn't finish linking to libgpg-error because the build system is convinced that its in /usr/local/lib, where it is definitely not. I tried to trace it a bit, but no luck yet. Any ideas where this is being set?
>>>>>
>>>>> To see how I'm building gpgme, check out the gpgme-build target in this Makefile, that will show the ./configure flags, etc.
>>>>> https://github.com/guardianproject/gnupg-for-android/blob/master/external/Makefile
>>>>
>>>> It seems the libgpg-error configure is missing the --prefix=$(prefix) on the configure command line.
>>>>
>>>> That is necessary to set the path in gpg-error-config which is queried by gpgme's configure to locate gpg-error.
>>>>
>>>> I made a pull request on github (first time for me):
>>>>
>>>> https://github.com/guardianproject/gnupg-for-android/pull/2
>>>
>>> Awesome, thank you! I merged it and am running a whole new build now.
>>
>> Here's the next step:
>>
>> - could you update config.sub and config.guess to the latest version? That's required for Android support, i.e. the host arm-linux-androidabi, otherwise ./configure dies like this:
>>
>> checking host system type... Invalid configuration `arm-linux-androideabi':
>> system `androideabi' not recognized
>> configure: error: /bin/bash ./config.sub arm-linux-androideabi failed
>
> Fixed in gpgme ced1ad01aed32d1e4c5000f3b901db018ef7bf1e
>
>> - I needed to apply the attached simple patch to get things building since Android does not have SYS_gettid but does define __linux. It seems to be something in _GNU_SOURCE, so __gnu_linux__ seems an appropriate test.
>
> Or we just use __NR_gettid, which should work everywhere.
> Fixed in gpgme ff0a640a18e7b7457e6c2edfdc8307bf44628b60
>
>> - the *-config scripts don't seem to work when cross-compiling, since they use prefix= but they don't include DESTDIR, i.e. they assume that the libs are all installed into their final destination. Or am I missing something? I'm using ./configure --with-gpg-error-prefix=$(LOCAL) ($LOCAL is the full path, not just the prefix) but that doesn't seem to help because I get:
>>
>> /bin/sed: can't read /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la: No such file or directory
>> libtool: link: `/data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.la' is not a valid libtool archive
>>
>> I've also tried using sed to replace the prefix= line in each *-config script to the full path, and it also gives a similar error. But I found that merely running "make -C gpgme" works...
>
> The way this is supposed to work is this:
>
> At configure time, --prefix= should be used with the actual path where the files will be found at the time you compile the next package.
>
> make DESTDIR is for installing into a staging area for packaging. The files will not be usable until they are relocated to the actual prefix.
>
> For a cross-build, things are confused a bit, of course, as you want to access the files in two locations, one path for the build system and one for the host. Oh well. For Windows builds, we prefer the cross environment and do the runtime lookup dynamically in cooperation with the installer. For non-Windows systems, the other way around may be more convenient. But then, you might have to do some work anyway to make sure files are found in the android filesystem, which probably is different from a normal Unix install.
>
> So I'd say try the approach to set the cross build locations with configure --prefix option, which is the least amount of hassle at build time, and then patch things up for the android host install later, by using configure options such as gpgme's --with-gpg or if necessary, adjusting the code that locates various bits of the system in gpgme and gpg (gpg-conf in particular). It depends on the packaging and how the android filesystem works.
>
> I might have a look at your build scripts and suggest something more specific, but maybe you have already thought about how the android packaging etc will work and can share some thoughts on that?

Android's linker doesn't use rpath at all, so I think this is going to look more like the Windows setup you describe. The libraries are all installed on the phone to /data/data/info.guardianproject.gpg/app_opt/lib and that path is added to LD_LIBRARY_PATH in the environment where gpg2, gpg-agent, and dirmngr are run.

So I guess I should change all the --prefix settings to be the cross-build install location, then use the --with-gpg, etc. options to set where the executables will be found on the phone.

.hc




----------------------------------------------------------------------------

"[T]he greatest purveyor of violence in the world today [is] my own government." - Martin Luther King, Jr.




_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.