Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Lachlan Sneff
    @lachlansneff
    Nah, I say "down there" for literally any location other than where I currently am
    I'm way over on the other side of the country
    Do you think the scholarships would cover airtravel?
    Pat Hickey
    @pchickey
    oh ok :) they may. I can't look right now at whats available but lets assume that we can find a way to get your plane ticket and hotel paid for, if you'd like to go.
    Lachlan Sneff
    @lachlansneff
    Yeah, I totally would!
    Dan Gohman
    @sunfishcode
    I've now created https://gitlab.com/cretonne . I haven't migrated anything yet, but I may migrate something small like filecheck or target-lexicon to try it out.
    Lachlan Sneff
    @lachlansneff
    Is Microsoft buying github that bad?
    Dan Gohman
    @sunfishcode
    I don't expect there's an immediate problem. However, I had already been considering migrating, and this may be what prompts me to try it out.
    Lachlan Sneff
    @lachlansneff
    Oh, by the way, what's the meaning of cretonne's logo?
    Dan Gohman
    @sunfishcode
    It's a high voltage power line.
    Which makes more sense than cotton
    Dan Gohman
    @sunfishcode
    😏
    Kevin Watters
    @kevinw
    hey! thanks so much for cretonne. I'm enjoying playing with peg and extending the toy language via the simplejit I found here: https://github.com/sunfishcode/simplejit-demo -- but is there a place I can find an similarly simple example of using the faerie backend to emit machine code?
    Pat Hickey
    @pchickey
    Not that I know of. The development on the cretonne module backend has been tested through our (private, for now) codebase, so while not all batteries are included for now, you can follow the general structure of the simplejit demo if you want to make your own
    Lachlan Sneff
    @lachlansneff
    Nebulet also has an example of using cretonne, although it's not the module backend.
    Kevin Watters
    @kevinw
    cool, I'm getting pretty far following along the simplejit demo--thanks!
    Lachlan Sneff
    @lachlansneff
    I didn't know faerie supported PE files
    Kevin Watters
    @kevinw
    _exe is a bad name
    i'm testing on mac
    Lachlan Sneff
    @lachlansneff
    Ah, my mistake
    Pat Hickey
    @pchickey
    i should mention that we arent using the faerie mach-o backend, just elf
    (so just linux)
    if mach-o works, thats a testament to m4b's excellence, but i haven't tested it.
    Kevin Watters
    @kevinw
    hmm, stuck on faerie stuff..looks like the resulting executable has _start instead of "start"
    Dan Gohman
    @sunfishcode
    @kevinw I have a faerie version of simple-jit in a branch in the same repo: https://github.com/sunfishcode/simplejit-demo/tree/faerie
    @kevinw Are you defining "start" yourself, or relying on the standard libraries to provide the entry point?
    Kevin Watters
    @kevinw
    @sunfishcode ah, thanks for your help—got as far as BinaryFormat::Macho => unimplemented!("macho relocations") in cretonne/lib/faerie/src/container.rs :)
    Dan Gohman
    @sunfishcode
    Ah, it ought
    to be straightforward to implement the macho forms; they ought to be similar to the elf ones
    Kevin Watters
    @kevinw
    yeah looking now
    Kevin Watters
    @kevinw
    not sure I'm capable yet of finding the right matches here...still have some learning to do with regards to terminology (GOT, PLT)
    Dan Gohman
    @sunfishcode
    I can take a look in a few minutes here.
    Dan Gohman
    @sunfishcode
    I don't have a machine where I can test this handy, but here's a preliminary patch: sunfishcode/cretonne@1d76dbf
    Kevin Watters
    @kevinw
    @sunfishcode looks very close, we're just missing Reloc::X86PLTRel4
    Kevin Watters
    @kevinw
    as a guess I used X86_64_RELOC_UNSIGNED
    and got
    computer:compiler-faerie kevin$ cargo run && gcc -o test test.o && ./test
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
    Running target/debug/toy
    hello world
    so we're good!
    for the smallest possible test! thanks for your help :)
    Dan Gohman
    @sunfishcode
    Ok, cool!
    I'm not a macho expert, and the documentation I found in a few minutes of poking around is telling me that it doesn't want explicit PLT relocations
    So I think the real fix here is to teach codegen that, so it doesn't use X86PLTRel4 on macho
    But I can follow up on that.
    Kevin Watters
    @kevinw
    okay—glad we could at least get that far!
    Dan Gohman
    @sunfishcode
    @kevinw I now have a more complete fix here: https://github.com/sunfishcode/cretonne/tree/macho-relocations
    Lachlan Sneff
    @lachlansneff
    cretonne/cretonne#363
    Lachlan Sneff
    @lachlansneff
    @sunfishcode Do you know what's going on here? https://travis-ci.org/cretonne/cretonne/jobs/391915031
    Pat Hickey
    @pchickey
    @lachlansneff I think that test is checking that heap accesses get legalized in a certain way, and you just changed the way that worked, so you'll have to go and fix the tests as well