yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | |
| 2 | ifeq ($(DCXO), yes) |
| 3 | LIBPS_PATH=$(LIB_DIR)/libps/$(RF_TYPE)_$(MODEM_TYPE)_dcxo |
| 4 | else |
| 5 | LIBPS_PATH=$(LIB_DIR)/libps/$(RF_TYPE)_$(MODEM_TYPE) |
| 6 | endif |
| 7 | |
| 8 | libps_libs = |
| 9 | libps_libs_lto = |
| 10 | libps_libs_nolto = |
| 11 | ifneq ($(USE_CPPS_KO),yes) |
| 12 | libps_libs_nolto += $(LIBPS_PATH)/appstart/appstart.o |
| 13 | endif |
| 14 | |
| 15 | |
| 16 | libps_libs_nolto += $(LIBPS_PATH)/appstart/appstart.a |
| 17 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/gsml1/*.a) |
| 18 | |
| 19 | ifeq ($(USE_ENABLE_LTO),yes) |
| 20 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/plat/*.o) |
| 21 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/drv/*.o) |
| 22 | libps_libs_nolto += $(LIBPS_PATH)/drv/audio_process.a |
| 23 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/phy/*.o) |
| 24 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/tools/*.o) |
| 25 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/amt/*.o) |
| 26 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/ref/*.o) |
| 27 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/ps/*.o) |
| 28 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/psbase/*.o) |
| 29 | libps_libs_lto += $(wildcard $(LIBPS_PATH)/usat/*.o) |
| 30 | else |
| 31 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/plat/*.a) |
| 32 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/drv/*.a) |
| 33 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/phy/*.a) |
| 34 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/tools/*.a) |
| 35 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/amt/*.a) |
| 36 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/ref/*.a) |
| 37 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/ps/*.a) |
| 38 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/psbase/*.a) |
| 39 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/usat/*.a) |
| 40 | endif |
| 41 | |
| 42 | libps_libs_nolto += $(CROSS_COMPILE_LIB) |
| 43 | |
| 44 | libps_libs += $(libps_libs_nolto) |
| 45 | libps_libs += $(libps_libs_lto) |
| 46 | |
| 47 | ifeq ($(USE_ENABLE_LTO),yes) |
| 48 | |
| 49 | LTO_CFLAGS = -flto -fno-toplevel-reorder |
| 50 | # $(DISABLE_TL_REORDER) |
| 51 | LTO_FINAL_CFLAGS := -fuse-linker-plugin |
| 52 | |
| 53 | # would be needed to support < 5.0 |
| 54 | LTO_FINAL_CFLAGS += -fno-toplevel-reorder |
| 55 | |
| 56 | LTO_FINAL_CFLAGS += -flto=jobserver |
| 57 | |
| 58 | # don't compile everything twice |
| 59 | # requires plugin ar |
| 60 | LTO_CFLAGS += -fno-fat-lto-objects |
| 61 | |
| 62 | # Used to disable LTO for specific files (e.g. vdso) |
| 63 | DISABLE_LTO = -fno-lto |
| 64 | |
| 65 | # shut up lots of warnings for the compat syscalls |
| 66 | #LTO_CFLAGS += $(call cc-disable-warning,attribute-alias,) |
| 67 | |
| 68 | LTO_FINAL_CFLAGS += $(LTO_CFLAGS) -fwhole-program |
| 69 | |
| 70 | # most options are passed through implicitely in the LTO |
| 71 | # files per function, but not all. |
| 72 | # should not pass any that may need to be disabled for |
| 73 | # individual files. |
| 74 | #LTO_FINAL_CFLAGS += $(filter -pg,${KBUILD_CFLAGS}) |
| 75 | LTO_FINAL_CFLAGS += -fno-strict-aliasing |
| 76 | |
| 77 | #ifdef CONFIG_LTO_DEBUG |
| 78 | #LTO_FINAL_CFLAGS += -fdump-ipa-cgraph -fdump-ipa-inline-details |
| 79 | # add for debugging compiler crashes: |
| 80 | # LTO_FINAL_CFLAGS += -dH -save-temps |
| 81 | #endif |
| 82 | #ifdef CONFIG_LTO_CP_CLONE |
| 83 | #LTO_FINAL_CFLAGS += -fipa-cp-clone |
| 84 | #LTO_CFLAGS += -fipa-cp-clone |
| 85 | #endif |
| 86 | |
| 87 | else |
| 88 | |
| 89 | LTO_CFLAGS = |
| 90 | DISABLE_LTO = |
| 91 | LTO_FINAL_CFLAGS = |
| 92 | |
| 93 | endif |
| 94 | |
| 95 | CPKO_EXT_CFLAGS = |
| 96 | KERNEL_EXT_CFLAGS = |
| 97 | |
| 98 | ifeq ($(USE_TestHarness),yes) |
| 99 | CPKO_EXT_CFLAGS += -D_USE_TestHarness |
| 100 | endif |
| 101 | |
| 102 | ifeq ($(USE_VOICE_SUPPORT),yes) |
| 103 | CPKO_EXT_CFLAGS += -DUSE_VOICE_SUPPORT |
| 104 | endif |
| 105 | |
| 106 | ifeq ($(CONFIG_SINGLECORE),yes) |
| 107 | KERNEL_EXT_CFLAGS += -DCONFIG_SINGLECORE |
| 108 | endif |
| 109 | |
| 110 | ifeq ($(CONFIG_MEMCHECK),yes) |
| 111 | KERNEL_EXT_CFLAGS += -DCONFIG_MEM_CHECK |
| 112 | endif |
| 113 | |
| 114 | ifeq ($(CONFIG_KLOCWORK),yes) |
| 115 | KERNEL_EXT_CFLAGS += -DCONFIG_KLOCWORK |
| 116 | endif |
| 117 | |
| 118 | ifeq ($(USE_CAP_SYS),yes) |
| 119 | KERNEL_EXT_CFLAGS += -D_USE_CAP_SYS |
| 120 | endif |
| 121 | ifeq ($(USE_CAP_SYS),no) |
| 122 | KERNEL_EXT_CFLAGS += -DDDR_BASE_LEN_CAP=0 |
| 123 | KERNEL_EXT_CFLAGS += -DDDR_BASE_LEN_CAP_BUF=0 |
| 124 | endif |
| 125 | |
| 126 | KERNEL_EXT_CFLAGS += -DDDR_BASE_ADDR_LINUX_VA |
| 127 | |
| 128 | ifeq ($(USE_BTRUNK_SUPPORT),yes) |
| 129 | KERNEL_EXT_CFLAGS += -DBTRUNK_SUPPORT |
| 130 | endif |
| 131 | |
| 132 | KERNEL_EXT_CFLAGS += $(CPKO_EXT_CFLAGS) |
| 133 | |
| 134 | ifeq ($(USE_ZCAT_MBIM),yes) |
| 135 | KERNEL_EXT_CFLAGS += -D_USE_MBIM |
| 136 | endif |
| 137 | |
| 138 | ifeq ($(DCXO),yes) |
| 139 | KERNEL_EXT_CFLAGS += -DRFC_DCXO_EN |
| 140 | endif |
| 141 | |
| 142 | ifeq ($(RF_TYPE),220A1) |
| 143 | KERNEL_EXT_CFLAGS += -D_USE_RF_ZTE220A1 |
| 144 | endif |
| 145 | |
| 146 | ifeq ($(RF_TYPE),230A) |
| 147 | KERNEL_EXT_CFLAGS += -D_USE_RF_ZTE230A |
| 148 | endif |
| 149 | |
| 150 | ifeq ($(MODEM_TYPE),lte_only) |
| 151 | KERNEL_EXT_CFLAGS += -D_USE_LTE_ONLY |
| 152 | endif |