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

Re: various build failures




On Fri, 23 Jun 2006, Andreas Schwab wrote:

> Fixed in CVS.

Thanks Andreas, that did the trick.

I have one more build failure related to gcc-4.1.1. When I enable 
CONFIG_CC_OPTIMIZE_FOR_SIZE, I get this failure from the linker:

  LD      .tmp_vmlinux1
arch/m68k/mac/built-in.o: In function `iop_dump_one_iop':
arch/m68k/mac/iop.c:661: undefined reference to `strcpy'
arch/m68k/mac/iop.c:671: undefined reference to `strcpy'
kernel/built-in.o: In function `prof_cpu_mask_read_proc':
kernel/profile.c:385: undefined reference to `strcpy'
fs/built-in.o: In function `lock_get_status':
fs/locks.c:2014: undefined reference to `strcpy'
fs/locks.c:2018: undefined reference to `strcpy'
fs/built-in.o:fs/locks.c:2062: more undefined references to `strcpy' follow
make: *** [.tmp_vmlinux1] Error 1


The file arch/m68k/mac/iop.c was compiled like this,

  m68k-linux-gcc -Wp,-MD,arch/m68k/mac/.iop.o.d  -nostdinc -isystem 
/Volumes/btc-0.11/gcc-4.1.1-binutils-2.17.50.0.2-glibc-2.3.6/lib/gcc/m68k-linux/4.1.1/include 
-D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef 
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os 
-fno-omit-frame-pointer -fno-optimize-sibling-calls 
-fasynchronous-unwind-tables -g -pipe -fno-strength-reduce -ffixed-a2 
-Wdeclaration-after-statement -Wno-pointer-sign    -D"KBUILD_STR(s)=#s" 
-D"KBUILD_BASENAME=KBUILD_STR(iop)"  -D"KBUILD_MODNAME=KBUILD_STR(iop)" -c 
-o arch/m68k/mac/iop.o arch/m68k/mac/iop.c


What is strange is that arch/m68k/mac/iop.c doesn't actually use strcpy. 
It appears in the preprocessed source only once,

static inline __attribute__((always_inline)) char * strcpy(char * 
dest,const char *src)
{
  char *xdest = dest;

  __asm__ __volatile__
       ("1:\tmoveb %1@+,%0@+\n\t"
        "jne 1b"
 : "=a" (dest), "=a" (src)
        : "0" (dest), "1" (src) : "memory");
  return xdest;
}


And yet, objdump -t lists it as undefined,

$ m68k-linux-objdump -t arch/m68k/mac/iop.o|grep str
00000000 l    d  .rodata.str1.1 00000000 .rodata.str1.1
00000000 l    d  .debug_str     00000000 .debug_str
00000000         *UND*  00000000 strcpy


If I build with gcc-3.4.6, there's no problem, and objdump doesn't list 
the symbol in arch/m68k/mac/iop.o at all.

Any ideas? Is this a gcc bug?

-f



Reply to: