summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AndroidBoot.mk18
-rw-r--r--QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf4
-rw-r--r--QcomModulePkg/Library/BootLib/BootLib.inf2
-rw-r--r--QcomModulePkg/Library/FastbootLib/FastbootLib.inf2
-rw-r--r--QcomModulePkg/Library/StackCanary/StackCanary.inf4
-rw-r--r--QcomModulePkg/Library/avb/AvbLib.inf4
-rw-r--r--QcomModulePkg/Library/zlib/zlib.inf3
-rw-r--r--makefile10
8 files changed, 34 insertions, 13 deletions
diff --git a/AndroidBoot.mk b/AndroidBoot.mk
index b377baf697..c9b3fca5d4 100644
--- a/AndroidBoot.mk
+++ b/AndroidBoot.mk
@@ -1,8 +1,15 @@
#Android makefile to build bootloader as a part of Android Build
-ifeq ($(shell echo $(SDCLANG_PATH) | head -c 1),/)
- CLANG_BIN := $(SDCLANG_PATH)/
-else
- CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH)/
+CLANG_BIN := $(ANDROID_BUILD_TOP)/$(LLVM_PREBUILTS_PATH)/
+ABL_USE_SDLLVM := false
+
+ifneq ($(wildcard $(SDCLANG_PATH)),)
+ ifeq ($(shell echo $(SDCLANG_PATH) | head -c 1),/)
+ CLANG_BIN := $(SDCLANG_PATH)/
+ else
+ CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH)/
+ endif
+
+ ABL_USE_SDLLVM := true
endif
ifneq ($(wildcard $(SDCLANG_PATH_2)),)
@@ -11,6 +18,8 @@ ifneq ($(wildcard $(SDCLANG_PATH_2)),)
else
CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH_2)/
endif
+
+ ABL_USE_SDLLVM := true
endif
ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
@@ -70,6 +79,7 @@ $(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET)
$(USER_BUILD_VARIANT) \
CLANG_BIN=$(CLANG_BIN) \
CLANG_PREFIX=$(CLANG35_PREFIX)\
+ ABL_USE_SDLLVM=$(ABL_USE_SDLLVM) \
CLANG_GCC_TOOLCHAIN=$(CLANG35_GCC_TOOLCHAIN)\
TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE)
diff --git a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf
index f3d261c5f8..3de623017e 100644
--- a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf
+++ b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf
@@ -1,5 +1,5 @@
#/* @file
-# Copyright (c) 2017, The Linux Foundation. All rights reserved.
+# Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
# Portions Copyright (c) 2011-2013, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
@@ -24,7 +24,7 @@
LinuxLoader.c
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = --compile-and-analyze $(BUILD_REPORT_DIR)
+ GCC:*_*_*_CC_FLAGS = $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
GCC:*_*_*_CC_FLAGS = $(UBSAN_UEFI_GCC_FLAG_UNDEFINED)
GCC:*_*_*_CC_FLAGS = $(UBSAN_UEFI_GCC_FLAG_ALIGNMENT)
diff --git a/QcomModulePkg/Library/BootLib/BootLib.inf b/QcomModulePkg/Library/BootLib/BootLib.inf
index 4910db2b11..8e6202e292 100644
--- a/QcomModulePkg/Library/BootLib/BootLib.inf
+++ b/QcomModulePkg/Library/BootLib/BootLib.inf
@@ -37,7 +37,7 @@
LIBRARY_CLASS = BootLib
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = -O2 --compile-and-analyze $(BUILD_REPORT_DIR)
+ GCC:*_*_*_CC_FLAGS = -O2 $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
GCC:*_*_*_CC_FLAGS = $(UBSAN_UEFI_GCC_FLAG_UNDEFINED)
GCC:*_*_*_CC_FLAGS = $(UBSAN_UEFI_GCC_FLAG_ALIGNMENT)
diff --git a/QcomModulePkg/Library/FastbootLib/FastbootLib.inf b/QcomModulePkg/Library/FastbootLib/FastbootLib.inf
index 1dda0042aa..b4968b4553 100644
--- a/QcomModulePkg/Library/FastbootLib/FastbootLib.inf
+++ b/QcomModulePkg/Library/FastbootLib/FastbootLib.inf
@@ -42,7 +42,7 @@
#
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = --compile-and-analyze $(BUILD_REPORT_DIR)
+ GCC:*_*_*_CC_FLAGS = $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
[Sources]
FastbootMain.c
diff --git a/QcomModulePkg/Library/StackCanary/StackCanary.inf b/QcomModulePkg/Library/StackCanary/StackCanary.inf
index 1013996580..6de63d28f5 100644
--- a/QcomModulePkg/Library/StackCanary/StackCanary.inf
+++ b/QcomModulePkg/Library/StackCanary/StackCanary.inf
@@ -40,8 +40,8 @@
StackCanary.c
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = -fno-stack-protector --compile-and-analyze $(BUILD_REPORT_DIR)
-
+ GCC:*_*_*_CC_FLAGS = -fno-stack-protector
+ GCC:*_*_*_CC_FLAGS = $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
[BuildOptions.ARM]
GCC:*_*_*_CC_FLAGS = -fno-stack-protector
diff --git a/QcomModulePkg/Library/avb/AvbLib.inf b/QcomModulePkg/Library/avb/AvbLib.inf
index d0a69ac8a1..9d6777af06 100644
--- a/QcomModulePkg/Library/avb/AvbLib.inf
+++ b/QcomModulePkg/Library/avb/AvbLib.inf
@@ -1,5 +1,5 @@
#/*
-# * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+# * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
# *
# * Redistribution and use in source and binary forms, with or without
# * modification, are permitted provided that the following conditions are
@@ -40,7 +40,7 @@
GCC:*_*_*_CC_FLAGS = -DAVB_COMPILATION -DAVB_ENABLE_DEBUG
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = --compile-and-analyze $(BUILD_REPORT_DIR)
+ GCC:*_*_*_CC_FLAGS = $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
[Sources]
libavb/avb_chain_partition_descriptor.c
diff --git a/QcomModulePkg/Library/zlib/zlib.inf b/QcomModulePkg/Library/zlib/zlib.inf
index 4ca0117508..b25af5821f 100644
--- a/QcomModulePkg/Library/zlib/zlib.inf
+++ b/QcomModulePkg/Library/zlib/zlib.inf
@@ -8,7 +8,8 @@
[BuildOptions.AARCH64]
- GCC:*_*_*_CC_FLAGS = -O2 -DZ_SOLO --compile-and-analyze $(BUILD_REPORT_DIR)
+ GCC:*_*_*_CC_FLAGS = -O2 -DZ_SOLO
+ GCC:*_*_*_CC_FLAGS = $(SDLLVM_COMPILE_ANALYZE) $(SDLLVM_ANALYZE_REPORT)
[Sources]
zutil.c
diff --git a/makefile b/makefile
index d36115f029..94a36cc4d5 100644
--- a/makefile
+++ b/makefile
@@ -55,6 +55,16 @@ else
ENABLE_LE_VARIANT := 0
endif
+ifeq "$(ABL_USE_SDLLVM)" "true"
+ SDLLVM_COMPILE_ANALYZE := --compile-and-analyze
+ SDLLVM_ANALYZE_REPORT := $(BUILD_REPORT_DIR)
+else
+ SDLLVM_COMPILE_ANALYZE :=
+ SDLLVM_ANALYZE_REPORT :=
+endif
+export SDLLVM_COMPILE_ANALYZE := $(SDLLVM_COMPILE_ANALYZE)
+export SDLLVM_ANALYZE_REPORT := $(SDLLVM_ANALYZE_REPORT)
+
.PHONY: all cleanall
all: ABL_FV_ELF