#
# Makefile for some libs needed in the kernel.
#
ifdef [31mCONFIG_FUNCTION_TRACER[0m
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
endif
# These files are disabled because they produce lots of non-interesting and/or
# flaky coverage that is not a function of syscall inputs. For example,
# rbtree can be global and individual rotations don't correlate with inputs.
KCOV_INSTRUMENT_string.o := n
KCOV_INSTRUMENT_rbtree.o := n
KCOV_INSTRUMENT_list_debug.o := n
KCOV_INSTRUMENT_debugobjects.o := n
KCOV_INSTRUMENT_dynamic_debug.o := n
lib-y := ctype.o string.o vsprintf.o cmdline.o \
rbtree.o radix-tree.o dump_stack.o timerqueue.o\
idr.o int_sqrt.o extable.o \
sha1.o chacha20.o md5.o irq_regs.o argv_split.o \
flex_proportions.o ratelimit.o show_mem.o \
is_single_threaded.o plist.o decompress.o kobject_uevent.o \
earlycpio.o seq_buf.o nmi_backtrace.o nodemask.o win_minmax.o
lib-$([31mCONFIG_MMU[0m) += ioremap.o
lib-$([31mCONFIG_SMP[0m) += cpumask.o
lib-$([31mCONFIG_HAS_DMA[0m) += dma-noop.o
lib-y += kobject.o klist.o
obj-y += lockref.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o kasprintf.o bitmap.o scatterlist.o \
gcd.o lcm.o list_sort.o uuid.o flex_array.o iov_iter.o clz_ctz.o \
bsearch.o find_bit.o llist.o memweight.o kfifo.o \
percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o \
once.o
obj-y += string_helpers.o
obj-$([31mCONFIG_TEST_STRING_HELPERS[0m) += test-string_helpers.o
obj-y += hexdump.o
obj-$([31mCONFIG_TEST_HEXDUMP[0m) += test_hexdump.o
obj-y += kstrtox.o
obj-$([31mCONFIG_TEST_BPF[0m) += test_bpf.o
obj-$([31mCONFIG_TEST_FIRMWARE[0m) += test_firmware.o
obj-$([31mCONFIG_TEST_HASH[0m) += test_hash.o
obj-$([31mCONFIG_TEST_KASAN[0m) += test_kasan.o
obj-$([31mCONFIG_TEST_KSTRTOX[0m) += test-kstrtox.o
obj-$([31mCONFIG_TEST_LKM[0m) += test_module.o
obj-$([31mCONFIG_TEST_RHASHTABLE[0m) += test_rhashtable.o
obj-$([31mCONFIG_TEST_USER_COPY[0m) += test_user_copy.o
obj-$([31mCONFIG_TEST_STATIC_KEYS[0m) += test_static_keys.o
obj-$([31mCONFIG_TEST_STATIC_KEYS[0m) += test_static_key_base.o
obj-$([31mCONFIG_TEST_PRINTF[0m) += test_printf.o
obj-$([31mCONFIG_TEST_BITMAP[0m) += test_bitmap.o
obj-$([31mCONFIG_TEST_UUID[0m) += test_uuid.o
ifeq ($([31mCONFIG_DEBUG_KOBJECT[0m),y)
CFLAGS_kobject.o += -DDEBUG
CFLAGS_kobject_uevent.o += -DDEBUG
endif
obj-$([31mCONFIG_DEBUG_INFO_REDUCED[0m) += debug_info.o
CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any)
obj-$([31mCONFIG_GENERIC_IOMAP[0m) += iomap.o
obj-$([31mCONFIG_GENERIC_PCI_IOMAP[0m) += pci_iomap.o
obj-$([31mCONFIG_HAS_IOMEM[0m) += iomap_copy.o devres.o
obj-$([31mCONFIG_CHECK_SIGNATURE[0m) += check_signature.o
obj-$([31mCONFIG_DEBUG_LOCKING_API_SELFTESTS[0m) += locking-selftest.o
obj-$([31mCONFIG_GENERIC_HWEIGHT[0m) += hweight.o
obj-$([31mCONFIG_BTREE[0m) += btree.o
obj-$([31mCONFIG_INTERVAL_TREE[0m) += interval_tree.o
obj-$([31mCONFIG_ASSOCIATIVE_ARRAY[0m) += assoc_array.o
obj-$([31mCONFIG_DEBUG_PREEMPT[0m) += smp_processor_id.o
obj-$([31mCONFIG_DEBUG_LIST[0m) += list_debug.o
obj-$([31mCONFIG_DEBUG_OBJECTS[0m) += debugobjects.o
ifneq ($([31mCONFIG_HAVE_DEC_LOCK[0m),y)
lib-y += dec_and_lock.o
endif
obj-$([31mCONFIG_BITREVERSE[0m) += bitrev.o
obj-$([31mCONFIG_RATIONAL[0m) += rational.o
obj-$([31mCONFIG_CRC_CCITT[0m) += crc-ccitt.o
obj-$([31mCONFIG_CRC16[0m) += crc16.o
obj-$([31mCONFIG_CRC_T10DIF[0m)+= crc-t10dif.o
obj-$([31mCONFIG_CRC_ITU_T[0m) += crc-itu-t.o
obj-$([31mCONFIG_CRC32[0m) += crc32.o
obj-$([31mCONFIG_CRC7[0m) += crc7.o
obj-$([31mCONFIG_LIBCRC32C[0m) += libcrc32c.o
obj-$([31mCONFIG_CRC8[0m) += crc8.o
obj-$([31mCONFIG_GENERIC_ALLOCATOR[0m) += genalloc.o
obj-$([31mCONFIG_842_COMPRESS[0m) += 842/
obj-$([31mCONFIG_842_DECOMPRESS[0m) += 842/
obj-$([31mCONFIG_ZLIB_INFLATE[0m) += zlib_inflate/
obj-$([31mCONFIG_ZLIB_DEFLATE[0m) += zlib_deflate/
obj-$([31mCONFIG_REED_SOLOMON[0m) += reed_solomon/
obj-$([31mCONFIG_BCH[0m) += bch.o
obj-$([31mCONFIG_LZO_COMPRESS[0m) += lzo/
obj-$([31mCONFIG_LZO_DECOMPRESS[0m) += lzo/
obj-$([31mCONFIG_LZ4_COMPRESS[0m) += lz4/
obj-$([31mCONFIG_LZ4HC_COMPRESS[0m) += lz4/
obj-$([31mCONFIG_LZ4_DECOMPRESS[0m) += lz4/
obj-$([31mCONFIG_XZ_DEC[0m) += xz/
obj-$([31mCONFIG_RAID6_PQ[0m) += raid6/
lib-$([31mCONFIG_DECOMPRESS_GZIP[0m) += decompress_inflate.o
lib-$([31mCONFIG_DECOMPRESS_BZIP2[0m) += decompress_bunzip2.o
lib-$([31mCONFIG_DECOMPRESS_LZMA[0m) += decompress_unlzma.o
lib-$([31mCONFIG_DECOMPRESS_XZ[0m) += decompress_unxz.o
lib-$([31mCONFIG_DECOMPRESS_LZO[0m) += decompress_unlzo.o
lib-$([31mCONFIG_DECOMPRESS_LZ4[0m) += decompress_unlz4.o
obj-$([31mCONFIG_TEXTSEARCH[0m) += textsearch.o
obj-$([31mCONFIG_TEXTSEARCH_KMP[0m) += ts_kmp.o
obj-$([31mCONFIG_TEXTSEARCH_BM[0m) += ts_bm.o
obj-$([31mCONFIG_TEXTSEARCH_FSM[0m) += ts_fsm.o
obj-$([31mCONFIG_SMP[0m) += percpu_counter.o
obj-$([31mCONFIG_AUDIT_GENERIC[0m) += audit.o
obj-$([31mCONFIG_AUDIT_COMPAT_GENERIC[0m) += compat_audit.o
obj-$([31mCONFIG_SWIOTLB[0m) += swiotlb.o
obj-$([31mCONFIG_IOMMU_HELPER[0m) += iommu-helper.o iommu-common.o
obj-$([31mCONFIG_FAULT_INJECTION[0m) += fault-inject.o
obj-$([31mCONFIG_NOTIFIER_ERROR_INJECTION[0m) += notifier-error-inject.o
obj-$([31mCONFIG_PM_NOTIFIER_ERROR_INJECT[0m) += pm-notifier-error-inject.o
obj-$([31mCONFIG_NETDEV_NOTIFIER_ERROR_INJECT[0m) += netdev-notifier-error-inject.o
obj-$([31mCONFIG_MEMORY_NOTIFIER_ERROR_INJECT[0m) += memory-notifier-error-inject.o
obj-$([31mCONFIG_OF_RECONFIG_NOTIFIER_ERROR_INJECT[0m) += \
of-reconfig-notifier-error-inject.o
lib-$([31mCONFIG_GENERIC_BUG[0m) += bug.o
obj-$([31mCONFIG_HAVE_ARCH_TRACEHOOK[0m) += syscall.o
obj-$([31mCONFIG_DYNAMIC_DEBUG[0m) += dynamic_debug.o
obj-$([31mCONFIG_NLATTR[0m) += nlattr.o
obj-$([31mCONFIG_LRU_CACHE[0m) += lru_cache.o
obj-$([31mCONFIG_DMA_API_DEBUG[0m) += dma-debug.o
obj-$([31mCONFIG_GENERIC_CSUM[0m) += checksum.o
obj-$([31mCONFIG_GENERIC_ATOMIC64[0m) += atomic64.o
obj-$([31mCONFIG_ATOMIC64_SELFTEST[0m) += atomic64_test.o
obj-$([31mCONFIG_CPU_RMAP[0m) += cpu_rmap.o
obj-$([31mCONFIG_CORDIC[0m) += cordic.o
obj-$([31mCONFIG_DQL[0m) += dynamic_queue_limits.o
obj-$([31mCONFIG_GLOB[0m) += glob.o
obj-$([31mCONFIG_MPILIB[0m) += mpi/
obj-$([31mCONFIG_SIGNATURE[0m) += digsig.o
lib-$([31mCONFIG_CLZ_TAB[0m) += clz_tab.o
obj-$([31mCONFIG_DDR[0m) += jedec_ddr_data.o
obj-$([31mCONFIG_GENERIC_STRNCPY_FROM_USER[0m) += strncpy_from_user.o
obj-$([31mCONFIG_GENERIC_STRNLEN_USER[0m) += strnlen_user.o
obj-$([31mCONFIG_GENERIC_NET_UTILS[0m) += net_utils.o
obj-$([31mCONFIG_SG_SPLIT[0m) += sg_split.o
obj-$([31mCONFIG_SG_POOL[0m) += sg_pool.o
obj-$([31mCONFIG_STMP_DEVICE[0m) += stmp_device.o
obj-$([31mCONFIG_IRQ_POLL[0m) += irq_poll.o
obj-$([31mCONFIG_STACKDEPOT[0m) += stackdepot.o
KASAN_SANITIZE_stackdepot.o := n
KCOV_INSTRUMENT_stackdepot.o := n
libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
fdt_empty_tree.o
$(foreach file, $(libfdt_files), \
$(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
lib-$([31mCONFIG_LIBFDT[0m) += $(libfdt_files)
obj-$([31mCONFIG_RBTREE_TEST[0m) += rbtree_test.o
obj-$([31mCONFIG_INTERVAL_TREE_TEST[0m) += interval_tree_test.o
obj-$([31mCONFIG_PERCPU_TEST[0m) += percpu_test.o
obj-$([31mCONFIG_ASN1[0m) += asn1_decoder.o
obj-$([31mCONFIG_FONT_SUPPORT[0m) += fonts/
hostprogs-y := gen_crc32table
clean-files := crc32table.h
$(obj)/crc32.o: $(obj)/crc32table.h
quiet_cmd_crc32 = GEN $@
cmd_crc32 = $< > $@
$(obj)/crc32table.h: $(obj)/gen_crc32table
$(call cmd,crc32)
#
# Build a fast OID lookip registry from include/linux/oid_registry.h
#
obj-$([31mCONFIG_OID_REGISTRY[0m) += oid_registry.o
$(obj)/oid_registry.o: $(obj)/oid_registry_data.c
$(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
$(src)/build_OID_registry
$(call cmd,build_OID_registry)
quiet_cmd_build_OID_registry = GEN $@
cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
clean-files += oid_registry_data.c
obj-$([31mCONFIG_UCS2_STRING[0m) += ucs2_string.o
obj-$([31mCONFIG_UBSAN[0m) += ubsan.o
UBSAN_SANITIZE_ubsan.o := n
obj-$([31mCONFIG_SBITMAP[0m) += sbitmap.o