X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Makefile.flags;h=307afa7f521207de5defad823cd07c554b1c7102;hb=HEAD;hp=f5f446598598b781c4c600d4151cba3aa7bca3c2;hpb=ca81a937225714f75157eb596d90255243ae2e29;p=platform%2Fupstream%2Fbusybox.git diff --git a/Makefile.flags b/Makefile.flags index f5f4465..307afa7 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -53,6 +53,9 @@ CFLAGS += $(call cc-option,-fno-builtin-strlen -finline-limit=0 -fomit-frame-poi CFLAGS += $(call cc-option,-fno-guess-branch-probability,) CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,) CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,) +# Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary): +CFLAGS += $(call cc-option,-fno-unwind-tables,) +CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,) # FIXME: These warnings are at least partially to be concerned about and should # be fixed.. @@ -75,6 +78,12 @@ ARCH_FPIC ?= -fpic ARCH_FPIE ?= -fpie ARCH_PIE ?= -pie +# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES)) +define pkg_check_modules +$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2)) +$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2)) +endef + ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y) # on i386: 14% smaller libbusybox.so # (code itself is 9% bigger, we save on relocs/PLT/GOT) @@ -86,6 +95,7 @@ endif ifeq ($(CONFIG_STATIC),y) CFLAGS_busybox += -static +PKG_CONFIG_FLAGS += --static endif ifeq ($(CONFIG_PIE),y) @@ -128,7 +138,10 @@ LDLIBS += pam pam_misc pthread endif ifeq ($(CONFIG_SELINUX),y) -LDLIBS += selinux sepol +SELINUX_PC_MODULES = libselinux libsepol +$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) +CPPFLAGS += $(SELINUX_CFLAGS) +LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%)) endif ifeq ($(CONFIG_EFENCE),y)