Bug 217706
Summary: | [perf] Build error when using LTO on 6.4 | ||
---|---|---|---|
Product: | Tools | Reporter: | Marcus Seyfarth (m.seyfarth) |
Component: | Other | Assignee: | Tools.Other (tools_other) |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
Marcus Seyfarth
2023-07-25 18:44:18 UTC
When patching in Ian's LTO patches and setting LTO=1 for perf, I now see these warnings that are treated as errors: perf-in.o pmu-events/pmu-events-in.o -Wl,--whole-archive /tmp/makepkg/linux-tools/src/linux/tools/perf/libapi/libapi.a /tmp/makepkg /linux-tools/src/linux/tools/perf/libperf/libperf.a /tmp/makepkg/linux-tools/src/linux/tools/perf/libsubcmd/libsubcmd.a /tmp/makepkg/linux-tools/src /linux/tools/perf/libsymbol/libsymbol.a /tmp/makepkg/linux-tools/src/linux/tools/perf/libbpf/libbpf.a -Wl,--no-whole-archive -Wl,--start -group -lpthread -lrt -lm -ldl -lelf -ldebuginfod -ldw -lunwind-x86_64 -lunwind -llzma -lcrypto -lslang -lpython3.11 -ldl -lm -lutil -lstdc++ -lz -llzma -lzstd -lcap -lnuma -ltraceevent -Wl,--end-group -o perf util/parse-events.c: In function "parse_events_add_pmu": util/parse-events.c:1571:23: error: 'info.unit' could be used uninitialized [-Werror=maybe-uninitialized] 1571 | evsel->unit = strdup(info.unit); | ^ util/parse-events.c:1458:30: Note: "info.unit" was declared here 1458 | struct perf_pmu_info info; | ^ util/parse-events.c:1572:22: error: 'info.scale' could be used uninitialized [-Werror=maybe-uninitialized] 1572 | evsel->scale = info.scale; | ^ util/parse-events.c:1458:30: Note: "info.scale" was declared here 1458 | struct perf_pmu_info info; | ^ util/parse-events.c:1573:30: error: "MEM <unsigned char> [(struct perf_pmu_info *)&info + 16B]" could be used uninitialized [-Werror=maybe-uninitialized] 1573 | evsel->per_pkg = info.per_pkg; | ^ util/parse-events.c:1458:30: Note: "MEM <unsigned char> [(struct perf_pmu_info *)&info + 16B]" was declared here 1458 | struct perf_pmu_info info; | ^ util/parse-events.c:1574:31: error: "MEM <unsigned char> [(struct perf_pmu_info *)&info + 17B]" could be used uninitialized [-Werror=maybe-uninitialized] 1574 | evsel->snapshot = info.snapshot; | ^ util/parse-events.c:1458:30: Note: "MEM <unsigned char> [(struct perf_pmu_info *)&info + 17B]" was declared here 1458 | struct perf_pmu_info info; | ^ lto1: All warnings are treated as errors make[2]: *** [/tmp/ccqCyWfp.mk:65: /tmp/ccpuVfDq.ltrans21.ltrans.o] Error 1 And if I set -Wno-error=maybe-uninitialized the build errors out soon after with: mold: error: undefined symbol: perf_regs_load >>> referenced by <artificial> >>> /tmp/ccZ9Po2M.ltrans18.ltrans.o:(test_dwarf_unwind__thread) mold: error: undefined symbol: memcpy_orig >>> referenced by <artificial> >>> /tmp/ccZ9Po2M.ltrans12.ltrans.o mold: error: undefined symbol: __memset >>> referenced by <artificial> >>> /tmp/ccZ9Po2M.ltrans12.ltrans.o mold: error: undefined symbol: __memcpy >>> referenced by <artificial> >>> /tmp/ccZ9Po2M.ltrans12.ltrans.o mold: error: undefined symbol: memset_orig >>> referenced by <artificial> >>> /tmp/ccZ9Po2M.ltrans12.ltrans.o This is on Kernel 6.4.6 by the way. |