[Aboriginal] Using native-build.sh for An Android native C compiler

Earlence Fernandes earlenceferns at gmail.com
Sat Jul 16 10:16:34 PDT 2011


ok. doing what was suggested in that link got it compiled.

I compile my file like the following:

gcc -static gb.c -ldl

however, when I run it, it segfaults in the call to dlopen

This is the line in the file:

void *dlh = dlopen("/system/lib/libc.so", RTLD_NOW);

-Earlence

On Sat, Jul 16, 2011 at 6:27 PM, Rob Landley <rob at landley.net> wrote:

> On 07/16/2011 07:53 AM, Earlence Fernandes wrote:
> > Ok, I;ve built from source, the native compiler for armv5l. It compiles
> > a couple of files I need on the devices perfectly.
> > However, One particular file, I use netlink sockets and this is the
> > message I get:
> >
> > /data/local/tmp/narm/bin/../include/linux/netlink.h:31: error: expected
> > specifier-qualifier-list before 'sa_family_t'
> >
> > gb.c:310: error: 'struct sockaddr_nl' has no member named 'nl_family'
> > gb.c:314: error: 'struct sockaddr_nl' has no member named 'nl_pid'
>
> Hmmm...  either libc version skew or kernel version skew.  The headers
> the package is building against aren't providing what it expects.
>
> Let's see, ctrl-alt-google and:
>
>  https://bugzilla.redhat.com/show_bug.cgi?id=561687
>
> It looks like you need to #include <bits/sockaddr.h> before the #include
> linux/netlink.h.  (Probably in your package?)
>
>
> http://groups.google.com/group/linux.kernel/browse_thread/thread/6de65a3145007ae5
>
> That implies the problem is in strace.  I'm already patching strace to
> build natively on armv5l, you can grab that binary from
> http://landley.net/aboriginal/downloads/binaries/extras/strace-armv5l
>
> And the strace source patches are under:
>
> http://landley.net/hg/control-images/file/tip/images/static-tools/patches/
>
> I'm in the process of writing a control-images howto. :)
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/aboriginal-landley.net/attachments/20110716/14e7a119/attachment-0003.htm>


More information about the Aboriginal mailing list