[M3devel] LLVM builder modes Int/Ext/StAlone

Rodney M. Bates rodney_bates at lcwb.coop
Fri Sep 11 22:13:43 CEST 2015


Yes, I put in all the modes I thought of while working in there, as it's a lot easier
to do it when you are familiar with the code than refamiliarize later.  There were
already some with comments like "No such back end".  Only the StAloneLlvm ones
have an actual back end.  The others are intended for modes that link in at least
some of llvm into cm3.  As discussed, we may not want to do this.

The only mode I have tried is StAloneLlvmAsm.  This is running to compile completion
on small examples and passing a good few of the compiler tests.  Right now, I am working
on the ones that pass using m3cc and fail using m3llvm, before trying to build the real code.

On 09/10/2015 08:53 PM, Jay K wrote:
> Here is what I get: some "crash", some "fail", some get the file format mixed up, some work!
> 6 modes. 4 crash, 1 appears to work, 1 appears close
>
>
> jair:m3core jay$ for a in \
> IntLlvmObj \
> IntLlvmAsm \
> ExtLlvmObj \
> ExtLlvmAsm \
> StAloneLlvmObj \
> StAloneLlvmAsm; \
>
> do rm AMD64_DARWIN/RT0.io ; echo $a;cm3 -DM3_BACKEND_MODE=$a -keep -commands; done
>
> IntLlvmObj
> *** runtime error:
> ***    Segmentation violation - possible attempt to dereference NIL
> ***    pc = 0x1030edca3 = set_error_handler + 0x5b in ../src/M3CG.m3
> ***
>
> IntLlvmAsm
> *** runtime error:
> ***    Segmentation violation - possible attempt to dereference NIL
> ***
>
> ExtLlvmObj
> *** runtime error:
> ***    Segmentation violation - possible attempt to dereference NIL
> ***    pc = 0x10e8b0ca3 = set_error_handler + 0x5b in ../src/M3CG.m3
>
> ExtLlvmAsm
> *** runtime error:
> ***    Segmentation violation - possible attempt to dereference NIL
>
> StAloneLlvmObj
> m3llvm -b -d -o RT0.ib RT0.ic
> llc -disable-fp-elim -filetype=obj  -relocation-model=pic RT0.ib -o RT0.io
>
> => success?
>
> except for:
> error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: RT0.io is not an object file (not allowed in a library)
>
>
> StAloneLlvmAsm
> close, maybe just a config problem
> m3llvm -b -d -o RT0.ib RT0.ic
> llc -disable-fp-elim -filetype=asm  -relocation-model=pic RT0.ib -o RT0.is
> fg++ -m64 -arch x86_64 -c -x assembler RT0.is -o RT0.io
> RT0.is:5:2: error: unknown directive
>
>
> I assume we should ignore Int and Ext and focus on StAlone for now.
>
>
>   - Jay
>
>
> _______________________________________________
> M3devel mailing list
> M3devel at elegosoft.com
> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list