Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harvey port of golang #2

Open
wants to merge 7 commits into
base: harveyport
Choose a base branch
from
Open

Harvey port of golang #2

wants to merge 7 commits into from

Conversation

sevki
Copy link
Member

@sevki sevki commented Jun 18, 2017

attempting to port go to harvey:

  1. added harvey to src/go/build/syslist.go
  2. added harvey to cmd/dist/build.go

@sevki sevki force-pushed the harvey branch 5 times, most recently from c7dfb7b to 7fd07e0 Compare June 18, 2017 21:58
add harvey to okgoos var
add harvey/amd64 to cgoEnabled as false

Signed-off-by: Sevki <[email protected]>
Copy link
Contributor

@rminnich rminnich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the approach here? Are you going to go with "harvey implies plan 9 with differences" or a full port? What's your plan for keeping up with ToT?

Copy link
Contributor

@rminnich rminnich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my port is in plan9port. Why push to master? Why not a branch? Master is supposed to mirror upstream master.

@sevki sevki changed the base branch from master to harveyport June 18, 2017 22:32
@sevki
Copy link
Member Author

sevki commented Jun 18, 2017

I'm trying to figure out how would "harvey implies plan9 but with differences" work, and the only way I know how to do that is by trial and error.

For instance, our previous assumption that we can handle this by implementing a ast re-writer didn't really pan out, since there are a lot of asm files, and code that's generated from cmd/dist.

My initial feeling is we'll probably need to fix stuff in runtime by hand and rest can probably be re-written by a tool which I started working on sevki/go2os

@sevki
Copy link
Member Author

sevki commented Jun 18, 2017

@rminnich done.

@rminnich
Copy link
Contributor

Take a look at how android implies linux. That's what everyone suggested. it's actually what plan9port does in effect and it's why only three files change.

Copy link
Contributor

@rminnich rminnich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's into this branch it makes sense to do it.

plan9 files are now tagged with !harvey build tags

Signed-off-by: Sevki <[email protected]>
for filename matching go uses android = linux type mechanism. This
commit extends that behaviour for harvey to take advantage of that
mechanism.

Signed-off-by: Sevki <[email protected]>
this commit gets rid of hardcoding the head type as linux

Signed-off-by: Sevki <[email protected]>
this commit adds ron's changes to in the plan9 fork applied to
harvey specific files and adds build tags that prevent plan9
files to be included in the package file lists.

Signed-off-by: Sevki <[email protected]>
@gmacd
Copy link
Member

gmacd commented Nov 18, 2017

Is this going anywhere? It would be great to get Go running well.

@gmacd
Copy link
Member

gmacd commented Dec 25, 2017

I've been looking into the build error you've been seeing in Travis.

I think the problem is caused by the linker thinking that none of the objects are referenced. It seems to think there's no root to the tree. If you use one of the debug modes in the linker, and run with GOOS=plan9, you'll see the first marked object is _rt0_amd64_plan9. Do the same with GOOS=harvey and you'll see nothing.

Try copying the file rt0_plan9_amd64.s, and naming it rt0_harvey_amd64.s. You'll also need to rename the function in the file to _rt0_amd64_harvey.

This worked on my machine :), with a minimal set of changes on top of the plan9port branch.

@sevki
Copy link
Member Author

sevki commented Dec 26, 2017

@gmacd it's a Christmas miracle! 🎉

@gmacd
Copy link
Member

gmacd commented Dec 26, 2017

Merry Christmas @sevki!

It builds the compiler, but if you then compile anything with it, the exe suicides on exit. It's a step in the right direction though :)

@gmacd
Copy link
Member

gmacd commented Dec 26, 2017

Actually, it's not suiciding on exit, it's half way through printing a line. Maybe I'll get more time to look at it in the evening, unless you get there first :)

@sevki
Copy link
Member Author

sevki commented Dec 26, 2017

@gmacd best boxing day present ever. I'll have a crack at it 😄

@gmacd
Copy link
Member

gmacd commented Dec 26, 2017

Yeah, unfortunately you need to wrap it yourself :)

@sevki
Copy link
Member Author

sevki commented Dec 26, 2017

ha. it's the thought that counts mate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants