[PATCH] Always inline system calls
Carmelo Amoroso
carmelo73 at gmail.com
Mon Dec 3 21:33:39 UTC 2007
Carmelo Amoroso wrote:
> Hans-Christian Egtvedt wrote:
>> On Tue, 2007-11-27 at 08:54 +0100, Joakim Tjernlund wrote:
>>> On Tue, 2007-11-27 at 08:31 +0100, Hans-Christian Egtvedt wrote:
>>>> Haavard Skinnemoen wrote:
>>>>> On Fri, 16 Nov 2007 16:44:09 +0100
>>>>> Carmelo AMOROSO <carmelo.amoroso at st.com> wrote:
>>>>>
>>>>>> Just an idea... why not redefining 'inline' into
>>>>>> ldso/ldso/avr32/dl-syscalls.h that is included
>>>>>> at the top of ldso/include/dl-syscall.h.
>>>>>> This will not affect any other architectures, letting
>>>>>> the compiler to do the best choice ?
>>>>> Are you sure no other architectures need this? gcc tends to get
>>>>> extremely reluctant about inlining when compiling with -Os, and I have
>>>>> a hard time believing that avr32 is the only architecture that can't
>>>>> call functions before the GOT has been initialized.
>>>>>
>>>>> Actually, we probably can call functions before the GOT has been
>>>>> set up
>>>>> if ldso is compiled with enough optimization, but I think it's more
>>>>> robust to just make sure that the functions that are called early are
>>>>> always inlined.
>>>>>
>>>> This thread died, I can always make a patch for doing the inline
>>>> stuff only AVR32 specific. At least if others are seeing similar
>>>> problems. For example Buildroot will compile uClibc with -Os.
>>> I think always inline is better. As I recall there are some syscalls
>>> that must be inline or ldso will break for most archs
>>>
>>
>> Are there any architectures which break because of always inlining?
>>
>> Are there a huge difference in the binary size because of always inline?
>>
> Merged, cheers.
> Carmelo
>
Hello,
while doing some test for SH4 to measure size increase for 'always inline' changes,
doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following error:
../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in class 'R0_REGS'
../ldso/ldso/dl-elf.c:858: error: this is the insn:
(insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
(mem/u/c:SI (plus:SI (reg:SI 12 r12)
(reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
(expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
(expr_list:REG_EQUIV (symbol_ref:SI ("_dl_pagesize") <var_decl 0x313a720 _dl_pagesize>)
(nil))))
either running with -Os or -O0.
I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
otherwise I suspect we should go back on my proposal in using always inline
only for arch strictly requiring it.
Carmelo
More information about the uClibc
mailing list