iproute2 fails to build setting LIBBPF_DYNAMIC unless LIBBPF_DIR is defined.
Neil Kettle
neil at digit-labs.org
Wed Mar 10 09:10:55 GMT 2021
Tony - thanks for that, performed dirclean and still failing, but again, a few strange errors fixed with make iproute2/clean and rebuild.
However, the same old problem still exists in the build of both images I routinely build (nanopi r2s/zeropi).
The root cause is the compilation of both bpf_libbpf.c and bpf_glue.c, both of which are a failure to include limits.h for PATH_MAX.
In the above, bpf_glue.c is being pulled in because the LIBBPF_DIR variable is not defined in the Makefile causing iproute2 to compile assuming libbpf will be dynamic (when we can link static).
diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 440e33069b..8079f6fcb2 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -132,6 +132,7 @@ MAKE_FLAGS += \
KERNEL_INCLUDE="$(LINUX_DIR)/user_headers/include" \
SHARED_LIBS=$(SHARED_LIBS) \
IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
+ LIBBPF_DIR=$(STAGING_DIR) \
LIBBPF_FORCE=$(LIBBPF_FORCE) \
HAVE_ELF=$(HAVE_ELF) \
HAVE_MNL=$(HAVE_MNL) \
That fixes that issue. The remainder is to drop limits.h into bpf_libbpf.c.
Dumped the config for this device to: https://pastebin.com/JytWD2T0
> On 9 Mar 2021, at 21:04, itugrok at yahoo.com wrote:
>
> Hi Neil,
>
> There were recent build system changes that seem to be related to various build failures, and the cause of much frustrating debugging.
>
> I've had two reports of iproute2 build problems like yours, but neither was reproducible, even by the reporter and from one build to the next. I wasn't able to reproduce the failures myself using the same arch/toolchain, and noted that automated builds of iproute2 are all still succeeding.
>
> One reporter's problems disappeared after doing a "make dirclean", which again points to the build system. I suggest doing that, followed by building the latest master. If you still have problems, please report your build configuration and post the build log somewhere accessible. Those same details for your current build issues would be helpful too.
>
> Regards,
> Tony
More information about the openwrt-devel
mailing list