Compiling busybox to .s assembly file

Eric Schulte eschulte at cs.unm.edu
Wed Mar 2 04:24:11 UTC 2011


Denys Vlasenko <vda.linux at googlemail.com> writes:

> On Thursday 24 February 2011 18:17, Eric Schulte wrote:
>> Hello,
>> 
>> I'm hoping to generate a compiled text asm file (gcc -S) of the busybox
>> executable.  I've looked at scripts/showasm, but it uses objdump the
>> output of which could not (easily) then be edited and linked to generate
>> an executable.
>> 
>> I've spend a good deal of time mucking around in the Makefile, but
>> having never fully felt comfortable with Makefiles even in relatively
>> simple cases, the busybox Makefile is largely opaque to me.
>> 
>> If anyone can offer a suggestion, or point me in the right direction I
>> will be very appreciative.  Once I get this working if there is any
>> interest I would be happy to wrap it up in a script which could be
>> included in scripts/ -- although I'm not sure that such functionality
>> would be generally useful.
>
> Please see scripts/Makefile.IMA
>
> It may be a bit bit-rotted (because I don't use it, and people
> who do use it send me updates far too infrequently), so you might
> be forced to fix it up before it'll work for you...
>
> It runs entire compilation as one gcc invocation.
>
> I imagine adding the -S switch might be an easy-ich way
> to generate one BIG .s file with the entire busybox
> code.

Hi Denys,

This would be a very nice option, and while I'm currently able to tinker
with the asm for a single applet it would be preferable to have the
entire busybox program compiled to a single .s file.  I've tried playing
with Makefile.IMA, and more generally with the "--combine" option to
GCC, however I keep running into the same error, namely

  include/libbb.h:1670: error: conflicting types for ‘ptr_to_globals’

It seems that this error has cropped up in the past.
http://lists.busybox.net/pipermail/busybox/2007-March/060781.html
http://www.mail-archive.com/busybox@busybox.net/msg04074.html
Unfortunately these messages haven't indicated a viable solution.

Thanks for the suggestion, when scripts/Makefile.IMA is once again in a
working state, sneaking a -S into the gcc invocation should work well.

Best -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/


More information about the busybox mailing list