ts-7000
[Top] [All Lists]

Re: [ts-7000] TS7800: EABI vs OABI compiler issues with userland code (O

To:
Subject: Re: [ts-7000] TS7800: EABI vs OABI compiler issues with userland code (OABI) accessing driver (EABI)
From: Christian Gagneraud <>
Date: Fri, 13 Mar 2009 10:30:41 +0000
Tom Panzarella wrote:
> I have written a kernel driver for a particular piece of hardware (a  
> pc104 board that I am connecting to the TS7800) that we are using. The  
> driver code has been compiled with the GNU EABI compiler as this was  
> the compiler that was used to build the stock 2.6.21-ts kernel which  
> I'm using on my 7800. The driver works great and when tested with a  
> static user-land binary compiled with the EABI compiler, I can  
> exercise all the exposed functions to my hardware (via `ioctl').

Hi Tom,

What you need to do is:
- use EABI toolchain to build kernel and module
- activate the OABI compatibility in the kernel (menu kernel features, 
option "Allow old ABI to run with this kernel")
- use an OABI root fs
- build all your shared library and programs with the old ABI toolchain

You can get more information here:
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7800-linux/cross-toolchains/README.EABIvsOABI
and
http://wiki.debian.org/ArmEabiPort

Chris.

> 
> Now, I need to write a user-land application that uses this driver but  
> also needs to link to shared object files (.so libraries). My  
> understanding (verified through empirical testing) is that the EABI  
> compiler can only create static binaries, so I am using the OABI  
> compiler to build my user-land application. The problem I am  
> experiencing is that when I call into my driver from the user land  
> code that is compiled with the OABI compiler my driver is returning an  
> error to the ioctl system call because the passed in command argument  
> is invalid, only for ioctl's that take an argument. The arguments to  
> the ioctl calls for my driver are pointers to structures that get  
> filled in by the driver code. Part of the encoding of an ioctl command  
> takes into account the size of this buffer (you can verify this by  
> looking at linux/ioctl.h which ultimately points you to asm/ioctl.h).  
> Assuming my structure that I am passing by pointer to ioctl is called  
> `foo', it turns out that calling sizeof(foo) for the EABI compiler  
> returns 11 bytes (which is correct) but for the OABI compiler  
> sizeof(foo) returns 12 bytes.
> 
> This `sizeof' discrepancy completely explains why my driver will not  
> accept the ioctl calls from the OABI compiled user-land code.  But now  
> I am stuck. Does anyone have any advice on what I can do here? My  
> kernel driver needs to be built with the EABI compiler as that is how  
> the kernel was built. My user-land code needs to link to shared object  
> files which forces me into using the OABI compiler. But the OABI and  
> EABI compilers are inconsistent/incompatible with respect to (at  
> least) the `sizeof' on my struct. Is there a version of the EABI  
> compiler that can create dynamically linked binaries? As this would be  
> my preferred choice because I have a little more flexibility in user- 
> land than I do in the kernel and for this production application I  
> would rather stick with the stock/supported TS kernel on the 7800. Any  
> thoughts?
> 
> Thanks in advance,
> Tom.
> 
> PS- Ronald, I am copying you as Grant, one of your tech support  
> engineers, mentioned that you would be best to help me with this but  
> that you were not available by phone today. Any help you can provide  
> via email is greatly appreciated.
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU