On Mon, 2024-12-02 at 16:52 -0800, Eduard Zingerman wrote: [...] > > Naive question: why pass EXTRA_CFLAGS to libbpf at all? Can we drop it? > > This was added by the commit [0]. > As far as I understand, the idea is to pass the following flags: > > ifeq ($(ARCH), arm) > # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux > # headers when arm instruction set identification is requested. > ARM_ARCH_SELECTOR := $(filter -D__LINUX_ARM_ARCH__%, $(KBUILD_CFLAGS)) > ... > TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR) > endif > > ifeq ($(ARCH), mips) > TPROGS_CFLAGS += -D__SANE_USERSPACE_TYPES__ > ... > endif > > Not sure if these are still necessary. > > [0] commit d8ceae91e9f0 ("samples/bpf: Provide C/LDFLAGS to libbpf") > But this means that I should include sysroot part in the COMMON_CFLAGS. I'll get the arm cross-compilation environment and double check.