From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 12:46:46 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7914C16A4CE for ; Wed, 10 Dec 2003 12:46:46 -0800 (PST) Received: from paladin.fortunaty.net (fortunaty.net [217.160.129.175]) by mx1.FreeBSD.org (Postfix) with SMTP id A06DB43D13 for ; Wed, 10 Dec 2003 12:46:44 -0800 (PST) (envelope-from ah@paladin.fortunaty.net) Received: (qmail 27990 invoked by uid 501); 10 Dec 2003 20:46:42 -0000 Date: 10 Dec 2003 20:46:42 -0000 Message-ID: <20031210204642.27989.qmail@paladin.fortunaty.net> User-Agent: Emai/0.0.2p1 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline References: ,<20031210061329.GD13539@afflictions.org> In-Reply-To: <20031210061329.GD13539@afflictions.org> From: Andreas Hauser To: Damian Gerow cc: current@freebsd.org Subject: Re: buildworld doesn't like -O2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2003 20:46:46 -0000 dgerow wrote @ Wed, 10 Dec 2003 01:13:29 -0500: > Thus spake Steve Kargl (sgk@troutmask.apl.washington.edu) [09/12/03 22:59]: > : -j# obfuscates where the actual error occurs unless you have > : enough make-fu to read the log. The first step one should > : take when this type of error happens is a plain "make buildworld". > : The next step is run cvsup again to see if the problem has > : been fixed. Then, report the error to freebsd-current. > > Okay, after some playing around, it turns out that something in the PAM code > really doesn't like -O2 optimization -- I have CFLAGS=-O2 -pipe, and this is > what I see: > > ===> lib/libpam/modules/pam_echo > cc -O2 -pipe -march=pentiumpro \ > -I/usr/src/lib/libpam/modules/pam_echo/../../../../contrib/openpam/include \ > -I/usr/src/lib/libpam/modules/pam_echo/../../libpam -Wsystem-headers \ > -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes \ > -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual \ > -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wno-uninitialized -c \ > /usr/src/lib/libpam/modules/pam_echo/pam_echo.c \ > /usr/src/lib/libpam/modules/pam_echo/pam_echo.c: In function `_pam_echo': > /usr/src/lib/libpam/modules/pam_echo/pam_echo.c:92: warning: > dereferencing type-punned pointer will break strict-aliasing rules > *** Error code 1 The code seems to violate strict aliasing rules. Somehow gcc only warns when optimizing. There is a qr about it http://www.freebsd.org/cgi/query-pr.cgi?pr=55774 but it was closed by DES saying "Not a problem report". I don't understand why, but i want my system compiled -Os, so I have a local patch that uses some more variables and casts. Andreas Jäger also produced a patch for GNU libc using unions: http://sources.redhat.com/ml/libc-hacker/2002-12/msg00071.html Andy