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

Mailing List Archive: GnuPG: devel

FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

 

 

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


hans at guardianproject

Jan 31, 2012, 9:02 PM

Post #1 of 4 (511 views)
Permalink
FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

I have a built of gpg-agent for Android, when I run it, it prints out some text but 'gpg-agent --daemon' seems to stay running. Looks like there might be a bit more porting work to do, apparently bionic libc only has a stub for ttyname():

# ./gpg-agent
FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360
gpg-agent[9647]: no gpg-agent running in this session

Any pointers as to how to handle this? Or does it matter? I was able to encrypt on Android and decrypt on my laptop :)

.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


wk at gnupg

Feb 1, 2012, 5:05 AM

Post #2 of 4 (497 views)
Permalink
Re: FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360 [In reply to]

On Wed, 1 Feb 2012 06:02, hans [at] guardianproject said:

> Any pointers as to how to handle this? Or does it matter? I was able to encrypt on Android and decrypt on my laptop :)

Configure tests for ttyname and uses a simple replacement if it does not
exist (i.e. under Windows). Usually we would change the test to
actually runh a test program; however that does not work for
cross-compiling. Thus we need to undef the HAVE_TTYNAME if we are
building for Android.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


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


wk at gnupg

Feb 1, 2012, 5:18 AM

Post #3 of 4 (531 views)
Permalink
Re: FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360 [In reply to]

Hi,

please try this patch:

diff --git a/configure.ac b/configure.ac
index f008d23..47c6d12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -490,6 +490,13 @@ AH_BOTTOM([
# endif
#endif

+/* Hacks required for Android. */
+#ifdef __ANDROID__
+ /* ttyname is a stub in BIONIC, printing a FIXME warning. */
+# define ttyname broken_native_ttyname
+# undef HAVE_TTYNAME
+#endif /*__ANDROID__*/
+

/* Tell libgcrypt not to use its own libgpg-error implementation. */
#define USE_LIBGPG_ERROR 1



Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


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


hans at guardianproject

Feb 15, 2012, 11:29 AM

Post #4 of 4 (468 views)
Permalink
Re: FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360 [In reply to]

I applied it and it died with an error. It seems that not all uses of
ttyname() are protected with HAVE_TTYNAME:

/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
-I/data/local/include -I/usr/local/include -I/data/local/include
-I/usr/local/include
-I/media/share/code/guardianproject/gnupg-for-android/external/data/local/include
-I/usr/local/include -DANDROID
-I/media/share/code/guardianproject/gnupg-for-android/external/data/local/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
-L/media/share/code/guardianproject/gnupg-for-android/external/data/local/lib
-Wl,--rpath,/media/share/code/guardianproject/gnupg-for-android/external/data/local/lib
-o t-session-env t-session-env.o libcommon.a ../gl/libgnu.a
-L/data/local/lib -lgcrypt -L/usr/local/lib -lgpg-error
-L/data/local/lib -lassuan -L/usr/local/lib -lgpg-error -L/usr/local/lib
-lgpg-error
libcommon.a(libcommon_a-session-env.o): In function
`session_env_getenv_or_default':
session-env.c:(.text+0x5b8): undefined reference to `broken_native_ttyname'
session-env.c:(.text+0x5c8): undefined reference to `broken_native_ttyname'

config.h had "#define HAVE_TTYNAME 1" in the __ANDROID__ block, so that
is also a potential point of failure. Here's the whole chunk from config.h:

/* Hacks required for Android. */
#ifdef __ANDROID__
/* ttyname is a stub in BIONIC, printing a FIXME warning. */
# define ttyname broken_native_ttyname
# define HAVE_TTYNAME 1
#endif /*__ANDROID__*/


'make clean' and then manually changing "# define HAVE_TTYNAME 1" to "#
undef HAVE_TTYNAME" got me here:

/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.. -I../gl -I../intl
-DLOCALEDIR=\"/data/local/share/locale\"
-DGNUPG_BINDIR="\"/data/local/bin\""
-DGNUPG_LIBEXECDIR="\"/data/local/libexec\""
-DGNUPG_LIBDIR="\"/data/local/lib/gnupg\""
-DGNUPG_DATADIR="\"/data/local/share/gnupg\""
-DGNUPG_SYSCONFDIR="\"/data/local/etc/gnupg\""
-DGNUPG_LOCALSTATEDIR="\"/data/local/var\"" -I/data/local/include
-I/usr/local/include -I/data/local/include -I/usr/local/include
-I/media/share/code/guardianproject/gnupg-for-android/external/data/local/include
-I/usr/local/include -I/data/local/include -I/usr/local/include
-DWITHOUT_GNU_PTH=1 -DANDROID
-I/media/share/code/guardianproject/gnupg-for-android/external/data/local/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 libcommon_a-estream.o -MD -MP -MF
.deps/libcommon_a-estream.Tpo -c -o libcommon_a-estream.o `test -f
'estream.c' || echo './'`estream.c
In file included from estream.c:99:
../common/util.h:292: error: static declaration of
'broken_native_ttyname' follows non-static declaration
/usr/local/android-ndk/platforms/android-9/arch-arm/usr/include/unistd.h:165:
note: previous declaration of 'broken_native_ttyname' was here


.hc


On 02/01/2012 08:18 AM, Werner Koch wrote:
> Hi,
>
> please try this patch:
>
> diff --git a/configure.ac b/configure.ac
> index f008d23..47c6d12 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -490,6 +490,13 @@ AH_BOTTOM([
> # endif
> #endif
>
> +/* Hacks required for Android. */
> +#ifdef __ANDROID__
> + /* ttyname is a stub in BIONIC, printing a FIXME warning. */
> +# define ttyname broken_native_ttyname
> +# undef HAVE_TTYNAME
> +#endif /*__ANDROID__*/
> +
>
> /* Tell libgcrypt not to use its own libgpg-error implementation. */
> #define USE_LIBGPG_ERROR 1
>
>
>
> Salam-Shalom,
>
> Werner
>

_______________________________________________
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.