Tiny Core Linux

General TC => General TC Talk => Topic started by: curaga on May 13, 2012, 02:32:07 PM

Title: Latest in magic cflags
Post by: curaga on May 13, 2012, 02:32:07 PM
http://lists.busybox.net/pipermail/busybox/2012-May/077816.html

On the busybox list it was pointed out that recent GCC includes a huge eh_frame section in binaries. Disabling this prevents debugging and pthread_cancel, but in a quick test cut 12% off a busybox build with our config.

So the magic is "-fno-asynchronous-unwind-tables". Adding it to the wiki, but announcing here too so everyone's aware ;)
Title: Re: Latest in magic cflags
Post by: AmatCoder on May 13, 2012, 05:30:06 PM
recent GCC means 4.7.0 version, isn't?
Title: Re: Latest in magic cflags
Post by: curaga on May 14, 2012, 04:32:53 AM
No, I got such a section even with gcc 4.2. Not sure exactly what's the version cutoff here.
Title: Re: Latest in magic cflags
Post by: bmarkus on May 14, 2012, 05:01:12 AM
Just tried with tumbler, but got no any size rediction.
Title: Re: Latest in magic cflags
Post by: curaga on May 14, 2012, 05:10:48 AM
size -A /path/to/bin/tumbler | grep eh_frame

Before and after?
Title: Re: Latest in magic cflags
Post by: AmatCoder on May 14, 2012, 05:37:01 AM
No, I got such a section even with gcc 4.2. Not sure exactly what's the version cutoff here.

Since gcc 4.2? It does not seem possible....There must be a problem in busybox build system.
Title: Re: Latest in magic cflags
Post by: AmatCoder on May 14, 2012, 05:48:09 AM
I tried busybox 1.20.0 with gcc 4.6.1 without -fno-asynchronous-unwind-tables
Code: [Select]
tc@box:~/busybox-1.20.0$ make defconfig
tc@box:~/busybox-1.20.0$ make
tc@box:~/busybox-1.20.0$ size -A busybox | grep eh_frame
.eh_frame_hdr        44   135260064
.eh_frame           200   135260108
tc@box:~/busybox-1.20.0$ size -A busybox_unstripped | grep eh_frame
.eh_frame_hdr        44   135260064
.eh_frame           200   135260108

I don't get a huge .eh_frame section here... Is it produced by some custom configuration?
Title: Re: Latest in magic cflags
Post by: curaga on May 14, 2012, 06:03:45 AM
That I don't know. Our busybox config is available under release/src, though.
Title: Re: Latest in magic cflags
Post by: AmatCoder on May 14, 2012, 07:10:34 AM
I can not reproduce with /release/src/busybox_1.19.4_030812.tgz

Applied patches and config and I get a normal .eh_frame section... any further step?
Even binary included in archive has normal .eh_frame size...