This is an archive of the discontinued LLVM Phabricator instance.

[bindings/go] Fix building on 32-bit systems (ARM etc.)
ClosedPublic

Authored by aykevl on Feb 11 2019, 1:56 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

aykevl created this revision.Feb 11 2019, 1:56 AM
whitequark accepted this revision.Feb 11 2019, 3:16 AM

Seems fine, with or without the length change. Hopefully this can get into 8.0.

bindings/go/llvm/ir.go
1265 ↗(On Diff #186199)

Looks like the Go documentation link above recommends using 1 << 28. Seems like a really awkward pattern, but I'm not a Go expert...

This revision is now accepted and ready to land.Feb 11 2019, 3:16 AM
aykevl marked an inline comment as done.Feb 14 2019, 12:08 AM

Can you (or someone else) merge this change? I do not have commit access. That would allow a request for inclusion in LLVM 8 (I hope).

bindings/go/llvm/ir.go
1265 ↗(On Diff #186199)

That's a modification done by me, because the original code with 1 << 30 led to this bug. The exact number doesn't really matter, as long as it is "big enough".

Yeah this is rather dirty Go, but it's as elegant as things get in CGo land. There may be better ways, and if someone knows one they should probably change this. For now, this fixes a rather important bug (FTBFS).

This revision was automatically updated to reflect the committed changes.