hostapd: replace "argument list too long" fix with a simpler version
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 210-build-de-duplicate-_DIRS-before-calling-mkdir.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 4 Apr 2024 12:59:41 +0200
3 Subject: [PATCH] build: de-duplicate _DIRS before calling mkdir
4
5 If the build path is long, the contents of the _DIRS variable can be very long,
6 since it repeats the same directories very often.
7 In some cases, this has triggered an "Argument list too long" build error.
8
9 Suggested-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/src/build.rules
14 +++ b/src/build.rules
15 @@ -80,7 +80,7 @@ endif
16 _DIRS := $(BUILDDIR)/$(PROJ)
17 .PHONY: _make_dirs
18 _make_dirs:
19 - @mkdir -p $(_DIRS)
20 + @mkdir -p $(sort $(_DIRS))
21
22 $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
23 $(Q)$(CC) -c -o $@ $(CFLAGS) $<