public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* Audit Cross Compile Support
@ 2013-09-20 12:33 clshotwe
  2013-09-20 13:36 ` LC Bruzenak
  2013-09-20 16:07 ` Steve Grubb
  0 siblings, 2 replies; 11+ messages in thread
From: clshotwe @ 2013-09-20 12:33 UTC (permalink / raw)
  To: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 1107 bytes --]

Everyone,

I apologize for my previous patch submission (8/23/2013 set of patches) 
without any background information.  I am looking to cross compile audit 
for the ARM and PPC platforms.  I am not sure if this has been looked into 
before but I would get some feedback on a general approach. 

I tried to do a base cross compile but I ran into an issue when the table 
header files are generated, the executable generated by the makefile were 
built for the target and not the host.  I modified the makefile to build 
them for the host but I realized the executables would pull in the headers 
from the host rather than the target.  I attempted to work around this by 
porting the gen_tables.c algorithm to a python script to duplicate the 
header file generation using the target headers rather than the host.  Is 
this a good approach?  Is there a better way that this could be done a 
better way that does not use python?  Is this a desired feature?

Any feedback would be greatly appreciated.

Thanks,
Clayton

Clayton Shotwell
Software Engineer
clshotwe@rockwellcollins.com
www.rockwellcollins.com 


[-- Attachment #1.2: Type: text/html, Size: 1503 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
  2013-09-20 12:33 Audit Cross Compile Support clshotwe
@ 2013-09-20 13:36 ` LC Bruzenak
       [not found]   ` <CAC2S8kgC4Riy_8y0znbDFjQPo0AAaxZEe7uwc7bZqCWXzfcU6A@mail.gmail.com>
  2013-09-20 16:07 ` Steve Grubb
  1 sibling, 1 reply; 11+ messages in thread
From: LC Bruzenak @ 2013-09-20 13:36 UTC (permalink / raw)
  To: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 1133 bytes --]

On 09/20/2013 07:33 AM, clshotwe@rockwellcollins.com wrote:
> Everyone,
>
> I apologize for my previous patch submission (8/23/2013 set of
> patches) without any background information.  I am looking to cross
> compile audit for the ARM and PPC platforms.  I am not sure if this
> has been looked into before but I would get some feedback on a general
> approach.  
>
> I tried to do a base cross compile but I ran into an issue when the
> table header files are generated, the executable generated by the
> makefile were built for the target and not the host.  I modified the
> makefile to build them for the host but I realized the executables
> would pull in the headers from the host rather than the target.  I
> attempted to work around this by porting the gen_tables.c algorithm to
> a python script to duplicate the header file generation using the
> target headers rather than the host.  Is this a good approach?  Is
> there a better way that this could be done a better way that does not
> use python?  Is this a desired feature?

I use mock. It's pretty straightforward.

LCB

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


[-- Attachment #1.2: Type: text/html, Size: 2131 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
       [not found]   ` <CAC2S8kgC4Riy_8y0znbDFjQPo0AAaxZEe7uwc7bZqCWXzfcU6A@mail.gmail.com>
@ 2013-09-20 15:18     ` clshotwe
  2013-09-20 15:30       ` LC Bruzenak
       [not found]       ` <523C684F.5030901@magitekltd.com>
  0 siblings, 2 replies; 11+ messages in thread
From: clshotwe @ 2013-09-20 15:18 UTC (permalink / raw)
  To: lenny; +Cc: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 1202 bytes --]

Lenny,

LC Bruzenak <lenny@magitekltd.com> wrote on 09/20/2013 8:36 AM:

> I tried to do a base cross compile but I ran into an issue when the
> table header files are generated, the executable generated by the
> makefile were built for the target and not the host.  I modified the
> makefile to build them for the host but I realized the executables
> would pull in the headers from the host rather than the target.  I
> attempted to work around this by porting the gen_tables.c 
> algorithm to
> a python script to duplicate the header file generation using the
> target headers rather than the host.  Is this a good approach?  Is
> there a better way that this could be done a better way 
> that does not
> use python?  Is this a desired feature?
> 
> 
> I use mock. It's pretty straightforward.

I don't believe mock will be able to execute the gen_tables executables 
that are built for the ARM/PPC.  I think the only way I could do that 
would be to setup a QEMU target and that seems a little excessive.

Thanks,
Clayton

Clayton Shotwell
Software Engineer
MS 137-157, 855 35th St NE, Cedar Rapids, IA, 52498-3161, US
Phone: 319-263-2385
clshotwe@rockwellcollins.com
www.rockwellcollins.com 




[-- Attachment #1.2: Type: text/html, Size: 1701 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
  2013-09-20 15:18     ` clshotwe
@ 2013-09-20 15:30       ` LC Bruzenak
       [not found]       ` <523C684F.5030901@magitekltd.com>
  1 sibling, 0 replies; 11+ messages in thread
From: LC Bruzenak @ 2013-09-20 15:30 UTC (permalink / raw)
  To: clshotwe; +Cc: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]

On 09/20/2013 10:18 AM, clshotwe@rockwellcollins.com wrote:
>
>
> I don't believe mock will be able to execute the gen_tables
> executables that are built for the ARM/PPC.  I think the only way I
> could do that would be to setup a QEMU target and that seems a little
> excessive.
>
Unless I do not understand, it appears that the mock build on koji is
able to do this. Is the arch different?
http://kojipkgs.fedoraproject.org//packages/audit/2.3.2/1.fc20/data/logs/armv7hl/build.log

LCB

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


[-- Attachment #1.2: Type: text/html, Size: 1474 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
       [not found]       ` <523C684F.5030901@magitekltd.com>
@ 2013-09-20 15:35         ` LC Bruzenak
  2013-09-20 15:40           ` clshotwe
  0 siblings, 1 reply; 11+ messages in thread
From: LC Bruzenak @ 2013-09-20 15:35 UTC (permalink / raw)
  To: clshotwe, linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 572 bytes --]

On 09/20/2013 10:22 AM, LC Bruzenak wrote:
> On 09/20/2013 10:18 AM, clshotwe@rockwellcollins.com wrote:
>>
>> I don't believe mock will be able to execute the gen_tables
>> executables that are built for the ARM/PPC.  I think the only way I
>> could do that would be to setup a QEMU target and that seems a little
>> excessive. 
>
> I wonder how koji does it?
>
> I see an ARM build there:
> http://koji.fedoraproject.org/koji/buildinfo?buildID=439098
>
Oh. There are different build hosts supporting different arches.

LCB

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


[-- Attachment #1.2: Type: text/html, Size: 1700 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
  2013-09-20 15:35         ` LC Bruzenak
@ 2013-09-20 15:40           ` clshotwe
  0 siblings, 0 replies; 11+ messages in thread
From: clshotwe @ 2013-09-20 15:40 UTC (permalink / raw)
  To: LC Bruzenak; +Cc: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 1268 bytes --]

Lenny,

LC Bruzenak <lenny@magitekltd.com> wrote on 09/20/2013 10:35:52 AM:

> I wonder how koji does it?
> 
> I see an ARM build there:
> http://koji.fedoraproject.org/koji/buildinfo?buildID=439098

> Oh. There are different build hosts supporting different arches.

That is correct.  When you cross compile, the host and target are set 
differently.  For instance, I get

checking build system type... x86_64-unknown-linux-gnu
checking host system type... armv7hl-redhat-linux-gnu
checking target system type... armv7hl-redhat-linux-gnu

instead of 

checking build system type... armv7hl-redhat-linux-gnu
checking host system type... armv7hl-redhat-linux-gnu
checking target system type... armv7hl-redhat-linux-gnu

I will not be able to run the ARM built executabled on the x86_64 machine. 
I have attempted to modify the makefiles to build the gen_tables 
executables for the x86_64 architecture but I realized that will cause the 
wrong header files to be brought in.  Even if I was able to get the 
correct header files brought in, they will not have the correct macros 
defined, possibly causing the wrong values to be brought into the header 
files.


Thanks,
Clayton

Clayton Shotwell
Software Engineer
clshotwe@rockwellcollins.com
www.rockwellcollins.com 


[-- Attachment #1.2: Type: text/html, Size: 1956 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Audit Cross Compile Support
  2013-09-20 12:33 Audit Cross Compile Support clshotwe
  2013-09-20 13:36 ` LC Bruzenak
@ 2013-09-20 16:07 ` Steve Grubb
  2013-09-20 17:54   ` clshotwe
  1 sibling, 1 reply; 11+ messages in thread
From: Steve Grubb @ 2013-09-20 16:07 UTC (permalink / raw)
  To: linux-audit; +Cc: clshotwe

On Friday, September 20, 2013 07:33:46 AM clshotwe@rockwellcollins.com wrote:
> I apologize for my previous patch submission (8/23/2013 set of patches) 
> without any background information.  I am looking to cross compile audit 
> for the ARM and PPC platforms.  I am not sure if this has been looked into 
> before but I would get some feedback on a general approach. 

The main thing I would have to to do to pull it in is make sure it produces 
equivalent headers. I also need to see that "make check" still works, too. Its 
caught bugs in the past that would have been a big problem if released.

-Steve

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

* Re: Audit Cross Compile Support
  2013-09-20 16:07 ` Steve Grubb
@ 2013-09-20 17:54   ` clshotwe
  0 siblings, 0 replies; 11+ messages in thread
From: clshotwe @ 2013-09-20 17:54 UTC (permalink / raw)
  To: Steve Grubb; +Cc: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 704 bytes --]

Steve,

Steve Grubb <sgrubb@redhat.com> wrote on 09/20/2013 11:07:23 AM:

> The main thing I would have to to do to pull it in is make
> sure it produces 
> equivalent headers. I also need to see that "make check" 
> still works, too. Its 
> caught bugs in the past that would have been a big problem
> if released.

I have done some base testing with the Python script I wrote and couldn't 
find any differences in the output generated. My main concern is adding 
dependencies on python and pyparsing to the build process. Would you like 
for me to resubmit the patch set I created for testing?

Thanks,
Clayton

Clayton Shotwell
Software Engineer
clshotwe@rockwellcollins.com
www.rockwellcollins.com 


[-- Attachment #1.2: Type: text/html, Size: 1065 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Audit Cross Compile Support
@ 2013-11-12 10:15 AKASHI Takahiro
  2013-11-14 16:05 ` clshotwe
  0 siblings, 1 reply; 11+ messages in thread
From: AKASHI Takahiro @ 2013-11-12 10:15 UTC (permalink / raw)
  To: clshotwe; +Cc: linux-audit@redhat.com

Hello Clayton,

I picked up your patches and tried to cross-build the package for
AArch64. In the following code of lib/gen_tables.py,

	parser.add_argument('--i2s', dest='gen_i2s', action='',

should be

	parser.add_argument('--i2s', dest='gen_i2s', action='store_true',

Right?

-Takahiro AKASHI

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

* Re: Audit Cross Compile Support
  2013-11-12 10:15 Audit Cross Compile Support AKASHI Takahiro
@ 2013-11-14 16:05 ` clshotwe
  2013-11-15  1:07   ` [PATCH] Fix gen_tables.py in parsing arguments AKASHI Takahiro
  0 siblings, 1 reply; 11+ messages in thread
From: clshotwe @ 2013-11-14 16:05 UTC (permalink / raw)
  To: AKASHI Takahiro; +Cc: linux-audit@redhat.com


[-- Attachment #1.1: Type: text/plain, Size: 799 bytes --]

AKASHI Takahiro <takahiro.akashi@linaro.org> wrote on 11/12/2013 04:15:36 
AM:

> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> To: clshotwe@rockwellcollins.com
> Cc: "linux-audit@redhat.com" <linux-audit@redhat.com>
> Date: 11/12/2013 04:17 AM
> Subject: Audit Cross Compile Support
> 
> Hello Clayton,
> 
> I picked up your patches and tried to cross-build the package for
> AArch64. In the following code of lib/gen_tables.py,
> 
>    parser.add_argument('--i2s', dest='gen_i2s', action='',
> 
> should be
> 
>    parser.add_argument('--i2s', dest='gen_i2s', action='store_true',
> 
> Right?

Yes it should be.  Thanks for catching that.  Would you like updated 
patches sent out?

Thanks,
Clayton

Clayton Shotwell
Software Engineer
clshotwe@rockwellcollins.com
www.rockwellcollins.com 


[-- Attachment #1.2: Type: text/html, Size: 1395 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* [PATCH] Fix gen_tables.py in parsing arguments
  2013-11-14 16:05 ` clshotwe
@ 2013-11-15  1:07   ` AKASHI Takahiro
  0 siblings, 0 replies; 11+ messages in thread
From: AKASHI Takahiro @ 2013-11-15  1:07 UTC (permalink / raw)
  To: clshotwe; +Cc: linux-audit

Hi Clayton

Patch only for my changes, nothing fancy.

-Takahiro AKASHI



action in add_argument() should not be NULL('').

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 lib/gen_tables.py |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/gen_tables.py b/lib/gen_tables.py
index 88039b1..433dd8b 100644
--- a/lib/gen_tables.py
+++ b/lib/gen_tables.py
@@ -388,19 +388,19 @@ def main():
         
         # Setup the argument parser and parse the arguments given
         parser = argparse.ArgumentParser(description='Generate tables header files.')
-        parser.add_argument('--i2s', dest='gen_i2s', action='',
+        parser.add_argument('--i2s', dest='gen_i2s', action='store_true',
                         help='Generate i2s tables')
-        parser.add_argument('--i2s-transtab', dest='gen_i2s_transtab', action='',
+        parser.add_argument('--i2s-transtab', dest='gen_i2s_transtab', action='store_true',
                         help='Generate transtab tables')
-        parser.add_argument('--s2i', dest='gen_s2i', action='',
+        parser.add_argument('--s2i', dest='gen_s2i', action='store_true',
                         help='Generate s2i tables')
         # Make sure uppercase and lowercase are mutually exclusive
         group = parser.add_mutually_exclusive_group()
-        group.add_argument('--uppercase', dest='uppercase', action='',
+        group.add_argument('--uppercase', dest='uppercase', action='store_true',
                         help='All characters are uppercase')
-        group.add_argument('--lowercase', dest='lowercase', action='',
+        group.add_argument('--lowercase', dest='lowercase', action='store_true',
                         help='All characters are lowercase')
-        parser.add_argument('--duplicate-ints', dest='allow_duplicate_ints', action='',
+        parser.add_argument('--duplicate-ints', dest='allow_duplicate_ints', action='store_true',
                         help='Allow duplicate integers')
         parser.add_argument('prefix', help='The prefix of the output file to use')
         parser.add_argument('source', type=argparse.FileType('r'),
-- 
1.7.9.5

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

end of thread, other threads:[~2013-11-15  1:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-12 10:15 Audit Cross Compile Support AKASHI Takahiro
2013-11-14 16:05 ` clshotwe
2013-11-15  1:07   ` [PATCH] Fix gen_tables.py in parsing arguments AKASHI Takahiro
  -- strict thread matches above, loose matches on Subject: below --
2013-09-20 12:33 Audit Cross Compile Support clshotwe
2013-09-20 13:36 ` LC Bruzenak
     [not found]   ` <CAC2S8kgC4Riy_8y0znbDFjQPo0AAaxZEe7uwc7bZqCWXzfcU6A@mail.gmail.com>
2013-09-20 15:18     ` clshotwe
2013-09-20 15:30       ` LC Bruzenak
     [not found]       ` <523C684F.5030901@magitekltd.com>
2013-09-20 15:35         ` LC Bruzenak
2013-09-20 15:40           ` clshotwe
2013-09-20 16:07 ` Steve Grubb
2013-09-20 17:54   ` clshotwe

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