geertjohan / openwrt-go Goto Github PK
View Code? Open in Web Editor NEWFork of the openwrt project to add gccgo and libgo
License: GNU General Public License v2.0
Fork of the openwrt project to add gccgo and libgo
License: GNU General Public License v2.0
Any plans for merging this back to upstream openwrt repo? So the default build from openwrt can run Go programs.
Greetings.
I wonder:
Thanks.
export GOOS=linux
export GOARCH=mips32
xxxxx@server:~/work/test/go-mips32-dev.github/src$ ./make.bash
cmd/dist
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/vl
cmd/6a
cmd/va
cmd/6c
cmd/vc
cmd/6g
cmd/vg
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
runtime (linux/mips32)
runtime
errors
sync/atomic
unicode
unicode/utf8
math
sort
encoding
unicode/utf16
container/list
crypto/subtle
container/ring
image/color
runtime/race
image/color/palette
sync
container/heap
io
syscall
bytes
strings
hash
crypto/cipher
hash/crc32
crypto/hmac
hash/adler32
hash/crc64
hash/fnv
bufio
text/tabwriter
path
html
compress/bzip2
strconv
math/rand
math/cmplx
time
internal/syscall
reflect
regexp/syntax
crypto
encoding/base64
net/url
crypto/aes
crypto/rc4
encoding/ascii85
encoding/base32
image
crypto/md5
crypto/sha1
crypto/sha256
crypto/sha512
encoding/pem
os
image/draw
image/jpeg
regexp
path/filepath
os/signal
fmt
encoding/binary
io/ioutil
os/exec
cmd/pprof/internal/svg
crypto/des
index/suffixarray
cmd/internal/goobj
cmd/internal/rsc.io/arm/armasm
cmd/internal/rsc.io/x86/x86asm
debug/dwarf
debug/gosym
debug/plan9obj
flag
log
go/token
encoding/json
encoding/xml
text/template/parse
compress/flate
math/big
encoding/hex
mime
net/http/internal
go/scanner
runtime/pprof
cmd/pprof/internal/tempfile
archive/tar
compress/lzw
cmd/pack
database/sql/driver
go/ast
encoding/csv
encoding/gob
compress/gzip
archive/zip
compress/zlib
debug/elf
debug/macho
debug/pe
database/sql
image/gif
text/template
cmd/pprof/internal/profile
image/png
runtime/debug
testing
testing/iotest
testing/quick
text/scanner
crypto/elliptic
encoding/asn1
crypto/rand
crypto/dsa
go/parser
go/printer
crypto/rsa
cmd/internal/objfile
crypto/x509/pkix
crypto/ecdsa
go/doc
html/template
cmd/pprof/internal/plugin
cmd/pprof/internal/symbolz
cmd/addr2line
cmd/nm
cmd/objdump
cmd/pprof/internal/symbolizer
go/build
cmd/cgo
go/format
cmd/gofmt
cmd/pprof/internal/report
cmd/fix
cmd/yacc
cmd/pprof/internal/commands
cmd/pprof/internal/driver
runtime/cgo
net
os/user
crypto/x509
net/textproto
log/syslog
mime/multipart
net/mail
crypto/tls
net/http
net/smtp
cmd/go
cmd/pprof/internal/fetch
expvar
net/http/cgi
net/http/cookiejar
net/http/httptest
net/http/httputil
net/http/pprof
net/rpc
cmd/pprof
net/http/fcgi
net/rpc/jsonrpc
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'libssl'... ok.
Checking 'tar'... failed.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'md5sum'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'svn'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.
Build dependency: Please install GNU 'tar'
/home/willen/code/openwrt/openwrt/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/willen/code/openwrt/openwrt/include/toplevel.mk:140: recipe for target 'staging_dir/host/.prereq-build' failed
make[1]: *** [staging_dir/host/.prereq-build] Error 1
/home/willen/code/openwrt/openwrt/include/toplevel.mk:69: recipe for target 'prepare-tmpinfo' failed
make: *** [prepare-tmpinfo] Error 2
tar --version
tar (GNU tar) 1.28
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
Hi, I fulli noob in gcc/MIPS/edlibs etc . But I need to build an executable go binary for openwrt. Openwrt installed in virtual box. So, I start from this issue #2
On my macosx host I did :
git clone https://github.com/GeertJohan/openwrt-go
git checkout add-gccgo-and-libgo
make menuconfig
and after I got
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... failed.
Checking 'getopt'... failed.
Checking 'fileutils'... failed.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... failed.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'perl'... ok.
Checking '/usr/bin/python2.7'... ok.
Checking 'wget'... ok.
Checking 'git'... ok.
Checking 'gnutar'... failed.
Checking 'svn'... ok.
Checking 'openssl'... ok.
Checking 'gnu-find'... failed.
Checking 'getopt-extended'... ok.
Checking 'file'... ok.
Checking 'non-root'... ok.
Build dependency: OpenWrt can only be built on a case-sensitive filesystem
Build dependency: Please install GNU getopt
Build dependency: Please install GNU fileutils
Build dependency: Please install GNU awk.
Build dependency: Please install GNU tar.
Build dependency: Please install GNU find
Prerequisite check failed. Use FORCE=1 to override.
make: *** [tmp/.prereq-build] Error 1
What I did wrong?
how to make it work on x86? thanks
openwrt-go/tools/scons/Makefile
PKG_NAME:=scons
PKG_VERSION:=2.3.5
...
correct:PKG_MD5SUM:=8b0d1041266f89b18e47f26d943f8aa5
hello, I want to build an golang program runs on openwrt(MIPS) router, I searched google, found your great job, I'm new to openwrt, so the question maybe dumb:
@GeertJohan , what is the status of this project?
Should it work, or not?
Or, maybe, https://github.com/brimstone/openwrt-go/tree/add-gccgo-and-libgo can be used?
Was that projects abandoned after success, or before?
mips-gccgo -v -o test.go test
hello,
I use gccgo hello.go can be successfully compiled, using go build -x -compiler=gccgo hello.go failed
rexchou@rexchou-virtual-machine:~/work$ go build -x -compiler=gccgo hello.go
WORK=/tmp/go-build221584061
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p $WORK/command-line-arguments/obj/exe/
cd /home/rexchou/work
"" -I $WORK -c -g -m64 -fgo-relative-import-path=/home/rexchou/work -o $WORK/command-line-arguments/_obj/go.o ./hello.go
go build command-line-arguments: : fork/exec : no such file or directory
I'm trying to compile based on the info in the other issue, but I keep running into a make failure due to this mismatch. Here's the output from the failure:
MD5 sum of the downloaded file does not match (file: 8b0d1041266f89b18e47f26d943f8aa5, requested: a8988c7ef11133bb3b6ccf0af67ce010) - deleting download.
It's trying to download it from http://colocrossing.dl.sourceforge.net/project/scons/scons/2.3.5/scons-2.3.5.tar.gz and the other mirrors it tries after 404.
Any ideas?
Hi,
I am trying to build with make -j1 V=s, and GCC fails to build for MIPS ar71xx with this error:
cc1: note: someone does not honour COPTS correctly, passed 0 times
In file included from sysinfo.c:82:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/if_ether.h:137:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^
In file included from sysinfo.c:28:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/netinet/if_ether.h:96:8: note: originally defined here
struct ethhdr {
^
In file included from sysinfo.c:118:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo'
struct sysinfo {
^
In file included from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/kernel.h:4:0,
from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/netlink.h:4,
from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/if_addr.h:5,
from sysinfo.c:79:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/sysinfo.h:7:8: note: originally defined here
struct sysinfo {
^
/bin/bash ./libtool --tag=CC --mode=compile /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/xgcc -B/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/bin/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/lib/ -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/include -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/sys-include -DHAVE_CONFIG_H -I. -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libgcc -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libbacktrace -I ../../gcc/include -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -MT getncpu-linux.lo -MD -MP -MF .deps/getncpu-linux.Tpo -c -o getncpu-linux.lo `test -f 'runtime/getncpu-linux.c' || echo '/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/'`runtime/getncpu-linux.c
libtool: compile: /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/xgcc -B/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/bin/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/lib/ -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/include -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/sys-include -DHAVE_CONFIG_H -I. -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libgcc -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libbacktrace -I ../../gcc/include -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -MT getncpu-linux.lo -MD -MP -MF .deps/getncpu-linux.Tpo -c /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime/getncpu-linux.c -fPIC -DPIC -o .libs/getncpu-linux.o
/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime/getncpu-linux.c:9:48: error: missing binary operator before token "("
#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
^
Makefile:3190: recipe for target 'getncpu-linux.lo' failed
make[8]: *** [getncpu-linux.lo] Error 1
I will try with other arches if I have the same error...
Hi,
Just found this repo:
https://github.com/akent/openwrt-15.05.git
I managed to compile the gccgo and go xcompilers for openwrt mips (ar7xxx), unlike with this repo.
Any intention to merge those? It offers GCC-5.3 aith GO1.4.
im new in openwrt and golang , I compiled openwrt-go and flash to my router successfully.
and now ,i need to use golang to update settings like qos and firewall.. on my router .
is there any solution or tip for me
thanks ,
Does anyone know the advantage of re-compile openwrt firmware with this repo? Currently I could run cross compiled go program on original openwrt mips32 firmware, but the performance is very poor.
I tried an UDP tunnel program which written in golang, but when it runs on my mips32 router after cross compiled, the transfer rate is only 2-3Mbps.
So I'm looking for some optimized metheds to run golang on my mips32 router now. Thanks!
My cross compile bin attahed, source code here: https://github.com/xtaci/kcptun
kcptun-client_mips32_little_endian.zip
kcptun-client_mips32_big_endian.zip
Hi sir,
I follow your tips to compile the gccgo successully, but something wrong happen after i use gccgo to compile hello world.
helloworld.go:(text+0x195): undefined reference to __morestack
Can you give me some hints to solve the problem?
GO1.6 finally support MIPS processors, but only supports the MIPS64. MIPS processors are not supported. Ask whether there is support GO1.6 plan? Or to support GO1.4?
You can not provide, modify script shows?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.