Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant: fix lack of asm/types.h on Ubuntu images #319

Closed
wants to merge 1 commit into from

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented May 2, 2023

This adds missing includes as running the test in a vagrant vm was having errors like:

vagrant@libbpfgo-amd64-vm:/vagrant$ make test
UAPIDIR=/vagrant/output \
	make -C /vagrant/libbpf/src install_uapi_headers
make[1]: Entering directory '/vagrant/libbpf/src'
  INSTALL  ../include/uapi/linux/bpf.h ../include/uapi/linux/bpf_common.h ../include/uapi/linux/btf.h
make[1]: Leaving directory '/vagrant/libbpf/src'
CC=clang \
	CGO_CFLAGS="-I/vagrant/output" \
	CGO_LDFLAGS="-lelf -lz /vagrant/output/libbpf.a" \
	GOOS=linux GOARCH=amd64 \
	go build \
	-tags netgo -ldflags '-w -extldflags "-static"' \
	.
make -C ./selftest/build
make[1]: Entering directory '/vagrant/selftest/build'
clang -g -O2 -Wall -fpie -target bpf -D__TARGET_ARCH_amd64 -I../../output -I/vagrant/selftest/common -c libbpfgo_test.bpf.c -o libbpfgo_test.bpf.o
In file included from libbpfgo_test.bpf.c:2:
In file included from ../../output/linux/bpf.h:11:
/usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
         ^~~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:24: libbpfgo_test.bpf.o] Error 1
make[1]: Leaving directory '/vagrant/selftest/build'
make: *** [Makefile:59: libbpfgo-test-bpf-static] Error 2

@geyslan geyslan added the chore label May 2, 2023
@geyslan geyslan requested a review from yanivagman May 2, 2023 12:40
@geyslan geyslan self-assigned this May 2, 2023
@geyslan geyslan requested a review from rafaeldtinoco May 2, 2023 14:00
@rafaeldtinoco
Copy link
Contributor

Check:

commit 99ea32d
Author: Rafael David Tinoco rafaeldtinoco@gmail.com
Date: Tue May 2 14:20:44 2023

selftests: do not depend on uapi headers

- include missing types in vmlinux.h
- fix headers for all bpf.c files

@rafaeldtinoco
Copy link
Contributor

And removing multilib from build dependencies as well:

#321

@rafaeldtinoco
Copy link
Contributor

Closing this as not needed.

@geyslan geyslan deleted the vagrant-lib branch May 29, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants