Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/Makefile.flags
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/Makefile.flags
r2725 r3232 26 26 CFLAGS += $(call cc-option,-Wunused-function -Wunused-value,) 27 27 CFLAGS += $(call cc-option,-Wmissing-prototypes -Wmissing-declarations,) 28 CFLAGS += $(call cc-option,-Wno-format-security,) 28 29 # warn about C99 declaration after statement 29 30 CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) … … 53 54 CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,) 54 55 CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,) 56 # Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary): 57 CFLAGS += $(call cc-option,-fno-unwind-tables,) 58 CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,) 55 59 56 60 # FIXME: These warnings are at least partially to be concerned about and should … … 59 63 60 64 ifneq ($(CONFIG_DEBUG),y) 61 CFLAGS += $(call cc-option,-Os, )65 CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) 62 66 else 63 67 CFLAGS += $(call cc-option,-g,) … … 66 70 CFLAGS += $(call cc-option,-O0,) 67 71 else 68 CFLAGS += $(call cc-option,-Os, )72 CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) 69 73 endif 70 74 endif … … 74 78 ARCH_FPIE ?= -fpie 75 79 ARCH_PIE ?= -pie 80 81 # Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES)) 82 define pkg_check_modules 83 $(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2)) 84 $(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2)) 85 endef 76 86 77 87 ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y) … … 86 96 ifeq ($(CONFIG_STATIC),y) 87 97 CFLAGS_busybox += -static 98 PKG_CONFIG_FLAGS += --static 88 99 endif 89 100 … … 98 109 endif 99 110 111 # Note: both "" (string consisting of two quote chars) and empty string 112 # are possible, and should be skipped below. 113 ifneq ($(subst "",,$(CONFIG_SYSROOT)),) 114 CFLAGS += --sysroot=$(CONFIG_SYSROOT) 115 export SYSROOT=$(CONFIG_SYSROOT) 116 endif 117 118 # Android has no separate crypt library 119 # gcc-4.2.1 fails if we try to feed C source on stdin: 120 # echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc - 121 # fall back to using a temp file: 122 CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c) 123 ifeq ($(CRYPT_AVAILABLE),y) 100 124 LDLIBS += m crypt 125 else 126 LDLIBS += m 127 endif 101 128 102 129 ifeq ($(CONFIG_PAM),y) 103 LDLIBS += pam pam_misc 130 # libpam uses libpthread, so for static builds busybox must be linked to 131 # libpthread. On some platforms that requires an explicit -lpthread, so 132 # it should be in LDLIBS. For non-static builds, scripts/trylink will 133 # take care of removing -lpthread if possible. (Not bothering to check 134 # CONFIG_STATIC because even in a non-static build it could be that the 135 # only libpam available is libpam.a, so -lpthread could still be 136 # needed.) 137 LDLIBS += pam pam_misc pthread 104 138 endif 105 139 106 140 ifeq ($(CONFIG_SELINUX),y) 107 LDLIBS += selinux sepol 141 SELINUX_PC_MODULES = libselinux libsepol 142 $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) 143 CPPFLAGS += $(SELINUX_CFLAGS) 144 LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%)) 108 145 endif 109 146 … … 126 163 endif 127 164 165 ifneq ($(CONFIG_EXTRA_LDFLAGS),) 166 EXTRA_LDFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_LDFLAGS))) 167 #")) 168 endif 169 170 ifneq ($(CONFIG_EXTRA_LDLIBS),) 171 LDLIBS += $(strip $(subst ",,$(CONFIG_EXTRA_LDLIBS))) 172 #")) 173 endif 174 128 175 # Busybox is a stack-fatty so make sure we increase default size 129 176 # TODO: use "make stksizes" to find & fix big stack users
Note:
See TracChangeset
for help on using the changeset viewer.