Skip to contentSkip to conversation

tools/libxl: do not use `-c -E` compiler options together

PATCH In review Roger Pau Monne 3 participants 3 messages Apr 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libxl: do not use `-c -E` compiler options together

It makes no sense to request for preprocessor only output and also request object file generation. Fix the _libxl.api-for-check target to only use -E (preprocessor output).

Also Clang 20.0 reports an error if both options are used.

Fixes 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/light/Makefile +1 -1
index 37e4d1670986..b690d921593d 100644
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>[email protected]
 	mv -f [email protected] $@
Signature · 1 line
2.48.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Roger Pau Monne

It makes no sense to request for preprocessor only output and also request object file generation. Fix the _libxl.api-for-check target to only use -E (preprocessor output).

Also Clang 20.0 reports an error if both options are used.

Fixes 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')

As this is impacting GitlabCI, it wants backporting (ideally everywhere, although I'm still accumulating other CI fixes on 4.18 and earlier).

~Andrew

Acked-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 9 lines · Roger Pau Monne

It makes no sense to request for preprocessor only output and also request object file generation. Fix the _libxl.api-for-check target to only use -E (preprocessor output).

Also Clang 20.0 reports an error if both options are used.

Fixes 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')

Thanks,

--

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech