public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/power/x86/intel-speed-select: Prefix header search path with sysroot
@ 2025-01-29  3:39 Khem Raj
  2025-02-04  3:43 ` srinivas pandruvada
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2025-01-29  3:39 UTC (permalink / raw)
  To: platform-driver-x86, linux-kernel
  Cc: Khem Raj, Srinivas Pandruvada, Len Brown

This helps when using a cross-compiler for building intel-speed-select,
currently, its hardcoded to pick libnl3 headers from build host which may
not be same as build target when cross compiling.

cc -print-sysroot will print nothing if compiler is configured without
a sysroot and result in same string as it is now.

Fixes errors with gcc configured with host include poisoning e.g.

cc1: error: include location "/usr/include/libnl3" is unsafe for cross-compilation [-Werror=poison-system-directories]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Len Brown <len.brown@intel.com>
---
 tools/power/x86/intel-speed-select/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/power/x86/intel-speed-select/Makefile b/tools/power/x86/intel-speed-select/Makefile
index 7221f2f55e8b..8d3a02a20f3d 100644
--- a/tools/power/x86/intel-speed-select/Makefile
+++ b/tools/power/x86/intel-speed-select/Makefile
@@ -13,7 +13,7 @@ endif
 # Do not use make's built-in rules
 # (this improves performance and avoids hard-to-debug behaviour);
 MAKEFLAGS += -r
-override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3
+override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(shell $(CC) -print-sysroot)/usr/include/libnl3
 override LDFLAGS += -lnl-genl-3 -lnl-3
 
 ALL_TARGETS := intel-speed-select

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-04  3:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29  3:39 [PATCH] tools/power/x86/intel-speed-select: Prefix header search path with sysroot Khem Raj
2025-02-04  3:43 ` srinivas pandruvada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox