diff options
author | Herton R. Krzesinski <[email protected]> | 2022-04-04 18:05:25 -0300 |
---|---|---|
committer | Hans de Goede <[email protected]> | 2022-04-13 13:49:48 +0200 |
commit | b2dd71f9f728da695a86b8308feb4f39defe9019 (patch) | |
tree | a34738a662280dc811c31363f150e1913317d923 /scripts/bpf_doc.py | |
parent | 753ee989f7cf0c0a76a7f56956827a8863a60f97 (diff) |
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 <[email protected]>
Signed-off-by: Herton R. Krzesinski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions