From owner-freebsd-mips@FreeBSD.ORG Sat Jan 31 20:47:38 2015 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15F6F72D for ; Sat, 31 Jan 2015 20:47:38 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBD0699C for ; Sat, 31 Jan 2015 20:47:37 +0000 (UTC) Received: from [192.168.200.211] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 6629E1941DD for ; Sat, 31 Jan 2015 20:47:31 +0000 (UTC) Message-ID: <54CD3F5E.2020204@ignoranthack.me> Date: Sat, 31 Jan 2015 12:47:26 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-mips@freebsd.org Subject: Migrating mips/mips64 to clang/llvm [update 3, with real bugs] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 20:47:38 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 tl;dr: linking libc fails at the moment if I wave my hands a lot and patch out of dim's clang36 branch Quite a bit of progress today (mainly thanks to Ed mentoring and letting me cut-n-paste some ASM code). We're not linking together libc correctly. So we've got a few things going on: .cprestore unsupported http://llvm.org/bugs/show_bug.cgi?id=20967 -- even with this patch, I need to comment out the warning about PIC. -- Ed confirms that .cprestore is a no-op on mips if PIC isn't enabled. -- This leads us to the following 4 patches that are under review. - http://reviews.llvm.org/D6267 - http://reviews.llvm.org/D5626 - http://reviews.llvm.org/D5601 - http://reviews.llvm.org/D6231 With those in place, and the support for our target triple in clang, I can progress further. We then run into unsupported GAS macros, which are the subject of http://llvm.org/bugs/show_bug.cgi?id=21474 Currently, libc moves to the linking stage and fails: building shared library libc.so.7 /var/tmp/mips.mips/home/sbruno/bsd/clang360-import/tmp/usr/bin/ld: /var/tmp/mips.mips/home/sbruno/bsd/clang360-import/tmp/usr/lib/crtbeginS.o: CALL16 reloc at 0x8 not against global symbol /var/tmp/mips.mips/home/sbruno/bsd/clang360-import/tmp/usr/lib/crtbeginS.o: could not read symbols: Bad value cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1 sean Unified diff of my current tree based on the projects/clang360 import branch. https://people.freebsd.org/~sbruno/clang_mips.diff -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUzT9cXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kFpIH/jqbLuEOV3zmeVC2sUXnBVTD i5Xv/v579EkLvz9KAhPWvbTsQlX9cNYL8sB7gioXkUTrmKYS7Fue3O7KAEe6WpbE B5RLQ+q5GtiM6OS3286zD/ErlZfaSRZtIE5MD8uy0AN1HqpregJhSRXFuc58f4qd 4pk282j33+pjd+r+DrwXBZqiDc5oLlEz5NGm47WUevXMjHEO3S7PYQ52YJmYZYj2 2+phO1NfwJG3PcXCuVdNIOk1pg1QbyW78JVDDjEQomRdvZzTCoCTNPAO7kQss3gB l0Iklu8DDj6KPPDdpW4DaxC9AWJAi1Jl/+3AvTHoM99r8lrP/jKO+lVk09Ukuus= =auQq -----END PGP SIGNATURE-----