diff options
-rw-r--r-- | core/base_rules.mk | 2 | ||||
-rw-r--r-- | core/build-system.html | 6 | ||||
-rw-r--r-- | core/combo/TARGET_linux-aarch64.mk | 31 | ||||
-rw-r--r-- | core/combo/TARGET_linux-arm.mk | 2 | ||||
-rw-r--r-- | core/combo/TARGET_linux-mips.mk | 11 | ||||
-rwxr-xr-x | core/combo/TARGET_linux-x86.mk | 31 | ||||
-rwxr-xr-x | core/combo/TARGET_linux-x86_64.mk | 25 | ||||
-rw-r--r-- | core/combo/include/arch/windows/AndroidConfig.h | 20 | ||||
-rw-r--r-- | core/config.mk | 3 | ||||
-rw-r--r-- | core/llvm_config.mk | 1 | ||||
-rw-r--r-- | core/main.mk | 2 | ||||
-rw-r--r-- | target/board/generic/BoardConfig.mk | 3 | ||||
-rw-r--r-- | target/board/generic/sepolicy/domain.te | 2 | ||||
-rw-r--r-- | target/board/generic/sepolicy/surfaceflinger.te | 1 | ||||
-rw-r--r-- | target/product/embedded.mk | 2 |
15 files changed, 65 insertions, 77 deletions
diff --git a/core/base_rules.mk b/core/base_rules.mk index 36f36c1..783524d 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -75,7 +75,7 @@ endif # Only the tags mentioned in this test are expected to be set by module # makefiles. Anything else is either a typo or a source of unexpected # behaviors. -ifneq ($(filter-out debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),) +ifneq ($(filter-out debug eng tests optional samples,$(LOCAL_MODULE_TAGS)),) $(warning unusual tags $(LOCAL_MODULE_TAGS) on $(LOCAL_MODULE) at $(LOCAL_PATH)) endif diff --git a/core/build-system.html b/core/build-system.html index 760589a..397eef4 100644 --- a/core/build-system.html +++ b/core/build-system.html @@ -247,7 +247,6 @@ for these). for <code>eng</code>. <ul> <li>Installs modules tagged with: <code>eng</code>, <code>debug</code>, - <code>shell_</code>$(TARGET_SHELL), <code>user</code>, and/or <code>development</code>. <li>Installs non-APK modules that have no tags specified. <li>Installs APKs according to the product definition files, in @@ -267,7 +266,7 @@ for these). <p> This is the flavor intended to be the final release bits. <ul> - <li>Installs modules tagged with <code>shell_</code>$(TARGET_SHELL) and <code>user</code>. + <li>Installs modules tagged with <code>user</code>. <li>Installs non-APK modules that have no tags specified. <li>Installs APKs according to the product definition files; tags are ignored for APK modules. @@ -674,8 +673,7 @@ up.</p> <h4>LOCAL_MODULE_TAGS</h4> <p>Set <code>LOCAL_MODULE_TAGS</code> to any number of whitespace-separated tags. If the tag list is empty or contains <code>droid</code>, the module -will get installed as part of a <code>make droid</code>. Modules with the tag -<code>shell_</code>$(TARGET_SHELL) will also be installed. Otherwise, it will +will get installed as part of a <code>make droid</code>. Otherwise, it will only get installed by running <code>make <your-module></code> or with the <code>make all</code> pseudotarget.</p> diff --git a/core/combo/TARGET_linux-aarch64.mk b/core/combo/TARGET_linux-aarch64.mk index 20be4c2..49cf9c0 100644 --- a/core/combo/TARGET_linux-aarch64.mk +++ b/core/combo/TARGET_linux-aarch64.mk @@ -45,6 +45,9 @@ ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) $(error Unknown ARM architecture version: $(TARGET_ARCH_VARIANT)) endif +# TODO: Enable Clang when aarch64 prebuilt is added +WITHOUT_CLANG := true + include $(TARGET_ARCH_SPECIFIC_MAKEFILE) # You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else @@ -101,10 +104,10 @@ TARGET_GLOBAL_CFLAGS += -fno-strict-volatile-bitfields # TARGET_GLOBAL_CFLAGS += -Wno-psabi +# TODO - temporarily remove "-Wl,-z,relro -Wl,-z,now" as they cause segmentation fault on the +# v8 foundation model. TARGET_GLOBAL_LDFLAGS += \ -Wl,-z,noexecstack \ - -Wl,-z,relro \ - -Wl,-z,now \ -Wl,--warn-shared-textrel \ -Wl,--fatal-warnings \ $(arch_variant_ldflags) @@ -125,6 +128,8 @@ libm_root := bionic/libm libstdc++_root := bionic/libstdc++ libthread_db_root := bionic/libthread_db +TARGET_LIBGCC := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ + -print-libgcc-file-name) # unless CUSTOM_KERNEL_HEADERS is defined, we're going to use # symlinks located in out/ to point to the appropriate kernel @@ -133,11 +138,13 @@ libthread_db_root := bionic/libthread_db ifneq ($(CUSTOM_KERNEL_HEADERS),) KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS) KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS) + KERNEL_HEADERS_AUX := $(CUSTOM_KERNEL_HEADERS) else - KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common - KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH) + KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi + KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-$(TARGET_ARCH) + KERNEL_HEADERS_AUX := $(libc_root)/kernel/common endif -KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) +KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) $(KERNEL_HEADERS_AUX) TARGET_C_INCLUDES := \ $(libc_root)/arch-aarch64/include \ @@ -148,14 +155,12 @@ TARGET_C_INCLUDES := \ $(libm_root)/include/aarch64 \ $(libthread_db_root)/include -# FIXME -# CRT* objects to be added later -TARGET_CRTBEGIN_STATIC_O := -TARGET_CRTBEGIN_DYNAMIC_O := -TARGET_CRTEND_O := +TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o +TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o +TARGET_CRTEND_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o -TARGET_CRTBEGIN_SO_O := -TARGET_CRTEND_SO_O := +TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o +TARGET_CRTEND_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o TARGET_STRIP_MODULE:=true @@ -211,7 +216,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \ endef define transform-o-to-static-executable-inner -$(hide) $(PRIVATE_CXX) -Bstatic \ +$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \ -o $@ \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_STATIC_O)) \ diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index 8d012f3..6fbb778 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -35,7 +35,7 @@ TARGET_ARCH_VARIANT := armv5te endif ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),) -TARGET_GCC_VERSION := 4.7 +TARGET_GCC_VERSION := 4.8 else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk index ba6e8cd..99ea022 100644 --- a/core/combo/TARGET_linux-mips.mk +++ b/core/combo/TARGET_linux-mips.mk @@ -35,7 +35,7 @@ TARGET_ARCH_VARIANT := mips32r2-fp endif ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),) -TARGET_GCC_VERSION := 4.7 +TARGET_GCC_VERSION := 4.8 else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif @@ -99,7 +99,7 @@ TARGET_GLOBAL_CFLAGS += \ # This warning causes dalvik not to build with gcc 4.6+ and -Werror. # We cannot turn it off blindly since the option is not available # in gcc-4.4.x. -ifneq ($(filter 4.6 4.6.% 4.7 4.7.%, $(TARGET_GCC_VERSION)),) +ifneq ($(filter 4.6 4.6.% 4.7 4.7.% 4.8, $(TARGET_GCC_VERSION)),) TARGET_GLOBAL_CFLAGS += -Wno-unused-but-set-variable \ -fno-strict-volatile-bitfields endif @@ -194,10 +194,11 @@ ifneq ($(CUSTOM_KERNEL_HEADERS),) KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS) KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS) else - KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common - KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH) + KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi + KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-$(TARGET_ARCH) + KERNEL_HEADERS_AUX := $(libc_root)/kernel/common endif -KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) +KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) $(KERNEL_HEADERS_AUX) TARGET_C_INCLUDES := \ $(libc_root)/arch-mips/include \ diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index dfd463f..b7a16d6 100755 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -23,7 +23,7 @@ TARGET_ARCH_VARIANT := x86 endif ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),) -TARGET_GCC_VERSION := 4.7 +TARGET_GCC_VERSION := 4.8 else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif @@ -110,10 +110,11 @@ ifneq ($(CUSTOM_KERNEL_HEADERS),) KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS) KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS) else - KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common - KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH) + KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi + KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-$(TARGET_ARCH) + KERNEL_HEADERS_AUX := $(libc_root)/kernel/common endif -KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) +KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) $(KERNEL_HEADERS_AUX) android_config_h := $(call select-android-config-h,target_linux-x86) @@ -138,15 +139,7 @@ TARGET_GLOBAL_CFLAGS += \ -include $(android_config_h) \ -I $(dir $(android_config_h)) -# XXX: Not sure this is still needed. Must check with our toolchains. -TARGET_GLOBAL_CPPFLAGS += \ - -fno-use-cxa-atexit - TARGET_GLOBAL_CFLAGS += $(arch_variant_cflags) -TARGET_GLOBAL_CFLAGS += -mmmx -TARGET_GLOBAL_CFLAGS += -msse -TARGET_GLOBAL_CFLAGS += -DUSE_SSE2 -msse2 -TARGET_GLOBAL_CFLAGS += -msse3 ifeq ($(ARCH_X86_HAVE_SSSE3),true) # yes, really SSSE3, not SSE3! TARGET_GLOBAL_CFLAGS += -DUSE_SSSE3 -mssse3 @@ -167,24 +160,12 @@ ifeq ($(ARCH_X86_HAVE_AES_NI),true) TARGET_GLOBAL_CFLAGS += -maes endif -# XXX: This flag is probably redundant. I believe our toolchain always sets -# it by default. Consider for removal. -# -TARGET_GLOBAL_CFLAGS += -mbionic - -# XXX: This flag is probably redundant. The macro should be defined by our -# toolchain binaries automatically (as a compiler built-in). -# Check with: $BINPREFIX-gcc -dM -E < /dev/null -# -# Consider for removal. -# -TARGET_GLOBAL_CFLAGS += -D__ANDROID__ - TARGET_GLOBAL_LDFLAGS += -m32 TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack TARGET_GLOBAL_LDFLAGS += -Wl,-z,relro -Wl,-z,now TARGET_GLOBAL_LDFLAGS += -Wl,--warn-shared-textrel +TARGET_GLOBAL_LDFLAGS += -Wl,--fatal-warnings TARGET_GLOBAL_LDFLAGS += -Wl,--gc-sections TARGET_C_INCLUDES := \ diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index 86d29f5..9bb5724 100755 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -110,8 +110,8 @@ ifneq ($(CUSTOM_KERNEL_HEADERS),) KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS) KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS) else - KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common - KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH) + KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi + KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-x86 # x86 covers both x86 and x86_64. endif KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) @@ -138,13 +138,7 @@ android_config_h := $(call select-android-config-h,target_linux-x86) TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h)) TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS) -# XXX: Not sure this is still needed. Must check with our toolchains. -TARGET_GLOBAL_CPPFLAGS += \ - -fno-use-cxa-atexit - -TARGET_GLOBAL_CFLAGS += $(arch_variant_cflags) \ - -mstackrealign \ - -mfpmath=sse +TARGET_GLOBAL_CFLAGS += $(arch_variant_cflags) ifeq ($(ARCH_X86_HAVE_SSSE3),true) # yes, really SSSE3, not SSE3! TARGET_GLOBAL_CFLAGS += -DUSE_SSSE3 -mssse3 @@ -165,19 +159,6 @@ ifeq ($(ARCH_X86_HAVE_AES_NI),true) TARGET_GLOBAL_CFLAGS += -maes endif -# XXX: This flag is probably redundant. I believe our toolchain always sets -# it by default. Consider for removal. -# -TARGET_GLOBAL_CFLAGS += -mbionic - -# XXX: This flag is probably redundant. The macro should be defined by our -# toolchain binaries automatically (as a compiler built-in). -# Check with: $BINPREFIX-gcc -dM -E < /dev/null -# -# Consider for removal. -# -TARGET_GLOBAL_CFLAGS += -D__ANDROID__ - TARGET_GLOBAL_LDFLAGS += -m64 TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h index 83d0a0f..0a52674 100644 --- a/core/combo/include/arch/windows/AndroidConfig.h +++ b/core/combo/include/arch/windows/AndroidConfig.h @@ -15,7 +15,7 @@ */ /* - * Android config -- "CYGWIN_NT-5.1". + * Android config -- "CYGWIN_NT-5.1". * * Cygwin has pthreads, but GDB seems to get confused if you use it to * create threads. By "confused", I mean it freezes up the first time the @@ -37,6 +37,24 @@ * comments. */ +/* MingW doesn't define __BEGIN_DECLS / __END_DECLS. */ + +#ifndef __BEGIN_DECLS +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# else +# define __BEGIN_DECLS +# endif +#endif + +#ifndef __END_DECLS +# ifdef __cplusplus +# define __END_DECLS } +# else +# define __END_DECLS +# endif +#endif + /* * Threading model. Choose one: * diff --git a/core/config.mk b/core/config.mk index b6111f2..67ca243 100644 --- a/core/config.mk +++ b/core/config.mk @@ -114,9 +114,6 @@ TARGET_ERROR_FLAGS := -Werror=return-type -Werror=non-virtual-dtor -Werror=addre # TODO: do symbol compression TARGET_COMPRESS_MODULE_SYMBOLS := false -# Default shell is mksh. Other possible value is ash. -TARGET_SHELL := mksh - # ############################################################### # Include sub-configuration files # ############################################################### diff --git a/core/llvm_config.mk b/core/llvm_config.mk index b870558..19fe790 100644 --- a/core/llvm_config.mk +++ b/core/llvm_config.mk @@ -71,6 +71,7 @@ ifeq ($(TARGET_ARCH),x86) RS_TRIPLE := i686-unknown-linux CLANG_CONFIG_EXTRA_ASFLAGS += \ -target i686-linux-android \ + -msse3 \ -nostdlibinc \ -B$(TARGET_TOOLCHAIN_ROOT)/x86_64-linux-android/bin CLANG_CONFIG_EXTRA_CFLAGS += $(CLANG_CONFIG_EXTRA_ASFLAGS) diff --git a/core/main.mk b/core/main.mk index d424b25..eac2a01 100644 --- a/core/main.mk +++ b/core/main.mk @@ -622,12 +622,10 @@ tests_MODULES := $(sort \ # TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES # and get rid of it from this list. -# TODO: The shell is chosen by magic. Do we still need this? modules_to_install := $(sort \ $(ALL_DEFAULT_INSTALLED_MODULES) \ $(product_FILES) \ $(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \ - $(call get-tagged-modules, shell_$(TARGET_SHELL)) \ $(CUSTOM_MODULES) \ ) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 60decfb..8f698ec 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -74,3 +74,6 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true + +BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy +BOARD_SEPOLICY_UNION += domain.te surfaceflinger.te diff --git a/target/board/generic/sepolicy/domain.te b/target/board/generic/sepolicy/domain.te new file mode 100644 index 0000000..f026100 --- /dev/null +++ b/target/board/generic/sepolicy/domain.te @@ -0,0 +1,2 @@ +# For /sys/qemu_trace files in the emulator. +allow domain sysfs_writable:file rw_file_perms; diff --git a/target/board/generic/sepolicy/surfaceflinger.te b/target/board/generic/sepolicy/surfaceflinger.te new file mode 100644 index 0000000..9523630 --- /dev/null +++ b/target/board/generic/sepolicy/surfaceflinger.te @@ -0,0 +1 @@ +allow surfaceflinger self:process execmem; diff --git a/target/product/embedded.mk b/target/product/embedded.mk index 11e02ae..ac5bac3 100644 --- a/target/product/embedded.mk +++ b/target/product/embedded.mk @@ -61,9 +61,11 @@ PRODUCT_PACKAGES += \ linker \ logcat \ logwrapper \ + mkshrc \ reboot \ service \ servicemanager \ + sh \ surfaceflinger \ toolbox |