From owner-freebsd-current@FreeBSD.ORG Sun Jul 17 14:03:44 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 A6E80106566C for ; Sun, 17 Jul 2011 14:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5B47F8FC0A for ; Sun, 17 Jul 2011 14:03:44 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a425:41bf:691:801a] (unknown [IPv6:2001:7b8:3a7:0:a425:41bf:691:801a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C69CC5C37; Sun, 17 Jul 2011 16:03:40 +0200 (CEST) Message-ID: <4E22EBC2.4070802@FreeBSD.org> Date: Sun, 17 Jul 2011 16:03:46 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110716 Thunderbird/8.0a1 MIME-Version: 1.0 To: Doug Barton References: <4E22B560.4040401@FreeBSD.org> In-Reply-To: <4E22B560.4040401@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Current Subject: Re: sys/boot/i386/boot2 build failure with clang 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: Sun, 17 Jul 2011 14:03:44 -0000 On 2011-07-17 12:11, Doug Barton wrote: > Trying to build r224125 with clang, and got this (using no -j): ... > as --32 -o boot2.o boot2.s > boot2.s: Assembler messages: > boot2.s:4073: Error: unknown pseudo-op: `.cfi_sections' When using -g, clang outputs directives that are simply too new for our binutils. The way that sys/boot/i386/boot2 and zfsboot are processed is special: 1) The boot2.c code is compiled with -S, to boot2.s.tmp 2) boot2.s.tmp is processed using sed, to remove any alignment directives and filler nops, to reduce the code size 3) The resulting boot2.s is assembled, using plain 'as' In step 3, GNU as chokes on the assembly produced by clang, when you use certain CFLAGS or DEBUG_FLAGS (-g being one of them). When compiling .c to .o files normally, this is never a problem, since clang uses its integrated assembler to output an object file. In any case, I have committed a fix in r224131, let me know how that works out for you.