lh | 9ed821d | 2023-04-07 01:36:19 -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 |
xf.li | 742dd02 | 2023-06-08 01:43:32 -0700 | [diff] [blame] | 41 | ifeq ($(USE_OPTEE),yes) |
| 42 | libps_libs_nolto += $(wildcard $(LIBPS_PATH)/optee/*.a) |
| 43 | endif |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 44 | libps_libs_nolto += $(CROSS_COMPILE_LIB_KERNEL) |
| 45 | |
| 46 | libps_libs += $(libps_libs_nolto) |
| 47 | libps_libs += $(libps_libs_lto) |
| 48 | |
| 49 | ifeq ($(USE_ENABLE_LTO),yes) |
| 50 | |
| 51 | LTO_CFLAGS = -flto -fno-toplevel-reorder |
| 52 | # $(DISABLE_TL_REORDER) |
| 53 | LTO_FINAL_CFLAGS := -fuse-linker-plugin |
| 54 | |
| 55 | # would be needed to support < 5.0 |
| 56 | LTO_FINAL_CFLAGS += -fno-toplevel-reorder |
| 57 | |
| 58 | LTO_FINAL_CFLAGS += -flto=jobserver |
| 59 | |
| 60 | # don't compile everything twice |
| 61 | # requires plugin ar |
| 62 | LTO_CFLAGS += -fno-fat-lto-objects |
| 63 | |
| 64 | # Used to disable LTO for specific files (e.g. vdso) |
| 65 | DISABLE_LTO = -fno-lto |
| 66 | |
| 67 | # shut up lots of warnings for the compat syscalls |
| 68 | #LTO_CFLAGS += $(call cc-disable-warning,attribute-alias,) |
| 69 | |
| 70 | LTO_FINAL_CFLAGS += $(LTO_CFLAGS) -fwhole-program |
| 71 | |
| 72 | # most options are passed through implicitely in the LTO |
| 73 | # files per function, but not all. |
| 74 | # should not pass any that may need to be disabled for |
| 75 | # individual files. |
| 76 | #LTO_FINAL_CFLAGS += $(filter -pg,${KBUILD_CFLAGS}) |
| 77 | LTO_FINAL_CFLAGS += -fno-strict-aliasing |
| 78 | |
| 79 | #ifdef CONFIG_LTO_DEBUG |
| 80 | #LTO_FINAL_CFLAGS += -fdump-ipa-cgraph -fdump-ipa-inline-details |
| 81 | # add for debugging compiler crashes: |
| 82 | # LTO_FINAL_CFLAGS += -dH -save-temps |
| 83 | #endif |
| 84 | #ifdef CONFIG_LTO_CP_CLONE |
| 85 | #LTO_FINAL_CFLAGS += -fipa-cp-clone |
| 86 | #LTO_CFLAGS += -fipa-cp-clone |
| 87 | #endif |
| 88 | |
| 89 | else |
| 90 | |
| 91 | LTO_CFLAGS = |
| 92 | DISABLE_LTO = |
| 93 | LTO_FINAL_CFLAGS = |
| 94 | |
| 95 | endif |
| 96 | |
| 97 | CPKO_EXT_CFLAGS = |
| 98 | KERNEL_EXT_CFLAGS = |
| 99 | |
| 100 | ifeq ($(USE_TestHarness),yes) |
| 101 | CPKO_EXT_CFLAGS += -D_USE_TestHarness |
| 102 | endif |
| 103 | |
| 104 | ifeq ($(USE_VOICE_SUPPORT),yes) |
| 105 | CPKO_EXT_CFLAGS += -DUSE_VOICE_SUPPORT |
| 106 | endif |
| 107 | |
| 108 | ifeq ($(LIBC_TYPE),glibc) |
| 109 | CPKO_EXT_CFLAGS += -DUSE_GLIBC |
| 110 | endif |
| 111 | |
| 112 | ifeq ($(CONFIG_SINGLECORE),yes) |
| 113 | KERNEL_EXT_CFLAGS += -DCONFIG_SINGLECORE |
| 114 | endif |
| 115 | |
| 116 | ifeq ($(CONFIG_MEMCHECK),yes) |
| 117 | KERNEL_EXT_CFLAGS += -DCONFIG_MEM_CHECK |
| 118 | endif |
| 119 | |
| 120 | ifeq ($(CONFIG_KLOCWORK),yes) |
| 121 | KERNEL_EXT_CFLAGS += -DCONFIG_KLOCWORK |
| 122 | endif |
| 123 | |
| 124 | ifeq ($(USE_CAP_SYS),yes) |
| 125 | KERNEL_EXT_CFLAGS += -D_USE_CAP_SYS |
| 126 | endif |
| 127 | ifeq ($(USE_CAP_SYS),no) |
| 128 | KERNEL_EXT_CFLAGS += -DDDR_BASE_LEN_CAP=0 |
| 129 | KERNEL_EXT_CFLAGS += -DDDR_BASE_LEN_CAP_BUF=0 |
| 130 | endif |
| 131 | |
| 132 | ifeq ($(USE_VEHICLE_DC),yes) |
| 133 | KERNEL_EXT_CFLAGS += -D_USE_VEHICLE_DC |
| 134 | endif |
| 135 | |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 136 | ifeq ($(USE_VEHICLE_DC_REF),yes) |
| 137 | KERNEL_EXT_CFLAGS += -D_USE_VEHICLE_DC_REF |
jb.qi | 5532c6f | 2024-02-29 23:55:54 -0800 | [diff] [blame] | 138 | #jb.qi add for wifi config on 20240301 start |
| 139 | #KERNEL_EXT_CFLAGS += -D_USE_VEHICLE_DC_REF_MMC0 |
| 140 | #jb.qi add for wifi config on 20240301 end |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 141 | endif |
| 142 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 143 | KERNEL_EXT_CFLAGS += -DDDR_BASE_ADDR_LINUX_VA |
| 144 | |
| 145 | ifeq ($(USE_BTRUNK_SUPPORT),yes) |
| 146 | KERNEL_EXT_CFLAGS += -DBTRUNK_SUPPORT |
| 147 | endif |
| 148 | |
| 149 | KERNEL_EXT_CFLAGS += $(CPKO_EXT_CFLAGS) |
| 150 | |
| 151 | ifeq ($(USE_ZCAT_MBIM),yes) |
| 152 | KERNEL_EXT_CFLAGS += -D_USE_MBIM |
| 153 | endif |
| 154 | |
| 155 | ifeq ($(DCXO),yes) |
| 156 | KERNEL_EXT_CFLAGS += -DRFC_DCXO_EN |
| 157 | endif |
| 158 | |
| 159 | ifeq ($(RF_TYPE),220A1) |
| 160 | KERNEL_EXT_CFLAGS += -D_USE_RF_ZTE220A1 |
| 161 | endif |
| 162 | |
| 163 | ifeq ($(RF_TYPE),230A) |
| 164 | KERNEL_EXT_CFLAGS += -D_USE_RF_ZTE230A |
| 165 | endif |
| 166 | |
| 167 | ifeq ($(USE_DSDS_VSIM),yes) |
| 168 | KERNEL_EXT_CFLAGS += -DUSE_DSDS_VSIM |
| 169 | endif |
| 170 | |
| 171 | ifeq ($(USE_ZXIC_DEBUG_INFO),yes) |
| 172 | KERNEL_EXT_CFLAGS += -D_USE_ZXIC_DEBUG_INFO |
| 173 | endif |
| 174 | |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 175 | ifeq ($(MODEM_TYPE),lte_only) |
| 176 | KERNEL_EXT_CFLAGS += -D_USE_LTE_ONLY |
| 177 | endif |
| 178 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 179 | KERNEL_EXT_CFLAGS += -I$(PUB_ROOT_DIR)/include/infra |
| 180 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 181 | ifeq ($(ALSA_CODEC_IN_CAP),yes) |
| 182 | KERNEL_EXT_CFLAGS += -D_ALSA_CODEC_IN_CAP |
jb.qi | 5532c6f | 2024-02-29 23:55:54 -0800 | [diff] [blame] | 183 | endif |