• Andrew Morton's avatar
    [PATCH] string fixes for gcc 3.4 · c545699a
    Andrew Morton authored
    From: Andi Kleen <ak@muc.de>
    
    gcc 3.4 optimizes sprintf(foo,"%s",string) into strcpy.  Unfortunately that
    isn't seen by the inliner and linux/i386 has no out-of-line strcpy so you
    end up with a linker error.
    
    This patch adds out of line copies for most string functions to avoid this.
    Actually it doesn't export them to modules yet, that would be the next
    step.
    
    BTW In my opinion we shouldn't use inline string functions at all.  The
    __builtin_str* in modern gcc are better (I used them very successfully on
    x86-64) and for the bigger functions like strrchr,strtok et.al.  it just
    doesn't make any sense to inline them or even code them in assembler.
    
    Also fix the bcopy prototype gcc was complaining about.
    c545699a
string.c 11.5 KB