Re: [HEADS-UP] Problem with clang in 9-stable [was: r268244 (stable/9) seems to break "sysctl hw.ncpu"]

From: David Wolfskill <david_at_catwhisker.org>
Date: Fri, 4 Jul 2014 11:18:31 -0700
On Fri, Jul 04, 2014 at 08:09:21PM +0200, Hans Petter Selasky wrote:
> Hi,
> 
> Can you try to reproduce this:
> 
> Checkout 9-stable's src/sbin/sysctl only.
> 
> cd /usr/9-stable/src/sbin/sysctl
> 
> env CC=clang make clean all
> ./sysctl -n hw.ncpu
> 
> Then:
> 
> env CC=gcc make clean all
> ./sysctl -n hw.ncpu
> 
> 
> clang --version
> FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221
> Target: x86_64-unknown-freebsd9.1
> Thread model: posix
> 
> gcc --version
> gcc (GCC) 4.2.1 20070831 patched [FreeBSD]
> Copyright (C) 2007 Free Software Foundation, Inc.
> ....

Hmm... I should have mentioned this part earlier (sorry!): I've been
using clang as the system compiler since about ... autumn 2012 (long ago
enough that I forgot that it might be "odd" for stable/9).

> When compiling the code with clang, no output is happening. When 
> compiling with gcc, the FreeBSD 9-stable sysctl operates correctly. How 
> do we proceed?
> 
> Can more people check this and reproduce?

Well, here's what I see:

g1-252(9.3-P)[22] svn co file:///svn/freebsd/src/base/stable/9/sbin/sysctl
A    sysctl/sysctl.c
A    sysctl/sysctl.8
A    sysctl/Makefile
 U   sysctl
Checked out revision 268249.
g1-252(9.3-P)[23] cd sysctl/
g1-252(9.3-P)[24] env CC=clang make clean all
rm -f sysctl sysctl.o sysctl.8.gz sysctl.8.cat.gz
Warning: Object directory not changed from original /tmp/hps/sysctl
clang -O2 -pipe  -std=gnu99 -Qunused-arguments  -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -c sysctl.c
clang -O2 -pipe  -std=gnu99 -Qunused-arguments  -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion  -o sysctl sysctl.o 
gzip -cn sysctl.8 > sysctl.8.gz
g1-252(9.3-P)[25] ./sysctl -n hw.ncpu

g1-252(9.3-P)[26] env CC=gcc make clean all
rm -f sysctl sysctl.o sysctl.8.gz sysctl.8.cat.gz
Warning: Object directory not changed from original /tmp/hps/sysctl
clang -O2 -pipe  -std=gnu99 -Qunused-arguments  -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -c sysctl.c
clang -O2 -pipe  -std=gnu99 -Qunused-arguments  -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion  -o sysctl sysctl.o 
gzip -cn sysctl.8 > sysctl.8.gz
g1-252(9.3-P)[27] ./sysctl -n hw.ncpu

g1-252(9.3-P)[28] 

> When compiling the -10 and -11 version of sysctl with clang and gcc, 
> everything is fine!

That's moderately seriously kinky....  And not in a Good Way. :-/

> Thank you!

At least I have some evidence that I might not be merely hallucinating....

Peace,
david
-- 
David H. Wolfskill				david_at_catwhisker.org
Taliban: Evil cowards with guns afraid of truth from a 14-year old girl.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

Received on Fri Jul 04 2014 - 16:18:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:50 UTC