linux/tools/power/x86
Herton R. Krzesinski b2dd71f9f7 tools/power/x86/intel-speed-select: fix build failure when using -Wl,--as-needed
Build of intel-speed-select will fail if you run:

$ LDFLAGS="-Wl,--as-needed" /usr/bin/make V=1
...
gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude -I/usr/include/libnl3 -Wl,--as-needed -lnl-genl-3 -lnl-3 intel-speed-select-in.o -o intel-speed-select
/usr/bin/ld: intel-speed-select-in.o: in function `handle_event':
(...)/linux/tools/power/x86/intel-speed-select/hfi-events.c:189: undefined reference to `nlmsg_hdr'
...

In this case the problem is that order when linking matters when using
the flag -Wl,--as-needed, symbols not used at that point are discarded.
So since intel-speed-select-in.o comes after, at that point the
libraries/symbols are already discarded and then missing/undefined
references are reported.

To fix this, make sure we specify LDFLAGS after the object file.

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Link: https://lore.kernel.org/r/20220404210525.725611-1-herton@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-04-13 13:49:48 +02:00
..
amd_pstate_tracer tools/power/x86/amd_pstate_tracer: Add tracer tool for AMD P-state 2022-03-09 19:53:01 +01:00
intel_pstate_tracer tools/power/x86/intel_pstate_tracer: make tracer as a module 2022-03-09 19:53:01 +01:00
intel-speed-select tools/power/x86/intel-speed-select: fix build failure when using -Wl,--as-needed 2022-04-13 13:49:48 +02:00
turbostat turbostat: fix PC6 displaying on some systems 2022-03-08 14:27:25 +01:00
x86_energy_perf_policy The main part of this branch is the ongoing fight against windmills in 2020-12-14 13:29:34 -08:00