Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4a6d63e authored by Vishwath Mohan's avatar Vishwath Mohan
Browse files

Enable CFI for some media components.

Enables CFI locally for the following components:
   media/libmedia/
   media/libstagefright/codec2/
   media/libstagefright/codecs/aacdec/
   media/libstagefright/codecs/aacenc/
   media/libstagefright/codecs/amrwbenc/
   media/libstagefright/codecs/avc/common/
   media/libstagefright/codecs/avc/enc/
   media/libstagefright/codecs/avcdec/
   media/libstagefright/codecs/avcenc/
   media/libstagefright/codecs/flac/enc/
   media/libstagefright/codecs/g711/dec/
   media/libstagefright/codecs/gsm/dec/
   media/libstagefright/codecs/hevcdec/
   media/libstagefright/codecs/m4v_h263/dec/
   media/libstagefright/codecs/m4v_h263/enc/
   media/libstagefright/codecs/mp3dec/
   media/libstagefright/codecs/mpeg2dec/
   media/libstagefright/codecs/on2/dec/
   media/libstagefright/codecs/on2/enc/
   media/libstagefright/codecs/on2/h264dec/
   media/libstagefright/codecs/opus/dec/
   media/libstagefright/codecs/raw/
   media/libstagefright/http/
   media/libstagefright/httplive/
   media/libstagefright/omx/
   media/libstagefright/wifi-display/

Note that CFI is currently hidden under the global flag,
ENABLE_CFI=true. Unless this is set, local settings are not honored
and CFI will not be enabled. This allows CFI to essentially remain off
on all branches, but will allow it to be tested and debugged using
targeted builds.

Bug: 30227045
Test: m -j40 and device builds and boots
Test: CFI is not enabled unless built with ENABLE_CFI=true
Test: CFI enabled build passes the media CTS tests.
parent f3a8a239
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
    frameworks/av/media/libmedia/aidl

LOCAL_CFLAGS += -Werror -Wno-error=deprecated-declarations -Wall
LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow cfi
LOCAL_SANITIZE_DIAG := cfi

include $(BUILD_SHARED_LIBRARY)
+2 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ LOCAL_C_INCLUDES += \
LOCAL_MODULE:= libstagefright_codec2
LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow cfi
LOCAL_SANITIZE_DIAG := cfi

include $(BUILD_SHARED_LIBRARY)

+2 −1
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS :=

LOCAL_CFLAGS += -Werror
LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow
LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow cfi
LOCAL_SANITIZE_DIAG := cfi

LOCAL_STATIC_LIBRARIES := libFraunhoferAAC

+4 −2
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ ifeq ($(AAC_LIBRARY), fraunhofer)
  LOCAL_CFLAGS :=

  LOCAL_CFLAGS += -Werror
  LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow
  LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow cfi
  LOCAL_SANITIZE_DIAG := cfi

  LOCAL_STATIC_LIBRARIES := libFraunhoferAAC

@@ -130,7 +131,8 @@ else # visualon
  LOCAL_CFLAGS := -DOSCL_IMPORT_REF=

  LOCAL_CFLAGS += -Werror
  LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow
  LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow cfi
  LOCAL_SANITIZE_DIAG := cfi

  LOCAL_STATIC_LIBRARIES := \
          libstagefright_aacenc
+2 −1
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ LOCAL_C_INCLUDES := \
	frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Werror
LOCAL_SANITIZE := signed-integer-overflow
LOCAL_SANITIZE := signed-integer-overflow cfi
LOCAL_SANITIZE_DIAG := cfi

LOCAL_STATIC_LIBRARIES := \
        libstagefright_amrwbenc
Loading