lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207050825.5E6Jlwd8-lkp@intel.com>
Date:   Tue, 5 Jul 2022 08:24:55 +0800
From:   kernel test robot <lkp@...el.com>
To:     Matteo Croce <mcroce@...rosoft.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Emil Renner Berthing <emil.renner.berthing@...onical.com>
Subject: [esmil:visionfive 3/49] arch/riscv/lib/string.c:48: undefined
 reference to `_mcount'

tree:   https://github.com/esmil/linux visionfive
head:   575362a88f9e6ef14a1a35eb7bd1593745cf019e
commit: 163ef6b6c194ae4d1f709053e4677687e6b87a27 [3/49] riscv: optimized memmove
config: riscv-buildonly-randconfig-r001-20220703 (https://download.01.org/0day-ci/archive/20220705/202207050825.5E6Jlwd8-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/esmil/linux/commit/163ef6b6c194ae4d1f709053e4677687e6b87a27
        git remote add esmil https://github.com/esmil/linux
        git fetch --no-tags esmil visionfive
        git checkout 163ef6b6c194ae4d1f709053e4677687e6b87a27
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   riscv64-linux-ld: arch/riscv/purgatory/purgatory.ro: in function `.L355':
   string.c:(.text+0x20e0): undefined reference to `_mcount'
   riscv64-linux-ld: arch/riscv/purgatory/purgatory.ro: in function `__memcpy':
>> arch/riscv/lib/string.c:48: undefined reference to `_mcount'


vim +48 arch/riscv/lib/string.c

6a48862f530a59 Matteo Croce 2021-09-29  30  
6a48862f530a59 Matteo Croce 2021-09-29  31  void *__memcpy(void *dest, const void *src, size_t count)
6a48862f530a59 Matteo Croce 2021-09-29  32  {
6a48862f530a59 Matteo Croce 2021-09-29  33  	union const_types s = { .as_u8 = src };
6a48862f530a59 Matteo Croce 2021-09-29  34  	union types d = { .as_u8 = dest };
6a48862f530a59 Matteo Croce 2021-09-29  35  	int distance = 0;
6a48862f530a59 Matteo Croce 2021-09-29  36  
6a48862f530a59 Matteo Croce 2021-09-29  37  	if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) {
6a48862f530a59 Matteo Croce 2021-09-29  38  		if (count < MIN_THRESHOLD)
6a48862f530a59 Matteo Croce 2021-09-29  39  			goto copy_remainder;
6a48862f530a59 Matteo Croce 2021-09-29  40  
6a48862f530a59 Matteo Croce 2021-09-29  41  		/* Copy a byte at time until destination is aligned. */
6a48862f530a59 Matteo Croce 2021-09-29  42  		for (; d.as_uptr & WORD_MASK; count--)
6a48862f530a59 Matteo Croce 2021-09-29  43  			*d.as_u8++ = *s.as_u8++;
6a48862f530a59 Matteo Croce 2021-09-29  44  
6a48862f530a59 Matteo Croce 2021-09-29  45  		distance = s.as_uptr & WORD_MASK;
6a48862f530a59 Matteo Croce 2021-09-29  46  	}
6a48862f530a59 Matteo Croce 2021-09-29  47  
6a48862f530a59 Matteo Croce 2021-09-29 @48  	if (distance) {
6a48862f530a59 Matteo Croce 2021-09-29  49  		unsigned long last, next;
6a48862f530a59 Matteo Croce 2021-09-29  50  
6a48862f530a59 Matteo Croce 2021-09-29  51  		/*
6a48862f530a59 Matteo Croce 2021-09-29  52  		 * s is distance bytes ahead of d, and d just reached
6a48862f530a59 Matteo Croce 2021-09-29  53  		 * the alignment boundary. Move s backward to word align it
6a48862f530a59 Matteo Croce 2021-09-29  54  		 * and shift data to compensate for distance, in order to do
6a48862f530a59 Matteo Croce 2021-09-29  55  		 * word-by-word copy.
6a48862f530a59 Matteo Croce 2021-09-29  56  		 */
6a48862f530a59 Matteo Croce 2021-09-29  57  		s.as_u8 -= distance;
6a48862f530a59 Matteo Croce 2021-09-29  58  
6a48862f530a59 Matteo Croce 2021-09-29  59  		next = s.as_ulong[0];
6a48862f530a59 Matteo Croce 2021-09-29  60  		for (; count >= BYTES_LONG; count -= BYTES_LONG) {
6a48862f530a59 Matteo Croce 2021-09-29  61  			last = next;
6a48862f530a59 Matteo Croce 2021-09-29  62  			next = s.as_ulong[1];
6a48862f530a59 Matteo Croce 2021-09-29  63  
6a48862f530a59 Matteo Croce 2021-09-29  64  			d.as_ulong[0] = last >> (distance * 8) |
6a48862f530a59 Matteo Croce 2021-09-29  65  					next << ((BYTES_LONG - distance) * 8);
6a48862f530a59 Matteo Croce 2021-09-29  66  
6a48862f530a59 Matteo Croce 2021-09-29  67  			d.as_ulong++;
6a48862f530a59 Matteo Croce 2021-09-29  68  			s.as_ulong++;
6a48862f530a59 Matteo Croce 2021-09-29  69  		}
6a48862f530a59 Matteo Croce 2021-09-29  70  
6a48862f530a59 Matteo Croce 2021-09-29  71  		/* Restore s with the original offset. */
6a48862f530a59 Matteo Croce 2021-09-29  72  		s.as_u8 += distance;
6a48862f530a59 Matteo Croce 2021-09-29  73  	} else {
6a48862f530a59 Matteo Croce 2021-09-29  74  		/*
6a48862f530a59 Matteo Croce 2021-09-29  75  		 * If the source and dest lower bits are the same, do a simple
6a48862f530a59 Matteo Croce 2021-09-29  76  		 * 32/64 bit wide copy.
6a48862f530a59 Matteo Croce 2021-09-29  77  		 */
6a48862f530a59 Matteo Croce 2021-09-29  78  		for (; count >= BYTES_LONG; count -= BYTES_LONG)
6a48862f530a59 Matteo Croce 2021-09-29  79  			*d.as_ulong++ = *s.as_ulong++;
6a48862f530a59 Matteo Croce 2021-09-29  80  	}
6a48862f530a59 Matteo Croce 2021-09-29  81  
6a48862f530a59 Matteo Croce 2021-09-29  82  copy_remainder:
6a48862f530a59 Matteo Croce 2021-09-29  83  	while (count--)
6a48862f530a59 Matteo Croce 2021-09-29  84  		*d.as_u8++ = *s.as_u8++;
6a48862f530a59 Matteo Croce 2021-09-29  85  
6a48862f530a59 Matteo Croce 2021-09-29  86  	return dest;
6a48862f530a59 Matteo Croce 2021-09-29  87  }
6a48862f530a59 Matteo Croce 2021-09-29  88  EXPORT_SYMBOL(__memcpy);
6a48862f530a59 Matteo Croce 2021-09-29  89  

:::::: The code at line 48 was first introduced by commit
:::::: 6a48862f530a593cadaab50ae4006b3a70a112e6 riscv: optimized memcpy

:::::: TO: Matteo Croce <mcroce@...rosoft.com>
:::::: CC: Emil Renner Berthing <emil.renner.berthing@...onical.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ