From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 1 13:30:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1178CDD for ; Thu, 1 Aug 2013 13:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9133A2300 for ; Thu, 1 Aug 2013 13:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r71DU0Qe090039 for ; Thu, 1 Aug 2013 13:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r71DU0tl090038; Thu, 1 Aug 2013 13:30:00 GMT (envelope-from gnats) Resent-Date: Thu, 1 Aug 2013 13:30:00 GMT Resent-Message-Id: <201308011330.r71DU0tl090038@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Shikov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AFB8F85C for ; Thu, 1 Aug 2013 13:23:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8539B2283 for ; Thu, 1 Aug 2013 13:23:04 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r71DN3pG006899 for ; Thu, 1 Aug 2013 13:23:03 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r71DN3Kx006896; Thu, 1 Aug 2013 13:23:03 GMT (envelope-from nobody) Message-Id: <201308011323.r71DN3Kx006896@oldred.freebsd.org> Date: Thu, 1 Aug 2013 13:23:03 GMT From: Alexander Shikov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/180985: clang 3.3 does not handle correctly -O option X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 13:30:00 -0000 >Number: 180985 >Category: bin >Synopsis: clang 3.3 does not handle correctly -O option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 01 13:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Alexander Shikov >Release: FreeBSD 10.0-CURRENT i386 >Organization: >Environment: FreeBSD crete.itcons.net.ua 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r253613: Wed Jul 24 19:17:04 EEST 2013 root@crete.itcons.net.ua:/usr/obj/usr/src/sys/CRETE i386 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: i386-unknown-freebsd10.0 Thread model: posix >Description: clang 3.3 has a problem with handling -O option. This may lead to errors when compiling certain software from ports tree. For example, because of these problem configure script of lang/python27 port incorrectly checks support of -OPT:Olevel compiler option: # less www.freebsd.org/cgi/query-pr.cgi?pr=ports/174525 [...] configure:6161: checking whether cc accepts -OPT:Olimit=0 configure:6179: cc -OPT:Olimit=0 -c -O2 -pipe -march=pentium4 -fno-strict-aliasing -I/usr/local/include/pth conftest.c >&5 configure:6179: $? = 0 configure:6189: result: yes Thus, check succeeds, and after python27 installation, 'python2.7-config --cflags' command output includes -OPT:Olimit=0. But actually neither gcc, nor clang do not support this option. Among consequences of this issue there are problem with building some ports which depend on python with GCC compiler, for example configure script of editors/libreoffice with WITH_GCC=yes knob set fails with error: configure:21136: checking Python.h usability configure:21136: gcc46 -c -O2 -pipe -march=pentium4 -Wl,-rpath=/usr/local/lib/gcc46 -DLDAP_DEPRECATED -fno-strict-aliasing -I/usr/local/include -I/usr/local/include/python2.7 -I/usr/local/include/python2.7 -fno-strict-aliasing -OPT:Olimit=0 -O2 -pipe -march=pentium4 -fno-strict-aliasing -DNDEBUG -O2 -pipe -march=pentium4 -fno-strict-aliasing -I/usr/local/include/pth conftest.c >&5 cc1: error: argument to '-O' should be a non-negative integer >How-To-Repeat: # clang -OPT:Olevel=0 -c conftest.c || echo $? error: invalid integral value 'PT:Olevel=0' in '-OPT:Olevel=0' error: invalid integral value 'PT:Olevel=0' in '-OPT:Olevel=0' 1 - fails # clang -O2 -OPT:Olevel=0 -c conftest.c || echo $? error: invalid integral value 'PT:Olevel=0' in '-OPT:Olevel=0' error: invalid integral value 'PT:Olevel=0' in '-OPT:Olevel=0' 1 - fails # clang -OPT:Olevel=0 -O2 -c conftest.c && echo $? 0 - works, but should not. >Fix: >Release-Note: >Audit-Trail: >Unformatted: