On Tue, Aug 21, 2012 at 02:48:59PM -0400, Brian Callahan wrote: > I noticed that devel/llvm now has target support for mips64 and > mips64el. The following patch is needed for those two archs. LLVM > builds and seems to work OK from my admittedly basic testing on > mips64el. > > Clang builds only with a newer version of gas (I used 2.22) but it > does not compile anything; it crashes when you try to compile even a > simple Hello World. I've reported it upstream but I'm unable to > follow any of their suggestions - my yeeloong cannot compile clang > with -O0 or a debug build because it runs out of memory (ulimit -d > is maxed at 1G in the kernel). > > Thanks. > > ~Brian
You'll likely want the following as well. mips binutils is very fragile, I doubt you want 2.22 and 2.17 in the tree needs more work for mips64. Index: Targets.cpp =================================================================== --- Targets.cpp (revision 162185) +++ Targets.cpp (working copy) @@ -3923,8 +3923,10 @@ MacroBuilder &Builder) const { DefineStd(Builder, "mips", Opts); Builder.defineMacro("_mips"); + Builder.defineMacro("__mips__"); DefineStd(Builder, "MIPSEB", Opts); Builder.defineMacro("_MIPSEB"); + Builder.defineMacro("__MIPSEB__"); Builder.defineMacro("__REGISTER_PREFIX__", ""); getArchDefines(Opts, Builder); } @@ -3941,8 +3943,10 @@ MacroBuilder &Builder) const { DefineStd(Builder, "mips", Opts); Builder.defineMacro("_mips"); + Builder.defineMacro("__mips__"); DefineStd(Builder, "MIPSEL", Opts); Builder.defineMacro("_MIPSEL"); + Builder.defineMacro("__MIPSEL__"); Builder.defineMacro("__REGISTER_PREFIX__", ""); getArchDefines(Opts, Builder); } @@ -4050,8 +4054,11 @@ MacroBuilder &Builder) const { DefineStd(Builder, "mips", Opts); Builder.defineMacro("_mips"); + Builder.defineMacro("__mips__"); DefineStd(Builder, "MIPSEB", Opts); Builder.defineMacro("_MIPSEB"); + Builder.defineMacro("__MIPSEB__"); + Builder.defineMacro("__mips64__"); Builder.defineMacro("__REGISTER_PREFIX__", ""); getArchDefines(Opts, Builder); } @@ -4077,8 +4084,11 @@ MacroBuilder &Builder) const { DefineStd(Builder, "mips", Opts); Builder.defineMacro("_mips"); + Builder.defineMacro("__mips__"); DefineStd(Builder, "MIPSEL", Opts); Builder.defineMacro("_MIPSEL"); + Builder.defineMacro("__MIPSEL__"); + Builder.defineMacro("__mips64__"); Builder.defineMacro("__REGISTER_PREFIX__", ""); getArchDefines(Opts, Builder); }