From owner-freebsd-emulation@FreeBSD.ORG Wed Jun 13 00:15:29 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F631106564A for ; Wed, 13 Jun 2012 00:15:29 +0000 (UTC) (envelope-from bfalk_bsd@brandonfa.lk) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id BFF528FC08 for ; Wed, 13 Jun 2012 00:15:28 +0000 (UTC) Received: by yenl8 with SMTP id l8so107271yen.13 for ; Tue, 12 Jun 2012 17:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brandonfa.lk; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5pof2qASmMIkfZ9T4W/Mofz3UfHiyro6EJ+ugfkYkGI=; b=aNg50LhQkxh4Nc7bOTgFnY0FMYSXUt9VEXqGOh6u5492tDSUDpvd8DwWwKtQ0D+nU5 kvwi09O8ekC87FvDxSp3rBI3LLm87P8+uM7eUSbvA4L8ZOooP5F0O4/qVQE7DHll/AuV HQM1eQU+vAHOHpO/YoKsgzhD/+NtSfmgw6DAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=5pof2qASmMIkfZ9T4W/Mofz3UfHiyro6EJ+ugfkYkGI=; b=ZZESYzKE3f8HFfihr2HbjsdlUfHpWB5wNOI1H5DBW+zY8BYzmpoB4vdn6xreJSvIwG ZzEDgx2Khmk67ZgtE7RWpMfjrirjp3a3sG0n+oAaSCqP4wNuTuQhCjoWSRgs7CS5gVKg 7mWpSgaIbM9qjPSvpP0ki4uHk2/vDJfcdknOcpeZmLBGzSPC8RGMDti+JI3y1z+aEXI6 lRDLnkQ0mlp0xyiGlkYE9jsy5fbsiExU6En58lE8kGIS37NUoeCNEnwkBr9ZZZOuvQ6W +WwYszJfcod+VWVCAgDAxYNYlxRPWWL8J6TnKr3XpxKJL6X+9NMzfmgSodUr+TdGsA9+ Gwbg== MIME-Version: 1.0 Received: by 10.50.154.201 with SMTP id vq9mr9612418igb.2.1339546527624; Tue, 12 Jun 2012 17:15:27 -0700 (PDT) Received: by 10.231.49.7 with HTTP; Tue, 12 Jun 2012 17:15:27 -0700 (PDT) X-Originating-IP: [166.182.66.163] Received: by 10.231.49.7 with HTTP; Tue, 12 Jun 2012 17:15:27 -0700 (PDT) In-Reply-To: <201206121811.q5CIBugV088678@triton8.kn-bremen.de> References: <4FD67192.2010001@brandonfa.lk> <201206121811.q5CIBugV088678@triton8.kn-bremen.de> Date: Tue, 12 Jun 2012 20:15:27 -0400 Message-ID: From: Brandon Falk To: Juergen Lock X-Gm-Message-State: ALoCoQnGFEHPYTFWIdzo11tL6Mod3jqXhsvQbjhdWDC4xsabYtuBQ4kdd//wg8+UlLFVuuB1+QB1 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-emulation@freebsd.org Subject: Re: Building QEMU with clang X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 00:15:29 -0000 Worked great! Ill play with it when I get home. On Jun 12, 2012 2:13 PM, "Juergen Lock" wrote: > In article <4FD67192.2010001@brandonfa.lk> you write: > >Greetings, > Hi! > > > >I could go on a rant, but I'll keep it short and sweet. I'm wondering if > >there are any efforts to get QEMU building with clang. I know this > >should go on the QEMU mailing lists, but I wanted to post it here as > >well as I'd be using FreeBSD as the host. > > > >When working with qemu-devel (with --enable-tcg-interpreter), I get: > > > >multiboot.S:31:8: error: .code16 not supported yet > > > >multiboot.S:123:17: error: unexpected token in argument list > > data32 lgdt %gs:6 > > ^ > >multiboot.S:131:15: error: unknown token in expression > > data32 ljmp *%gs:0 > > > >Now, code16 is a pretty big deal, and that's obviously a feature that > >clang needs to add. However what is it with the complaints of the other > >two (I'm an Intel syntax guy, not AT&T :P)? > > > I don't know about those but I do know clang can be told to call (g)as > instead of using its internal assembler by passing -no-integrated-as. > > >Semi-sidenote: > >Since clang does not support global registers, --enable-tcg-interpreter > >has to be specified to ./configure. This should be added to the port as > >an option. > > Heh I didn't know about --enable-tcg-interpreter... The following > patch makes the port build, but the result is much slower than with > gcc. (and without --enable-tcg-interpreter.) And also halt -p in a > FreeBSD guest causes qemu-system-x86_64 to fail with a tcg error. > > I'm not sure it makes much sense to commit this nevertheless...? > > Index: Makefile > =================================================================== > RCS file: /home/pcvs/ports/emulators/qemu-devel/Makefile,v > retrieving revision 1.140 > diff -u -p -r1.140 Makefile > --- Makefile 9 Jun 2012 16:19:05 -0000 1.140 > +++ Makefile 12 Jun 2012 17:57:16 -0000 > @@ -48,11 +48,19 @@ ADD_AUDIO_DESC= "Emulate more audio har > ALL_TARGETS_DESC= "Also build bsd-user targets (for testing)" > OPTIONS_DEFAULT=SDL OPENGL GNUTLS SASL JPEG PNG CURL CDROM_DMA PCAP > > -.include > +.include > > CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib > PORTDOCS= docs qemu-doc.html qemu-tech.html > > +# XXX this fixes build with clang but --enable-tcg-interpreter that's > +# needed to avoid global register usage that clang doesn't support > +# causes the result to be slow. > +.if ${CC:T:Mclang} == "clang" > +CONFIGURE_ARGS+= --enable-tcg-interpreter > +CLANG_CFLAGS_AS+= -no-integrated-as > +.endif > + > .if empty(PORT_OPTIONS:MALL_TARGETS) > CONFIGURE_ARGS+= --disable-bsd-user > PLIST_SUB+= ALLTARGETS="@comment " > @@ -191,6 +199,9 @@ post-patch: > -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ > ${WRKSRC}/Makefile > @${REINPLACE_CMD} -E \ > + -e "s|^(CFLAGS[ ]*:=.*)|\1 ${CLANG_CFLAGS_AS}|" \ > + ${WRKSRC}/pc-bios/optionrom/Makefile > + @${REINPLACE_CMD} -E \ > -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \ > ${WRKSRC}/scripts/texi2pod.pl > > @@ -217,4 +228,4 @@ post-install: > fi > @${CAT} ${PKGMESSAGE} > > -.include > +.include >