public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* Cross compiling crda and SSL word size
@ 2009-07-16 19:04 Jon Smirl
  2009-07-16 19:09 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2009-07-16 19:04 UTC (permalink / raw)
  To: linux-wireless

When cross compiling crda the Makefile asks the python system what the
word size is. This gets the word size from the host. Is there a way to
ask the word size using gcc? In my environment the Makefile is
automatically using the correct gcc cross compiler.

My host is 64b and target is 32b.

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiling crda and SSL word size
  2009-07-16 19:04 Cross compiling crda and SSL word size Jon Smirl
@ 2009-07-16 19:09 ` Johannes Berg
  2009-07-16 19:24   ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-07-16 19:09 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Thu, 2009-07-16 at 15:04 -0400, Jon Smirl wrote:
> When cross compiling crda the Makefile asks the python system what the
> word size is. This gets the word size from the host. Is there a way to
> ask the word size using gcc? In my environment the Makefile is
> automatically using the correct gcc cross compiler.

Can you just use gnutls instead? it has no such issue :)

Otherwise you can probably parse it out of "gcc -dumpspecs", but that
format doesn't look too nice, especially with multilib gcc...

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiling crda and SSL word size
  2009-07-16 19:09 ` Johannes Berg
@ 2009-07-16 19:24   ` Johannes Berg
  2009-07-16 19:25     ` Jon Smirl
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-07-16 19:24 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

On Thu, 2009-07-16 at 21:09 +0200, Johannes Berg wrote:
> On Thu, 2009-07-16 at 15:04 -0400, Jon Smirl wrote:
> > When cross compiling crda the Makefile asks the python system what the
> > word size is. This gets the word size from the host. Is there a way to
> > ask the word size using gcc? In my environment the Makefile is
> > automatically using the correct gcc cross compiler.
> 
> Can you just use gnutls instead? it has no such issue :)
> 
> Otherwise you can probably parse it out of "gcc -dumpspecs", but that
> format doesn't look too nice, especially with multilib gcc...

C99 says this works, I think:

echo -e '#include <limits.h>\n#if ULONG_MAX == 4294967295\n32\n#elif ULONG_MAX == 18446744073709551615U\n64\n#else\n0\n#endif' | gcc -E - | sed 's/^\(#.*\|\)$//;T;d'

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiling crda and SSL word size
  2009-07-16 19:24   ` Johannes Berg
@ 2009-07-16 19:25     ` Jon Smirl
  2009-07-16 19:27       ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2009-07-16 19:25 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Thu, Jul 16, 2009 at 3:24 PM, Johannes Berg<johannes@sipsolutions.net> wrote:
> On Thu, 2009-07-16 at 21:09 +0200, Johannes Berg wrote:
>> On Thu, 2009-07-16 at 15:04 -0400, Jon Smirl wrote:
>> > When cross compiling crda the Makefile asks the python system what the
>> > word size is. This gets the word size from the host. Is there a way to
>> > ask the word size using gcc? In my environment the Makefile is
>> > automatically using the correct gcc cross compiler.
>>
>> Can you just use gnutls instead? it has no such issue :)
>>
>> Otherwise you can probably parse it out of "gcc -dumpspecs", but that
>> format doesn't look too nice, especially with multilib gcc...
>
> C99 says this works, I think:
>
> echo -e '#include <limits.h>\n#if ULONG_MAX == 4294967295\n32\n#elif ULONG_MAX == 18446744073709551615U\n64\n#else\n0\n#endif' | gcc -E - | sed 's/^\(#.*\|\)$//;T;d'

The problem test is in key2pub.py

def print_ssl(output, name, val):
    import struct
    if len(struct.pack('@L', 0)) == 8:
        return print_ssl_64(output, name, val)
    else:
        return print_ssl_32(output, name, val)


>
> johannes
>



-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiling crda and SSL word size
  2009-07-16 19:25     ` Jon Smirl
@ 2009-07-16 19:27       ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2009-07-16 19:27 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

On Thu, 2009-07-16 at 15:25 -0400, Jon Smirl wrote:
> On Thu, Jul 16, 2009 at 3:24 PM, Johannes Berg<johannes@sipsolutions.net> wrote:
> > On Thu, 2009-07-16 at 21:09 +0200, Johannes Berg wrote:
> >> On Thu, 2009-07-16 at 15:04 -0400, Jon Smirl wrote:
> >> > When cross compiling crda the Makefile asks the python system what the
> >> > word size is. This gets the word size from the host. Is there a way to
> >> > ask the word size using gcc? In my environment the Makefile is
> >> > automatically using the correct gcc cross compiler.
> >>
> >> Can you just use gnutls instead? it has no such issue :)
> >>
> >> Otherwise you can probably parse it out of "gcc -dumpspecs", but that
> >> format doesn't look too nice, especially with multilib gcc...
> >
> > C99 says this works, I think:
> >
> > echo -e '#include <limits.h>\n#if ULONG_MAX == 4294967295\n32\n#elif ULONG_MAX == 18446744073709551615U\n64\n#else\n0\n#endif' | gcc -E - | sed 's/^\(#.*\|\)$//;T;d'
> 
> The problem test is in key2pub.py
> 
> def print_ssl(output, name, val):
>     import struct
>     if len(struct.pack('@L', 0)) == 8:
>         return print_ssl_64(output, name, val)
>     else:
>         return print_ssl_32(output, name, val)
> 

I know, I wrote that code :)
You could make the makefile pass that in as a parameter to the script
instead.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-16 19:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 19:04 Cross compiling crda and SSL word size Jon Smirl
2009-07-16 19:09 ` Johannes Berg
2009-07-16 19:24   ` Johannes Berg
2009-07-16 19:25     ` Jon Smirl
2009-07-16 19:27       ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox