Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jan 2015 12:47:26 -0800
From:      Sean Bruno <sbruno@ignoranthack.me>
To:        freebsd-mips@freebsd.org
Subject:   Migrating mips/mips64 to clang/llvm [update 3, with real bugs]
Message-ID:  <54CD3F5E.2020204@ignoranthack.me>

next in thread | raw e-mail | index | archive | help
-----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-----



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