From owner-freebsd-mips@freebsd.org Sat Aug 26 00:26:22 2017 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B72B0DE4D79 for ; Sat, 26 Aug 2017 00:26:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88366769EC for ; Sat, 26 Aug 2017 00:26:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id ED8F210AF07 for ; Fri, 25 Aug 2017 20:26:19 -0400 (EDT) From: John Baldwin To: freebsd-mips@freebsd.org Subject: Re: svn commit: r322915 - head/contrib/compiler-rt/lib/builtins Date: Fri, 25 Aug 2017 17:26:13 -0700 Message-ID: <22196862.mDqZGdaYp0@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201708260017.v7Q0Hv9f054007@repo.freebsd.org> References: <201708260017.v7Q0Hv9f054007@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 25 Aug 2017 20:26:20 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Aug 2017 00:26:22 -0000 On Saturday, August 26, 2017 12:17:57 AM John Baldwin wrote: > Author: jhb > Date: Sat Aug 26 00:17:57 2017 > New Revision: 322915 > URL: https://svnweb.freebsd.org/changeset/base/322915 > > Log: > Extend the workaround for LLVM bug 11663 to MIPS N32. > > This fixes infinite recursion in /sbin/init for MIPS N32. > > Submitted by: Robert M. Kovacsics > MFC after: 1 week > Sponsored by: DARPA / AFRL With this fix (and some minor changes in the kernel to fix int-to-pointer-cast warnings) I was able to boot a MALTAN32 kernel with an n32 world (built with GCC 4.2.1) under qemu-system-mips64. I'm going to test external GCC next before seeing what kind of carnage clang wreaks. FYI, I've run into a few issues getting o32 built with clang to boot. I first tried to use in-tree ld.bfd which while it linked a full world, the /bin/sh binary was corrupted (in some places it had 'jal 0' rather than than a jump to a real symbol, in particular in __start() in crt1.c where it tries to call 'atexit(cleanup)'). Using external ld.bfd fixed that, but the resulting /bin/sh binary uses additional relocations (that N64 curiously doesn't), including R_MIPS_COPY. The /bin/sh binary also has a .pltrel which rtld doesn't currently grok, but I'm working on. -- John Baldwin