Back to home page

LXR

 
 

    


0001 #
0002 # Makefile for some libs needed in the kernel.
0003 #
0004 
0005 ifdef CONFIG_FUNCTION_TRACER
0006 ORIG_CFLAGS := $(KBUILD_CFLAGS)
0007 KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
0008 endif
0009 
0010 # These files are disabled because they produce lots of non-interesting and/or
0011 # flaky coverage that is not a function of syscall inputs. For example,
0012 # rbtree can be global and individual rotations don't correlate with inputs.
0013 KCOV_INSTRUMENT_string.o := n
0014 KCOV_INSTRUMENT_rbtree.o := n
0015 KCOV_INSTRUMENT_list_debug.o := n
0016 KCOV_INSTRUMENT_debugobjects.o := n
0017 KCOV_INSTRUMENT_dynamic_debug.o := n
0018 
0019 lib-y := ctype.o string.o vsprintf.o cmdline.o \
0020          rbtree.o radix-tree.o dump_stack.o timerqueue.o\
0021          idr.o int_sqrt.o extable.o \
0022          sha1.o chacha20.o md5.o irq_regs.o argv_split.o \
0023          flex_proportions.o ratelimit.o show_mem.o \
0024          is_single_threaded.o plist.o decompress.o kobject_uevent.o \
0025          earlycpio.o seq_buf.o nmi_backtrace.o nodemask.o win_minmax.o
0026 
0027 lib-$(CONFIG_MMU) += ioremap.o
0028 lib-$(CONFIG_SMP) += cpumask.o
0029 lib-$(CONFIG_HAS_DMA) += dma-noop.o
0030 
0031 lib-y   += kobject.o klist.o
0032 obj-y   += lockref.o
0033 
0034 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
0035          bust_spinlocks.o kasprintf.o bitmap.o scatterlist.o \
0036          gcd.o lcm.o list_sort.o uuid.o flex_array.o iov_iter.o clz_ctz.o \
0037          bsearch.o find_bit.o llist.o memweight.o kfifo.o \
0038          percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o \
0039          once.o
0040 obj-y += string_helpers.o
0041 obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
0042 obj-y += hexdump.o
0043 obj-$(CONFIG_TEST_HEXDUMP) += test_hexdump.o
0044 obj-y += kstrtox.o
0045 obj-$(CONFIG_TEST_BPF) += test_bpf.o
0046 obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
0047 obj-$(CONFIG_TEST_HASH) += test_hash.o
0048 obj-$(CONFIG_TEST_KASAN) += test_kasan.o
0049 obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
0050 obj-$(CONFIG_TEST_LKM) += test_module.o
0051 obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o
0052 obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
0053 obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o
0054 obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o
0055 obj-$(CONFIG_TEST_PRINTF) += test_printf.o
0056 obj-$(CONFIG_TEST_BITMAP) += test_bitmap.o
0057 obj-$(CONFIG_TEST_UUID) += test_uuid.o
0058 
0059 ifeq ($(CONFIG_DEBUG_KOBJECT),y)
0060 CFLAGS_kobject.o += -DDEBUG
0061 CFLAGS_kobject_uevent.o += -DDEBUG
0062 endif
0063 
0064 obj-$(CONFIG_DEBUG_INFO_REDUCED) += debug_info.o
0065 CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any)
0066 
0067 obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
0068 obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o
0069 obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
0070 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
0071 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
0072 
0073 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
0074 
0075 obj-$(CONFIG_BTREE) += btree.o
0076 obj-$(CONFIG_INTERVAL_TREE) += interval_tree.o
0077 obj-$(CONFIG_ASSOCIATIVE_ARRAY) += assoc_array.o
0078 obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
0079 obj-$(CONFIG_DEBUG_LIST) += list_debug.o
0080 obj-$(CONFIG_DEBUG_OBJECTS) += debugobjects.o
0081 
0082 ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
0083   lib-y += dec_and_lock.o
0084 endif
0085 
0086 obj-$(CONFIG_BITREVERSE) += bitrev.o
0087 obj-$(CONFIG_RATIONAL)  += rational.o
0088 obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o
0089 obj-$(CONFIG_CRC16)     += crc16.o
0090 obj-$(CONFIG_CRC_T10DIF)+= crc-t10dif.o
0091 obj-$(CONFIG_CRC_ITU_T) += crc-itu-t.o
0092 obj-$(CONFIG_CRC32)     += crc32.o
0093 obj-$(CONFIG_CRC7)      += crc7.o
0094 obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
0095 obj-$(CONFIG_CRC8)      += crc8.o
0096 obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
0097 
0098 obj-$(CONFIG_842_COMPRESS) += 842/
0099 obj-$(CONFIG_842_DECOMPRESS) += 842/
0100 obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
0101 obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
0102 obj-$(CONFIG_REED_SOLOMON) += reed_solomon/
0103 obj-$(CONFIG_BCH) += bch.o
0104 obj-$(CONFIG_LZO_COMPRESS) += lzo/
0105 obj-$(CONFIG_LZO_DECOMPRESS) += lzo/
0106 obj-$(CONFIG_LZ4_COMPRESS) += lz4/
0107 obj-$(CONFIG_LZ4HC_COMPRESS) += lz4/
0108 obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/
0109 obj-$(CONFIG_XZ_DEC) += xz/
0110 obj-$(CONFIG_RAID6_PQ) += raid6/
0111 
0112 lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
0113 lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
0114 lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
0115 lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o
0116 lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
0117 lib-$(CONFIG_DECOMPRESS_LZ4) += decompress_unlz4.o
0118 
0119 obj-$(CONFIG_TEXTSEARCH) += textsearch.o
0120 obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
0121 obj-$(CONFIG_TEXTSEARCH_BM) += ts_bm.o
0122 obj-$(CONFIG_TEXTSEARCH_FSM) += ts_fsm.o
0123 obj-$(CONFIG_SMP) += percpu_counter.o
0124 obj-$(CONFIG_AUDIT_GENERIC) += audit.o
0125 obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o
0126 
0127 obj-$(CONFIG_SWIOTLB) += swiotlb.o
0128 obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o iommu-common.o
0129 obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
0130 obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
0131 obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o
0132 obj-$(CONFIG_NETDEV_NOTIFIER_ERROR_INJECT) += netdev-notifier-error-inject.o
0133 obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o
0134 obj-$(CONFIG_OF_RECONFIG_NOTIFIER_ERROR_INJECT) += \
0135         of-reconfig-notifier-error-inject.o
0136 
0137 lib-$(CONFIG_GENERIC_BUG) += bug.o
0138 
0139 obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
0140 
0141 obj-$(CONFIG_DYNAMIC_DEBUG) += dynamic_debug.o
0142 
0143 obj-$(CONFIG_NLATTR) += nlattr.o
0144 
0145 obj-$(CONFIG_LRU_CACHE) += lru_cache.o
0146 
0147 obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o
0148 
0149 obj-$(CONFIG_GENERIC_CSUM) += checksum.o
0150 
0151 obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o
0152 
0153 obj-$(CONFIG_ATOMIC64_SELFTEST) += atomic64_test.o
0154 
0155 obj-$(CONFIG_CPU_RMAP) += cpu_rmap.o
0156 
0157 obj-$(CONFIG_CORDIC) += cordic.o
0158 
0159 obj-$(CONFIG_DQL) += dynamic_queue_limits.o
0160 
0161 obj-$(CONFIG_GLOB) += glob.o
0162 
0163 obj-$(CONFIG_MPILIB) += mpi/
0164 obj-$(CONFIG_SIGNATURE) += digsig.o
0165 
0166 lib-$(CONFIG_CLZ_TAB) += clz_tab.o
0167 
0168 obj-$(CONFIG_DDR) += jedec_ddr_data.o
0169 
0170 obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
0171 obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o
0172 
0173 obj-$(CONFIG_GENERIC_NET_UTILS) += net_utils.o
0174 
0175 obj-$(CONFIG_SG_SPLIT) += sg_split.o
0176 obj-$(CONFIG_SG_POOL) += sg_pool.o
0177 obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
0178 obj-$(CONFIG_IRQ_POLL) += irq_poll.o
0179 
0180 obj-$(CONFIG_STACKDEPOT) += stackdepot.o
0181 KASAN_SANITIZE_stackdepot.o := n
0182 KCOV_INSTRUMENT_stackdepot.o := n
0183 
0184 libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
0185                fdt_empty_tree.o
0186 $(foreach file, $(libfdt_files), \
0187         $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
0188 lib-$(CONFIG_LIBFDT) += $(libfdt_files)
0189 
0190 obj-$(CONFIG_RBTREE_TEST) += rbtree_test.o
0191 obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
0192 
0193 obj-$(CONFIG_PERCPU_TEST) += percpu_test.o
0194 
0195 obj-$(CONFIG_ASN1) += asn1_decoder.o
0196 
0197 obj-$(CONFIG_FONT_SUPPORT) += fonts/
0198 
0199 hostprogs-y     := gen_crc32table
0200 clean-files     := crc32table.h
0201 
0202 $(obj)/crc32.o: $(obj)/crc32table.h
0203 
0204 quiet_cmd_crc32 = GEN     $@
0205       cmd_crc32 = $< > $@
0206 
0207 $(obj)/crc32table.h: $(obj)/gen_crc32table
0208         $(call cmd,crc32)
0209 
0210 #
0211 # Build a fast OID lookip registry from include/linux/oid_registry.h
0212 #
0213 obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
0214 
0215 $(obj)/oid_registry.o: $(obj)/oid_registry_data.c
0216 
0217 $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
0218                             $(src)/build_OID_registry
0219         $(call cmd,build_OID_registry)
0220 
0221 quiet_cmd_build_OID_registry = GEN     $@
0222       cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
0223 
0224 clean-files     += oid_registry_data.c
0225 
0226 obj-$(CONFIG_UCS2_STRING) += ucs2_string.o
0227 obj-$(CONFIG_UBSAN) += ubsan.o
0228 
0229 UBSAN_SANITIZE_ubsan.o := n
0230 
0231 obj-$(CONFIG_SBITMAP) += sbitmap.o