forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/tools/build/feature/Makefile
....@@ -15,21 +15,24 @@
1515 test-hello.bin \
1616 test-libaudit.bin \
1717 test-libbfd.bin \
18
+ test-libbfd-buildid.bin \
1819 test-disassembler-four-args.bin \
1920 test-reallocarray.bin \
2021 test-libbfd-liberty.bin \
2122 test-libbfd-liberty-z.bin \
2223 test-cplus-demangle.bin \
24
+ test-libcap.bin \
2325 test-libelf.bin \
2426 test-libelf-getphdrnum.bin \
2527 test-libelf-gelf_getnote.bin \
2628 test-libelf-getshdrstrndx.bin \
27
- test-libelf-mmap.bin \
29
+ test-libdebuginfod.bin \
2830 test-libnuma.bin \
2931 test-numa_num_possible_cpus.bin \
3032 test-libperl.bin \
3133 test-libpython.bin \
3234 test-libslang.bin \
35
+ test-libslang-include-subdir.bin \
3336 test-libcrypto.bin \
3437 test-libunwind.bin \
3538 test-libunwind-debug-frame.bin \
....@@ -50,22 +53,30 @@
5053 test-zlib.bin \
5154 test-lzma.bin \
5255 test-bpf.bin \
56
+ test-libbpf.bin \
5357 test-get_cpuid.bin \
5458 test-sdt.bin \
5559 test-cxx.bin \
5660 test-gettid.bin \
5761 test-jvmti.bin \
62
+ test-jvmti-cmlr.bin \
5863 test-sched_getcpu.bin \
5964 test-setns.bin \
6065 test-libopencsd.bin \
6166 test-clang.bin \
6267 test-llvm.bin \
63
- test-llvm-version.bin
68
+ test-llvm-version.bin \
69
+ test-libaio.bin \
70
+ test-libzstd.bin \
71
+ test-clang-bpf-co-re.bin \
72
+ test-file-handle.bin \
73
+ test-libpfm4.bin
6474
6575 FILES := $(addprefix $(OUTPUT),$(FILES))
6676
6777 PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
6878 LLVM_CONFIG ?= llvm-config
79
+CLANG ?= clang
6980
7081 all: $(FILES)
7182
....@@ -78,7 +89,7 @@
7889 ###############################
7990
8091 $(OUTPUT)test-all.bin:
81
- $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
92
+ $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
8293
8394 $(OUTPUT)test-hello.bin:
8495 $(BUILD)
....@@ -97,6 +108,9 @@
97108
98109 $(OUTPUT)test-bionic.bin:
99110 $(BUILD)
111
+
112
+$(OUTPUT)test-libcap.bin:
113
+ $(BUILD) -lcap
100114
101115 $(OUTPUT)test-libelf.bin:
102116 $(BUILD) -lelf
....@@ -131,9 +145,6 @@
131145 $(OUTPUT)test-dwarf_getlocations.bin:
132146 $(BUILD) $(DWARFLIBS)
133147
134
-$(OUTPUT)test-libelf-mmap.bin:
135
- $(BUILD) -lelf
136
-
137148 $(OUTPUT)test-libelf-getphdrnum.bin:
138149 $(BUILD) -lelf
139150
....@@ -142,6 +153,9 @@
142153
143154 $(OUTPUT)test-libelf-getshdrstrndx.bin:
144155 $(BUILD) -lelf
156
+
157
+$(OUTPUT)test-libdebuginfod.bin:
158
+ $(BUILD) -ldebuginfod
145159
146160 $(OUTPUT)test-libnuma.bin:
147161 $(BUILD) -lnuma
....@@ -176,13 +190,16 @@
176190 $(BUILD) -laudit
177191
178192 $(OUTPUT)test-libslang.bin:
179
- $(BUILD) -I/usr/include/slang -lslang
193
+ $(BUILD) -lslang
194
+
195
+$(OUTPUT)test-libslang-include-subdir.bin:
196
+ $(BUILD) -lslang
180197
181198 $(OUTPUT)test-libcrypto.bin:
182199 $(BUILD) -lcrypto
183200
184201 $(OUTPUT)test-gtk2.bin:
185
- $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
202
+ $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) -Wno-deprecated-declarations
186203
187204 $(OUTPUT)test-gtk2-infobar.bin:
188205 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
....@@ -193,8 +210,15 @@
193210 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
194211 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
195212 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
196
-PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
213
+PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
197214 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
215
+
216
+ifeq ($(CC_NO_CLANG), 0)
217
+ PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
218
+ PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
219
+ PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
220
+ FLAGS_PERL_EMBED += -Wno-compound-token-split-by-macro
221
+endif
198222
199223 $(OUTPUT)test-libperl.bin:
200224 $(BUILD) $(FLAGS_PERL_EMBED)
....@@ -203,6 +227,9 @@
203227 $(BUILD) $(FLAGS_PYTHON_EMBED)
204228
205229 $(OUTPUT)test-libbfd.bin:
230
+ $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
231
+
232
+$(OUTPUT)test-libbfd-buildid.bin:
206233 $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
207234
208235 $(OUTPUT)test-disassembler-four-args.bin:
....@@ -253,6 +280,9 @@
253280 $(OUTPUT)test-bpf.bin:
254281 $(BUILD)
255282
283
+$(OUTPUT)test-libbpf.bin:
284
+ $(BUILD) -lbpf
285
+
256286 $(OUTPUT)test-sdt.bin:
257287 $(BUILD)
258288
....@@ -263,6 +293,9 @@
263293 $(BUILD)
264294
265295 $(OUTPUT)test-jvmti.bin:
296
+ $(BUILD)
297
+
298
+$(OUTPUT)test-jvmti-cmlr.bin:
266299 $(BUILD)
267300
268301 $(OUTPUT)test-llvm.bin:
....@@ -291,6 +324,22 @@
291324
292325 -include $(OUTPUT)*.d
293326
327
+$(OUTPUT)test-libaio.bin:
328
+ $(BUILD) -lrt
329
+
330
+$(OUTPUT)test-libzstd.bin:
331
+ $(BUILD) -lzstd
332
+
333
+$(OUTPUT)test-clang-bpf-co-re.bin:
334
+ $(CLANG) -S -g -target bpf -o - $(patsubst %.bin,%.c,$(@F)) | \
335
+ grep BTF_KIND_VAR
336
+
337
+$(OUTPUT)test-file-handle.bin:
338
+ $(BUILD)
339
+
340
+$(OUTPUT)test-libpfm4.bin:
341
+ $(BUILD) -lpfm
342
+
294343 ###############################
295344
296345 clean: