From owner-freebsd-current@FreeBSD.ORG Mon Sep 5 22:28:20 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1FCE106564A; Mon, 5 Sep 2011 22:28:19 +0000 (UTC) (envelope-from c.kworr@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 46F538FC0A; Mon, 5 Sep 2011 22:28:18 +0000 (UTC) Received: by fxe4 with SMTP id 4so5019844fxe.13 for ; Mon, 05 Sep 2011 15:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=yIw7CS9H8ENlIpSMaaxURNwbqTbMKAmUvz8QzxGuVEA=; b=Hq8bC0GnSlz8rKExCt5SxCmfRWR2KYMYWmqTSTLEzcB99QY++zqNIJujQQ34Jiz3Yf cJBLir9iPgLjGr9O7q+D3SX5L0vxfsKkb7PE8BZNg+cKzSXd3YdvR7UhGPMf7Yxj/wOo xVWNVvvAyMlFgHJJMik4Uakr/HkqEmZ/FCESU= Received: by 10.223.50.150 with SMTP id z22mr1690357faf.30.1315261698080; Mon, 05 Sep 2011 15:28:18 -0700 (PDT) Received: from limbo.lan ([195.225.157.86]) by mx.google.com with ESMTPS id c12sm4433812fad.14.2011.09.05.15.28.16 (version=SSLv3 cipher=OTHER); Mon, 05 Sep 2011 15:28:17 -0700 (PDT) Message-ID: <4E654CFF.6000307@gmail.com> Date: Tue, 06 Sep 2011 01:28:15 +0300 From: Volodymyr Kostyrko User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:6.0.1) Gecko/20110902 Thunderbird/6.0.1 MIME-Version: 1.0 To: Olivier Smedts References: <4E62915E.1010405@FreeBSD.org> <4E6294E0.5010104@gmail.com> <4E6298DE.5090007@FreeBSD.org> <4E644993.4090703@gmail.com> <4E654664.1010504@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Dimitry Andric Subject: Re: Compiling BETA2 with clang fails X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 05 Sep 2011 22:28:20 -0000 06.09.2011 01:11, Olivier Smedts wrote: >>>> ===> libexec/atrun (all) >>>> clang -O2 -pipe -march=native -DATJOB_DIR=\"/var/at/jobs/\" >>>> -DLFILE=\"/var/at/jobs/.lockfile\" -DLOADAVG_MX=1.5 >>>> -DATSPOOL_DIR=\"/var/at/spool\" -DVERSION=\"2.9\" -DDAEMON_UID=1 >>>> -DDAEMON_GID=1 -DDEFAULT_BATCH_QUEUE=\'E\' -DDEFAULT_AT_QUEUE=\'c\' >>>> -DPERM_PATH=\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at >>>> -I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -std=gnu99 -fstack-protector >>>> -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized >>>> -Wno-pointer-sign >>>> -c /usr/src/libexec/atrun/atrun.c >>> >>> Try removing "-march=native" from your CFLAGS. >>> >>> I have the exact same problem since months on my Core i7 CPU when >>> using "-march=native" or "-march=corei7". No problems for me with >>> "-march=core2" though. >> >> It so nice you have noted that. I'll be much happier if you also spare some >> time reading my previous emails. > > Or you could search this mailing list for the exact same problem > reported some time ago. Well... I know that clang with -march=native can produce flawed binaries but it's quite common for them to SEGFAULT and SIGILL so I made at least a clean build to check that this is not the problem. >> As I noted before this command fails only if run as a part of 'make >> buildworld'. If I cd to that directory and run the same command from there >> it completes successfully yielding working binary. If the error would be >> related to -fPIC, ccache or -march it'll end up with other bunch of error >> messages and result would be irrelevant of invocation and environment. > > If you cd to that directory, you'll use the system clang, let's call > it the "good" clang. > > If you buildworld with -march=native or -march=corei7, you'll first > compile a bootstrap clang with -march=native or -march=corei7 (the > "bad" one) and that one will fail building libexec/atrun. Chicken and > egg problem. > > If you try building and installing clang with -march=native or > -march=corei7, you'll have the same error if you then cd to that > directory and make. > >> As I suspect some incorrect buildworld behavior I have no other choice as >> running another clean build and presenting new logs. Here you go: I really mean a clean build here. /usr/obj was wiped and I started from scratch. And it gives me the same error. This is not the problem with -march. >> clang -O2 -pipe -DATJOB_DIR=\"/var/at/jobs/\" >> -DLFILE=\"/var/at/jobs/.lockfile\" -DLOADAVG_MX=1.5 >> -DATSPOOL_DIR=\"/var/at/spool\" -DVERSION=\"2.9\" -DDAEMON_UID=1 >> -DDAEMON_GID=1 -DDEFAULT_BATCH_QUEUE=\'E\' -DDEFAULT_AT_QUEUE=\'c\' >> -DPERM_PATH=\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at >> -I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -std=gnu99 -fstack-protector >> -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialize >> d -Wno-pointer-sign -o atrun atrun.o gloadavg.o -lpam -lutil >> clang: warning: argument unused during compilation: '-std=gnu99' Anyway you are right. Using /usr/obj/usr/src/tmp/usr/bin/clang gives me the same error while installed clang works. So this is really problem with clang. -- Sphinx of black quartz judge my vow.