GithubHelp home page GithubHelp logo

Build for ARM (e.g. Raspberry PI ) about wxgo HOT 6 OPEN

dtrehas avatar dtrehas commented on August 30, 2024
Build for ARM (e.g. Raspberry PI )

from wxgo.

Comments (6)

dontpanic92 avatar dontpanic92 commented on August 30, 2024 2

Hi dtrehas,

I'm not familiar with ARM but I think it will be hard to compile wxGo on a Raspberry PI considering its limited performance. Perhaps we can cross-compile it. However I'm not sure whether it will work, because I have no experience on cross-compiling a Go program.

from wxgo.

neonsoftware avatar neonsoftware commented on August 30, 2024 1

Hi dontpanic92,

first of all GREAT WORK πŸ‘ thanks for sharing

Regarding cross compilation, it is quite beautiful and builtin in golang, this post from Dave Cheney shows it very well.
Basically it is mostly about playing with the variables GOOS and GOARCH.

here is a little example

# Let's say that hello.go prints "hello world". I'm on 64bit OSX
$ go build hello.go                          # compiles binary hello for my system
$ file hello                                 # checking binary type
hello: Mach-O 64-bit executable x86_64       # OK, it's mine

# now let's cross compile to linux arm
$ export GOOS=linux                          # I set 'linux as target OS' 
$ export GOARCH=arm                          # I set 'arm as target architecture'
$ go build hello.go                          # this time will cross-compile
$ file hello                                 # checking binary type
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
# arm !

Regarding this specific project, cross-compiling this library to ARM, I guess that some specific architecture-specific assets will be required for the SWIG, wxWidget toolchain to compile. (a file setup_linux_arm.go ?)

I might have time to take a look in the following weeks. In that case will post updates here.

cheers

from wxgo.

dontpanic92 avatar dontpanic92 commented on August 30, 2024 1

@neonsoftware Yes, you are right. First of all we need a wxWidgets for arm, and after that the setup_linux_arm.go should contain the CPPFLAGS and LDFLAGS to make it work.

from wxgo.

neonsoftware avatar neonsoftware commented on August 30, 2024

Yep πŸ‘ I'll grab my arm board and try to compile the static wxWidgets libraries for arm

from wxgo.

neonsoftware avatar neonsoftware commented on August 30, 2024

@dontpanic92 did you have to manually set the static libraries to be PIC enabled with -fPIC ?

Having that sort of error at first attempt of go get on ARM with the new libraries ...

/usr/bin/ld: ./linux_arm/lib/libwx_gtk2u_aui-3.1.a(auilib_framemanager.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC

update: apparently yes, must be explicitly set, according to here and here

from wxgo.

neonsoftware avatar neonsoftware commented on August 30, 2024

been out for a week, will get back to it in the next days :bowtie:

from wxgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.