Skip to content

Commit 6470795

Browse files
dparalenmurali-reddy
authored andcommitted
Use x/sys/unix epoll (#737)
* Make gobgp compile in an image This patch adds Makefile logic, similar to the kube-router target, allowing gobgp to be built in a container. * Use unix.Epoll* functions To be able to compile and run on the Linux@arm64 architecture one has to use the `golang.org/x/sys/unix` package instead the `syscall` package. This is because of these Go upstream bugs that won't be fixed in the standard library: - syscall: arm64: epoll_wait syscall not implemented golang/go#25813
1 parent 8fe9f70 commit 6470795

File tree

2 files changed

+49
-40
lines changed

2 files changed

+49
-40
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,16 @@ else
208208
endif
209209

210210
gobgp:
211+
ifeq "$(BUILD_IN_DOCKER)" "true"
212+
@echo Building gobgp
213+
$(DOCKER) run -v $(PWD)/vendor:/go/src -w /go/src/github.com/osrg/gobgp/gobgp $(DOCKER_BUILD_IMAGE) \
214+
sh -c 'GOARCH=$(GOARCH) CGO_ENABLED=0 go build -o gobgp'
215+
@echo Finished building gobgp.
216+
else
211217
cd vendor/github.com/osrg/gobgp/gobgp && \
212-
CGO_ENABLED=0 GOARCH=$(GOARCH) GOOS=linux go build -o $(MAKEFILE_DIR)/gobgp
218+
CGO_ENABLED=0 GOARCH=$(GOARCH) GOOS=linux go build -o gobgp
219+
endif
220+
cp -f vendor/github.com/osrg/gobgp/gobgp/gobgp gobgp
213221

214222
multiarch-binverify:
215223
@echo 'Verifying kube-router gobgp for ARCH=$(FILE_ARCH) ...'

vendor/github.com/osrg/gobgp/server/sockopt_linux.go

Lines changed: 40 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)