Coder Social home page Coder Social logo

geertjohan / openwrt-go Goto Github PK

View Code? Open in Web Editor NEW
243.0 21.0 38.0 124.99 MB

Fork of the openwrt project to add gccgo and libgo

License: GNU General Public License v2.0

Shell 4.78% C 68.73% Assembly 1.22% C++ 4.97% Objective-C 2.15% Awk 0.02% Perl 1.63% Python 0.10% Makefile 15.05% CMake 0.01% Lex 0.05% Yacc 0.11% Groff 1.19%

openwrt-go's Introduction

This is the buildsystem for the OpenWrt Linux distribution.

Please use "make menuconfig" to configure your appreciated
configuration for the toolchain and firmware.

You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.

Run "./scripts/feeds update -a" to get all the latest package definitions
defined in feeds.conf / feeds.conf.default respectively
and "./scripts/feeds install -a" to install symlinks of all of them into
package/feeds/.

Use "make menuconfig" to configure your image.

Simply running "make" will build your firmware.
It will download all sources, build the cross-compile toolchain, 
the kernel and all choosen applications.

You can use "scripts/flashing/flash.sh" for remotely updating your embedded
system via tftp.

The OpenWrt system is documented in docs/. You will need a LaTeX distribution
and the tex4ht package to build the documentation. Type "make -C docs/" to build it.

To build your own firmware you need to have access to a Linux, BSD or MacOSX system
(case-sensitive filesystem required). Cygwin will not be supported because of
the lack of case sensitiveness in the file system.


Sunshine!
	Your OpenWrt Project
	http://openwrt.org


openwrt-go's People

Contributors

geertjohan avatar iav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openwrt-go's Issues

Prerequisite check failed

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 build an executable go binary for openwrt

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:

  1. is it possible build an golang program runs on openwrt(MIPS) router?
  2. if so, is it possible cross compile the binary on an os x system? and how do I start? do I need to cross compile gccgo for MIPS?
    any sugguestion would be great, thanks.

help :undefined reference to `__morestack`

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?

go build command-line-arguments: : fork/exec : no such file or directory

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

Make fails due to MD5 mismatch with scons-2.3.5.tar.gz

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?

Run cross compiled go program on original openwrt mips32 firmware

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

Merging back to upstream

Any plans for merging this back to upstream openwrt repo? So the default build from openwrt can run Go programs.

Project update questions

Greetings.

I wonder:

  1. Is the project still alive?
  2. Did openwrt successfully ported go (I found it in their repos)?
  3. Any plans on further developments / implementations?

Thanks.

make prereq failed with tar checking, but my 'tar' is the latest version.

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.

GCC build fails for AR71XX

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...

How to compile GO 1.6 or GO1.4 to openwrt?

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?

How to change openwrt settings by calling uci on golang

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 ,

compilation error on x86_64 host machine

export GOOS=linux
export GOARCH=mips32

xxxxx@server:~/work/test/go-mips32-dev.github/src$ ./make.bash

Building C bootstrap tool.

cmd/dist

Building compilers and Go bootstrap tool for host, linux/amd64.

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)

Building packages and commands for host, linux/amd64.

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

cmd/pprof

/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

cmd/go

/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

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.