Rockbox mail archive
Subject: Re: How to build firmware (memcmp)
From: Alex Gitelman (alex_at_fg-soup.com)
You were right. Actual option is -fno-builtin
It's only required if optimization is on. So if you remove -O
it will compile OK without the option.
Firmware still does not loaf though.
Saturday, June 22, 2002, 2:01:55 AM, you wrote:
>> > 2. _memcmp could not be resolved so I had to add -lc to linker options in
>> > apps
>> Oh? What uses memcmp()? We should not rely on any external libc-like library
>> (we've recently worked hard to remove the newlib dependency) so if we need
>> memcmp() we should provide our own.
PS> Just a precision, gcc for IA32 target have builtin counterparts of standard
PS> strings operations (__builtin_strcpy, __builtin_strcmp, etc.) and memory
PS> operations (__builtin_memcpy, __builtin_memset, etc.). But when using gcc
PS> 2.95.x for SH target, I was never able to use builtin versions (the advantage
PS> of the builtin versions is that gcc can optimize them at compile-time).
PS> Maybe gcc 3.1 for SH target enables most of them. I think you'd better to use
PS> string.h for SH target (can be found in linux source) if you really want a good
PS> code (SH has a "cmp.str" instruction which compares 4 bytes at once -
PS> especially good to find a '\0' for example).
PS> The option to disable the builtin counterpart is, if I remember well,
PS> "-nobuiltin(s)", or somethink like that.
Page was last modified "Jan 10 2012" The Rockbox Crew