diff options
| -rw-r--r-- | core/Makefile | 11 | ||||
| -rw-r--r-- | core/clang/HOST_CROSS_x86.mk | 2 | ||||
| -rw-r--r-- | core/clang/HOST_x86.mk | 2 | ||||
| -rw-r--r-- | core/definitions.mk | 30 | ||||
| -rw-r--r-- | core/pdk_config.mk | 2 | ||||
| -rwxr-xr-x | tools/fs_config/fs_config_generator.py | 17 |
6 files changed, 41 insertions, 23 deletions
diff --git a/core/Makefile b/core/Makefile index d150ec3649..0d14c85219 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2058,17 +2058,6 @@ endif endif -# Convert to lower case without requiring a shell, which isn't cacheable. -to-lower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,\ -$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,\ -$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,\ -$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) -# Convert to upper case without requiring a shell, which isn't cacheable. -to-upper=$(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,\ -$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,\ -$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,\ -$(subst x,X,$(subst y,Y,$(subst z,Z,$1)))))))))))))))))))))))))) - # ----------------------------------------------------------------- # vbmeta image ifeq ($(BOARD_AVB_ENABLE),true) diff --git a/core/clang/HOST_CROSS_x86.mk b/core/clang/HOST_CROSS_x86.mk index bf48f955e9..ffd78119a6 100644 --- a/core/clang/HOST_CROSS_x86.mk +++ b/core/clang/HOST_CROSS_x86.mk @@ -1 +1 @@ -$(clang_2nd_arch_prefix)HOST_CROSS_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686.a +$(clang_2nd_arch_prefix)HOST_CROSS_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i386.a diff --git a/core/clang/HOST_x86.mk b/core/clang/HOST_x86.mk index 0722b2a6e7..28035173f0 100644 --- a/core/clang/HOST_x86.mk +++ b/core/clang/HOST_x86.mk @@ -1 +1 @@ -$(clang_2nd_arch_prefix)HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686.a +$(clang_2nd_arch_prefix)HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i386.a diff --git a/core/definitions.mk b/core/definitions.mk index 4eac01cce8..2f3f356558 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2601,11 +2601,12 @@ endef # define uncompress-dexs $(hide) if (zipinfo $@ '*.dex' 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \ - rm -rf $(dir $@)uncompresseddexs && mkdir $(dir $@)uncompresseddexs; \ - unzip -q $@ '*.dex' -d $(dir $@)uncompresseddexs && \ + tmpdir=$@.tmpdir; \ + rm -rf $$tmpdir && mkdir $$tmpdir; \ + unzip -q $@ '*.dex' -d $$tmpdir && \ zip -qd $@ '*.dex' && \ - ( cd $(dir $@)uncompresseddexs && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \ - rm -rf $(dir $@)uncompresseddexs; \ + ( cd $$tmpdir && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \ + rm -rf $$tmpdir; \ fi endef @@ -3475,3 +3476,24 @@ define get-numeric-sdk-version $(filter-out current,\ $(if $(call has-system-sdk-version,$(1)),$(patsubst system_%,%,$(1)),$(1))) endef + +# Convert to lower case without requiring a shell, which isn't cacheable. +to-lower=$(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) + +# Convert to upper case without requiring a shell, which isn't cacheable. +to-upper=$(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1)))))))))))))))))))))))))) + +# Sanity-check to-lower and to-upper +lower := abcdefghijklmnopqrstuvwxyz-_ +upper := ABCDEFGHIJKLMNOPQRSTUVWXYZ-_ + +ifneq ($(lower),$(call to-lower,$(upper))) + $(error to-lower sanity check failure) +endif + +ifneq ($(upper),$(call to-upper,$(lower))) + $(error to-upper sanity check failure) +endif + +lower := +upper := diff --git a/core/pdk_config.mk b/core/pdk_config.mk index c2f8b0a302..f29c3dc0a6 100644 --- a/core/pdk_config.mk +++ b/core/pdk_config.mk @@ -44,7 +44,7 @@ PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR := \ $(PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR) PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\ - $(lib_dir)/classes.jar $(lib_dir)/classes.jar.toc \ + $(lib_dir)/classes.jar $(lib_dir)/classes-header.jar \ $(lib_dir)/javalib.jar $(lib_dir)/classes*.dex \ $(lib_dir)/classes.dex.toc ) diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py index c8d1dd33a1..d51d075e0d 100755 --- a/tools/fs_config/fs_config_generator.py +++ b/tools/fs_config/fs_config_generator.py @@ -146,18 +146,27 @@ class AID(object): found (str): The file found in, not required to be specified. Raises: + ValueError: if the friendly name is longer than 31 characters as + that is bionic's internal buffer size for name. ValueError: if value is not a valid string number as processed by int(x, 0) """ self.identifier = identifier self.value = value self.found = found - self.normalized_value = str(int(value, 0)) + try: + self.normalized_value = str(int(value, 0)) + except ValueException: + raise ValueError('Invalid "value", not aid number, got: \"%s\"' % value) # Where we calculate the friendly name friendly = identifier[len(AID.PREFIX):].lower() self.friendly = AID._fixup_friendly(friendly) + if len(self.friendly) > 31: + raise ValueError('AID names must be under 32 characters "%s"' % self.friendly) + + def __eq__(self, other): return self.identifier == other.identifier \ @@ -639,10 +648,8 @@ class FSConfigFileParser(object): try: aid = AID(section_name, value, file_name) - except ValueError: - sys.exit( - error_message('Invalid "value", not aid number, got: \"%s\"' % - value)) + except ValueError as exception: + sys.exit(error_message(exception)) # Values must be within OEM range if not Utils.in_any_range(int(aid.value, 0), self._oem_ranges): |