From: Michael Ellerman <mpe@ellerman.id.au>
To: kernel test robot <lkp@intel.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [powerpc:next-test 54/220] arch/powerpc/kernel/vdso32/vgettimeofday.c:13:5: warning: no previous prototype for function '__c_kernel_clock_gettime64'
Date: Mon, 07 Dec 2020 23:23:43 +1100 [thread overview]
Message-ID: <87czzlu7n4.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <202012042220.zO7hSFT2-lkp@intel.com>
kernel test robot <lkp@intel.com> 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 <lkp@intel.com>
>
> 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,
> ^
We're building vdso32, which is 32-bit code, we pass -m32:
clang -Wp,-MMD,arch/powerpc/kernel/vdso32/.vgettimeofday.o.d -nostdinc -isystem /usr/lib/llvm-11/lib/clang/11.0.0/include -I/linux/arch/powerpc/include -I./arch/powerpc/include/generated -I/linux/include -I./include -I/linux/arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I/linux/include/uapi -I./include/generated/uapi -include /linux/include/linux/kconfig.h -include /linux/include/linux/compiler_types.h -D__KERNEL__ -I /linux/arch/powerpc -DHAVE_AS_ATHIGH=1 -Qunused-arguments -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=powerpc64le-linux-gnu --prefix=/usr/bin/powerpc64le-linux-gnu- --gcc-toolchain=/usr -no-integrated-as -Werror=unknown-warning-option -mlittle-endian -m64 -msoft-float -pipe -mcpu=power8 -mtune=power9 -mno-altivec -mno-vsx -mno-spe -fno-asynchronous-unwind-tables -Wa,-mpower4 -Wa,-many -mlittle-endian -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -Os -Wframe-larger-than=2048 -fno-stack-protector -Wno-format-invalid-specifier -Wno-gnu -mno-global-merge -Wno-unused-const-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -fmacro-prefix-map=/linux/= -Wno-initializer-overrides -Wno-format -Wno-sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -D_TASK_CPU=304 -shared -fno-common -fno-builtin -nostdlib -Wl,-soname=linux-vdso32.so.1 -Wl,--hash-style=both -include /linux/lib/vdso/gettimeofday.c -fno-stack-protector -DDISABLE_BRANCH_PROFILING -ffreestanding -fasynchronous-unwind-tables -I /linux/arch/powerpc/kernel/vdso32 -I ./arch/powerpc/kernel/vdso32 -DKBUILD_MODFILE='"arch/powerpc/kernel/vdso32/vgettimeofday"' -DKBUILD_BASENAME='"vgettimeofday"' -DKBUILD_MODNAME='"vgettimeofday"' -m32 -c -o arch/powerpc/kernel/vdso32/vgettimeofday.o /linux/arch/powerpc/kernel/vdso32/vgettimeofday.c
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: kbuild-all@lists.01.org
Subject: Re: [powerpc:next-test 54/220] arch/powerpc/kernel/vdso32/vgettimeofday.c:13:5: warning: no previous prototype for function '__c_kernel_clock_gettime64'
Date: Mon, 07 Dec 2020 23:23:43 +1100 [thread overview]
Message-ID: <87czzlu7n4.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <202012042220.zO7hSFT2-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 5029 bytes --]
kernel test robot <lkp@intel.com> 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 <lkp@intel.com>
>
> 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,
> ^
We're building vdso32, which is 32-bit code, we pass -m32:
clang -Wp,-MMD,arch/powerpc/kernel/vdso32/.vgettimeofday.o.d -nostdinc -isystem /usr/lib/llvm-11/lib/clang/11.0.0/include -I/linux/arch/powerpc/include -I./arch/powerpc/include/generated -I/linux/include -I./include -I/linux/arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I/linux/include/uapi -I./include/generated/uapi -include /linux/include/linux/kconfig.h -include /linux/include/linux/compiler_types.h -D__KERNEL__ -I /linux/arch/powerpc -DHAVE_AS_ATHIGH=1 -Qunused-arguments -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=powerpc64le-linux-gnu --prefix=/usr/bin/powerpc64le-linux-gnu- --gcc-toolchain=/usr -no-integrated-as -Werror=unknown-warning-option -mlittle-endian -m64 -msoft-float -pipe -mcpu=power8 -mtune=power9 -mno-altivec -mno-vsx -mno-spe -fno-asynchronous-unwind-tables -Wa,-mpower4 -Wa,-many -mlittle-endian -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -Os -Wframe-larger-than=2048 -fno-stack-protector -Wno-format-invalid-specifier -Wno-gnu -mno-global-merge -Wno-unused-const-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -fmacro-prefix-map=/linux/= -Wno-initializer-overrides -Wno-format -Wno-sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -D_TASK_CPU=304 -shared -fno-common -fno-builtin -nostdlib -Wl,-soname=linux-vdso32.so.1 -Wl,--hash-style=both -include /linux/lib/vdso/gettimeofday.c -fno-stack-protector -DDISABLE_BRANCH_PROFILING -ffreestanding -fasynchronous-unwind-tables -I /linux/arch/powerpc/kernel/vdso32 -I ./arch/powerpc/kernel/vdso32 -DKBUILD_MODFILE='"arch/powerpc/kernel/vdso32/vgettimeofday"' -DKBUILD_BASENAME='"vgettimeofday"' -DKBUILD_MODNAME='"vgettimeofday"' -m32 -c -o arch/powerpc/kernel/vdso32/vgettimeofday.o /linux/arch/powerpc/kernel/vdso32/vgettimeofday.c
> 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
next prev parent reply other threads:[~2020-12-07 12:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 14:23 [powerpc:next-test 54/220] arch/powerpc/kernel/vdso32/vgettimeofday.c:13:5: warning: no previous prototype for function '__c_kernel_clock_gettime64' kernel test robot
2020-12-04 14:23 ` kernel test robot
2020-12-07 12:23 ` Michael Ellerman [this message]
2020-12-07 12:23 ` Michael Ellerman
2020-12-07 17:56 ` Nick Desaulniers
2020-12-07 17:56 ` Nick Desaulniers
2020-12-07 18:20 ` Segher Boessenkool
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czzlu7n4.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=christophe.leroy@csgroup.eu \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.