From owner-freebsd-current@FreeBSD.ORG Sun Oct 19 20:03:30 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D1A46AB for ; Sun, 19 Oct 2014 20:03:30 +0000 (UTC) Received: from m.saper.info (m.saper.info [IPv6:2a01:4f8:a0:7383::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "m.saper.info", Issuer "Marcin Cieslak 2011" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2513AF97 for ; Sun, 19 Oct 2014 20:03:29 +0000 (UTC) Received: from localhost (saper@localhost [127.0.0.1]) by m.saper.info (8.14.9/8.14.9) with ESMTP id s9JK3ODn065686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Oct 2014 20:03:25 GMT (envelope-from saper@saper.info) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=saper.info; s=Sep2014; t=1413749006; bh=KSX05E/0e0IWF5NyVBIY9DJPmsHMm1bc5AFdBO92iwo=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=OORgu6hqo9HOQvbeaAN7cMqwOvIIOQ8fKpYXLWYqnAxVwlum24qJHa8Ss/b3Y6I1U GPnl9UrwwGavxCAYXaU5ugz9K8yNVQx8F8IHc/KeXO/sG8ssdAjpViP6NhVwUIFX9d ovWfTyj+6AljsHYQU8aLxwPPqljL2ZaBvVn6pgSw= Date: Sun, 19 Oct 2014 20:03:24 +0000 (UTC) From: Marcin Cieslak To: Matthew Grooms Subject: Re: Compiling Xen on FreeBSD using clang ... In-Reply-To: <5443E7FC.8020605@shrew.net> Message-ID: References: <5443E7FC.8020605@shrew.net> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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: Sun, 19 Oct 2014 20:03:30 -0000 On Sun, 19 Oct 2014, Matthew Grooms wrote: > All, > > As most of you are probably aware, Roger at Citrix R&D has been doing some > incredible work to bring PVH domU/dom0 support to FreeBSD. There has also > been an effort by other Xen developers to get the software to compile using > clang. While most of these attempts appear to be on Linux platforms targeting > arm processors, the FreeBSD version of binutils is quite a bit older. Clang > still can't parse all of the assembly that Xen requires, so unfortunately the > -no-integrated-as option has to be used in several cases. > > Which brings me to my question, is there a way to ask clang to use the ports > version of binutils when -no-integrated-as is passed to clang? The version of > 'as' in base fails to compile such as ... > > /tmp/misc-bf1339.s: Assembler messages: > /tmp/misc-bf1339.s:375: Error: unknown pseudo-op: `.cfi_sections' I have recently managed to compile Xen (4.5 unstable from git master) using few patches in the source code (I posted them to xen-devel@, most of them are almost the same as some earlier work by Julien Grall). I have used clang version 3.5.0 (trunk) from ports just for the .code16 support, other than that clang 3.4.1 was fine. Xen kernel compiled this way even boots successfully and starts Debian dom0. This command was used to compile with 3.4.1 (without hvmloader): env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib gmake clang=y CC=clang-devel HOSTCC=clang-devel CONFIG_SEABIOS=y CONFIG_HVMLOADER=n SEABIOS_PATH=$HOME/qemu/bios.bin-1.7.5 CONFIG_QEMU=n "$@" //Marcin