public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Miloslav Trmac <mitr@redhat.com>
To: John Baron <john.baron@schneider-electric.com>
Cc: linux-audit@redhat.com
Subject: Re: cross-compiling difficulty with on-the-fly gen/build/use paradigm
Date: Mon, 20 Aug 2012 12:47:06 -0400 (EDT)	[thread overview]
Message-ID: <602295677.17172703.1345481226523.JavaMail.root@redhat.com> (raw)
In-Reply-To: <loom.20120817T220540-441@post.gmane.org>

----- Original Message -----
> I'm having a problem trying to cross-compile audit.  The problem is that
> gen_actiontabs_h is built using the cross-compiler (for ARM), and then it's
> asked to run on the host (x86_64).

> Is there a simple way around this?  A complex way, perhaps?  Extra points for
> simple!

The simplest way for users of released tarballs would be to include the generated files inside the tarball - from a quick look that should be really simple, but it also doesn't help users of svn checkouts.

Then there are two more complex ways:
* Add the necessary build machinery: find a local C compiler, and use custom Make rules to build these tools.  Unfortunately it seems that autotools don't provide a direct way to do this, some internet forums suggest creating a subdirectory with its own "./configure" script that is configured to build for the "build host" even when cross-compiling.
* Rewrite the gen_tables.c code in an interpreted language, e.g. Python or Perl - adds a build dependency on that language, but avoids this problem.

In all of the cases above I'm worried about ABI differences - e.g. the build and host architecture having a different integer assigned to SHMGET or any of the other macros.  I haven't checked whether that is really a problem, though.  That might ultimately require the rewrite into an interpreted language (so that headers from the build and host systems wouldn't be mixed).  


Of course it would also always work to build the tables at run-time, but I suspect that would be a bit frowned upon.
    Mirek

      parent reply	other threads:[~2012-08-20 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 20:19 cross-compiling difficulty with on-the-fly gen/build/use paradigm John Baron
2012-08-18 13:10 ` Steve Grubb
2012-08-20 16:47 ` Miloslav Trmac [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=602295677.17172703.1345481226523.JavaMail.root@redhat.com \
    --to=mitr@redhat.com \
    --cc=john.baron@schneider-electric.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox