[PATCH] Makefile: fix make sizes, add make dir/file.[os]
Denis Vlasenko
vda at ilport.com.ua
Thu Feb 23 13:51:37 UTC 2006
Hi,
"make sizes" removes stripped busybox executable and replaces
it by unstripped one. This is a rather unexpected behavior.
This patch fixes it.
Also it adds support for manual compilation to specified
.o file and generating assembly output (.s file) with
make dir/file.o and make dir/file.s, respectively.
I typically use it like this:
Add markers around code:
+asm("#1");
unsigned char args1[4+512] = {WIN_IDENTIFY,0,0,1,};
+asm("#2");
Then:
# make miscutils/hdparm.s
gcc -I/.share/usr/src2/bbox/busybox.tst/include -I/.share/usr/src2/bbox/busybox.tst/include -I/.share/usr/src2/bbox/busybox.tst/libbb -funsigned-char -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wstrict-prototypes -Wshadow -Os -march=i386 -mpreferred-stack-boundary=2 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG -falign-functions=1 -falign-labels=1 -falign-loops=1 -falign-jumps=1 -Os miscutils/hdparm.c -S -o miscutils/hdparm.s
And now it's easy to see now much code/data
was generated:
# grep -F -C15 "#1" miscutils/hdparm.s
cmpl $-42, (%eax)
jne .L609
pushl $.LC468
.L651:
call puts
jmp .L650
.L609:
pushl $.LC469
call bb_perror_msg
.L650:
popl %eax
.L561:
cmpl $0, get_IDentity
je .L611
#APP
#1
#NO_APP
leal 64(%esp), %ebx
pushl $516
pushl $.LC470
pushl %ebx
call memcpy
#APP
#2
#NO_APP
call no_scsi
call no_xt
pushl %ebx
pushl $799
pushl %edi
call ioctl
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make.patch
Type: text/x-diff
Size: 1358 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060223/0a426369/attachment.bin
More information about the busybox
mailing list