Unable to compile httpd example
nielsbergsma opened this issue · 4 comments
While compiling the httpd example according to Getting Started guide (README.md) I receive the following error:
httpd.c: In function 'main':
httpd.c:9:2: warning: implicit declaration of function 'rump_pub_lwproc_releaselwp' [-Wimplicit-function-declaration]
rump_pub_lwproc_releaselwp(); /* XXX */
^
httpd.c:10:2: warning: implicit declaration of function 'httpd' [-Wimplicit-function-declaration]
httpd();
^
!!!
!!! WARNING: $RUMPRUN_STUBLINK may be desupported without
!!! warning in the future. Do not rely on it
!!! continuing to be available.
!!!
httpd.pseudo: In function `main':
/home/niels/gorump/examples/httpd/httpd.c:9: undefined reference to `rump_pub_lwproc_releaselwp'
collect2: error: ld returned 1 exit status
x86_64-rumprun-netbsd-gcc: warning: stub link failed
Upon further inspection the following commands returns an error:
CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GOOS=netbsd ~/gorump/go/bin/go build -buildmode c-archive httpd.go
# runtime/cgo
cannot load imported symbols from ELF file $WORK/runtime/cgo/_obj/_cgo_.o: no symbol section
hey sorry for the late reply -- but offhand it looks like this line ->
CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GOOS=netbsd ~/gorump/go/bin/go build -buildmode c-archive httpd.go
should have the GOOS set to 'rumprun' not netbsd
Hi @eyberg,
Thanks for your response. I'm a bit confused, the README in the examples directory uses GOOS=netbsd.
To make sure my tool chain was correctly set up, I freshly installed Ubuntu 15.10, with the following commands executed:
sudo apt-get install git binutils build-essential make
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install qemu-kvm -y
sudo apt-get install libxen-dev -y
sudo apt-get install g++-4.8 -y
wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz
tar xzf go1.5*
sudo mv go /usr/local/go1.5
sudo ln -s /usr/local/go1.5 /usr/local/go
vim ~/.bashrc
git clone https://github.com/rumpkernel/rumprun
cd rumprun/
git pull origin master
git submodule update --init
CC=cc ./build-rr.sh hw
export PATH="${PATH}:/home/$(whoami)/rumprun/rumprun/bin"
vim ~/.bashrc
git clone https://github.com/deferpanic/gorump
cd gorump/
cd go/src && GOROOT_BOOTSTRAP=/usr/local/go GOOS=rumprun GOARCH=amd64 ./make.bash
sudo cp -R ../../go /usr/local/go1.5-patched
sudo rm -rf /usr/local/go
sudo ln -s /usr/local/go1.5-patched /usr/local/go
cd ~/gorump/examples/httpd
make
Unfortunately this still results in this error:
httpd.c: In function 'main':
httpd.c:9:2: warning: implicit declaration of function 'rump_pub_lwproc_releaselwp' [-Wimplicit-function-declaration]
rump_pub_lwproc_releaselwp(); /* XXX */
^
httpd.c:10:2: warning: implicit declaration of function 'httpd' [-Wimplicit-function-declaration]
httpd();
^
!!!
!!! WARNING: $RUMPRUN_STUBLINK may be desupported without
!!! warning in the future. Do not rely on it
!!! continuing to be available.
!!!
httpd.pseudo: In function `main':
/home/niels/gorump/examples/httpd/httpd.c:9: undefined reference to `rump_pub_lwproc_releaselwp'
collect2: error: ld returned 1 exit status
What am I missing?
@nielsbergsma AFAIK that error is actually ok; it should produce a binary that's bake-able. this function will be linked during the bake.
I have a PR that should remove this error here (rumpkernel/rumprun#75), but it's not yet merged. (the PR solves the bug that makes the call to rump_pub_lwproc_releaselwp necessary)
@uvgroovy, you're right. it's actually works. Thanks for your help.