Re: `sed`ing asm-offsets (Re: gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >   sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /*
> > \3 */:; s:->::; p;}" < asm-offsets.s
[]
>  >  Can you come up with a _minimal_ fix that makes it compatible with
>  >  busy-box AND GNU sed?
>
>  Script works in GNU and busybox sed, except that "$#" thing.
>  Let's wait for `set -x` feedback.

Unreadable for humans `sed` can be as short as this:

[busybox] sed '/#def/s-.[$#]- -gp;d'

or without "-fverbose-asm" (i.e. #comments after instruction) even like this

olecom@flower:/tmp/blinux$ busybox sed '/#def/s [$]  p;d'
arch/x86/kernel/asm-offsets.s
+ busybox sed '/#def/s [$]  p;d' arch/x86/kernel/asm-offsets.s
#define tsk_state 0 /*offsetof(struct task_struct, state)*/
#define tsk_flags 20 /*offsetof(struct task_struct, flags)*/
#define tsk_pid 328 /*offsetof(struct task_struct, pid)*/
olecom@flower:/tmp/blinux$

The only thing to change is (unreadable) #define in asm-offsets.c:

#define DEFINE(sym, val) \
        asm volatile("\n#define " #sym " %0 /*" #val "*/": : "i" (val))

(BLANK also, but it's a phony load)
_____
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux