[mmotm:master 216/292] include/linux/string.h:199:24: error: redefinition of 'strcpy'

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

 



tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   5c84fce56580d5297cd473b57f893e362b332109
commit: abb4387dc4c5898e87a93f152d3ad4b991397f22 [216/292] include/linux/string.h: add the option of fortified string.h functions
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout abb4387dc4c5898e87a93f152d3ad4b991397f22
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   In file included from include/linux/bitmap.h:8:0,
                    from include/linux/cpumask.h:11,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ptrace.h:5,
                    from arch/xtensa/kernel/asm-offsets.c:21:
>> include/linux/string.h:199:24: error: redefinition of 'strcpy'
    __FORTIFY_INLINE char *strcpy(char *p, const char *q)
                           ^
   In file included from include/linux/string.h:18:0,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ptrace.h:5,
                    from arch/xtensa/kernel/asm-offsets.c:21:
   arch/xtensa/include/asm/string.h:19:21: note: previous definition of 'strcpy' was here
    static inline char *strcpy(char *__dest, const char *__src)
                        ^
   In file included from include/linux/bitmap.h:8:0,
                    from include/linux/cpumask.h:11,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ptrace.h:5,
                    from arch/xtensa/kernel/asm-offsets.c:21:
>> include/linux/string.h:210:24: error: redefinition of 'strncpy'
    __FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)
                           ^
   In file included from include/linux/string.h:18:0,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ptrace.h:5,
                    from arch/xtensa/kernel/asm-offsets.c:21:
   arch/xtensa/include/asm/string.h:38:21: note: previous definition of 'strncpy' was here
    static inline char *strncpy(char *__dest, const char *__src, size_t __n)
                        ^
   make[2]: *** [arch/xtensa/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [sub-make] Error 2

vim +/strcpy +199 include/linux/string.h

   193	void fortify_panic(const char *name) __noreturn __cold;
   194	void __read_overflow(void) __compiletime_error("detected read beyond size of object passed as 1st parameter");
   195	void __read_overflow2(void) __compiletime_error("detected read beyond size of object passed as 2nd parameter");
   196	void __write_overflow(void) __compiletime_error("detected write beyond size of object passed as 1st parameter");
   197	
   198	#if !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)
 > 199	__FORTIFY_INLINE char *strcpy(char *p, const char *q)
   200	{
   201		size_t p_size = __builtin_object_size(p, 0);
   202		size_t q_size = __builtin_object_size(q, 0);
   203		if (p_size == (size_t)-1 && q_size == (size_t)-1)
   204			return __builtin_strcpy(p, q);
   205		if (strscpy(p, q, p_size < q_size ? p_size : q_size) < 0)
   206			fortify_panic(__func__);
   207		return p;
   208	}
   209	
 > 210	__FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)
   211	{
   212		size_t p_size = __builtin_object_size(p, 0);
   213		if (__builtin_constant_p(size) && p_size < size)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux