From: kernel test robot <hidden> Date: 2020-12-04 14:29:16
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
head: 4e4ed87981c764498942c52004c620bb8f104eac
commit: d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e [54/220] powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32
config: powerpc64-randconfig-r011-20201204 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 32c501dd88b62787d3a5ffda7aabcf4650dbe3cd)
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
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e
git remote add powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
git fetch --no-tags powerpc next-test
git checkout d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>
All warnings (new ones prefixed by >>):
arch/powerpc/kernel/vdso32/vgettimeofday.c:7:5: error: conflicting types for '__c_kernel_clock_gettime'
int __c_kernel_clock_gettime(clockid_t clock, struct old_timespec32 *ts,
^
arch/powerpc/include/asm/vdso/gettimeofday.h:183:5: note: previous declaration is here
int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
^
quoted
arch/powerpc/kernel/vdso32/vgettimeofday.c:13:5: warning: no previous prototype for function '__c_kernel_clock_gettime64' [-Wmissing-prototypes]
int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts,
^
arch/powerpc/kernel/vdso32/vgettimeofday.c:13:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts,
^
static
arch/powerpc/kernel/vdso32/vgettimeofday.c:25:5: error: conflicting types for '__c_kernel_clock_getres'
int __c_kernel_clock_getres(clockid_t clock_id, struct old_timespec32 *res,
^
arch/powerpc/include/asm/vdso/gettimeofday.h:185:5: note: previous declaration is here
int __c_kernel_clock_getres(clockid_t clock_id, struct __kernel_timespec *res,
^
1 warning and 2 errors generated.
vim +/__c_kernel_clock_gettime64 +13 arch/powerpc/kernel/vdso32/vgettimeofday.c
12
> 13 int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts,
14 const struct vdso_data *vd)
15 {
16 return __cvdso_clock_gettime_data(vd, clock, ts);
17 }
18
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2020-12-07 12:27:13
kernel test robot [off-list ref] writes:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
head: 4e4ed87981c764498942c52004c620bb8f104eac
commit: d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e [54/220] powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32
config: powerpc64-randconfig-r011-20201204 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 32c501dd88b62787d3a5ffda7aabcf4650dbe3cd)
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
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e
git remote add powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
git fetch --no-tags powerpc next-test
git checkout d0e3fc69d00d1f50d22d6b6acfc555ccda80ad1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>
All warnings (new ones prefixed by >>):
arch/powerpc/kernel/vdso32/vgettimeofday.c:7:5: error: conflicting types for '__c_kernel_clock_gettime'
int __c_kernel_clock_gettime(clockid_t clock, struct old_timespec32 *ts,
^
arch/powerpc/include/asm/vdso/gettimeofday.h:183:5: note: previous declaration is here
int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
^
But this is inside an #ifdef __powerpc64__ block:
182 #ifdef __powerpc64__
183 int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
184 const struct vdso_data *vd);
So is clang defining __powerpc64__ even for 32-bit code?
And the answer appears to be yes:
$ clang --version
Ubuntu clang version 11.0.0-2
Target: powerpc64le-unknown-linux-gnu
$ clang -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc64__ 1
#define __powerpc__ 1
Compare to gcc:
$ gcc --version
gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
$ gcc -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc__ 1
#define powerpc 1
#define __powerpc 1
Which is fairly problematic, because we use the presence/absence of
__powerpc64__ to determine if we're building 64-bit/32-bit code in
several places.
Not sure what the best approach for fixing that is.
cheers
From: Nick Desaulniers <ndesaulniers@google.com> Date: 2020-12-07 17:59:12
On Mon, Dec 7, 2020 at 4:23 AM Michael Ellerman [off-list ref] wrote:
So is clang defining __powerpc64__ even for 32-bit code?
And the answer appears to be yes:
$ clang --version
Ubuntu clang version 11.0.0-2
Target: powerpc64le-unknown-linux-gnu
$ clang -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc64__ 1
#define __powerpc__ 1
Compare to gcc:
$ gcc --version
gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
$ gcc -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc__ 1
#define powerpc 1
#define __powerpc 1
Which is fairly problematic, because we use the presence/absence of
__powerpc64__ to determine if we're building 64-bit/32-bit code in
several places.
Not sure what the best approach for fixing that is.
On Mon, Dec 07, 2020 at 09:56:56AM -0800, Nick Desaulniers wrote:
On Mon, Dec 7, 2020 at 4:23 AM Michael Ellerman [off-list ref] wrote:
quoted
So is clang defining __powerpc64__ even for 32-bit code?
And the answer appears to be yes:
$ clang --version
Ubuntu clang version 11.0.0-2
Target: powerpc64le-unknown-linux-gnu
$ clang -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc64__ 1
#define __powerpc__ 1
Compare to gcc:
$ gcc --version
gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
$ gcc -m32 -dM -E - < /dev/null | grep powerpc
#define __powerpc__ 1
#define powerpc 1
#define __powerpc 1
Which is fairly problematic, because we use the presence/absence of
__powerpc64__ to determine if we're building 64-bit/32-bit code in
several places.
Not sure what the best approach for fixing that is.
Not only is that a compatibility problem (as the bug report says): it is
a straight up violation of the ABI! (For ELFv2, which you have here;
older ABIs did not mention the preprocessor predefines, but this was
exactly the same on all compilers afaik.)
Segher