Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2017 17:26:13 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-mips@freebsd.org
Subject:   Re: svn commit: r322915 - head/contrib/compiler-rt/lib/builtins
Message-ID:  <22196862.mDqZGdaYp0@ralph.baldwin.cx>
In-Reply-To: <201708260017.v7Q0Hv9f054007@repo.freebsd.org>
References:  <201708260017.v7Q0Hv9f054007@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <rmk35@cam.ac.uk>
>   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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22196862.mDqZGdaYp0>