Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/Makefile.flags


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/Makefile.flags

    r2725 r3232  
    2626CFLAGS += $(call cc-option,-Wunused-function -Wunused-value,)
    2727CFLAGS += $(call cc-option,-Wmissing-prototypes -Wmissing-declarations,)
     28CFLAGS += $(call cc-option,-Wno-format-security,)
    2829# warn about C99 declaration after statement
    2930CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
     
    5354CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,)
    5455CFLAGS += $(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):
     57CFLAGS += $(call cc-option,-fno-unwind-tables,)
     58CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
    5559
    5660# FIXME: These warnings are at least partially to be concerned about and should
     
    5963
    6064ifneq ($(CONFIG_DEBUG),y)
    61 CFLAGS += $(call cc-option,-Os,)
     65CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,))
    6266else
    6367CFLAGS += $(call cc-option,-g,)
     
    6670CFLAGS += $(call cc-option,-O0,)
    6771else
    68 CFLAGS += $(call cc-option,-Os,)
     72CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,))
    6973endif
    7074endif
     
    7478ARCH_FPIE ?= -fpie
    7579ARCH_PIE ?= -pie
     80
     81# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
     82define 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))
     85endef
    7686
    7787ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
     
    8696ifeq ($(CONFIG_STATIC),y)
    8797CFLAGS_busybox += -static
     98PKG_CONFIG_FLAGS += --static
    8899endif
    89100
     
    98109endif
    99110
     111# Note: both "" (string consisting of two quote chars) and empty string
     112# are possible, and should be skipped below.
     113ifneq ($(subst "",,$(CONFIG_SYSROOT)),)
     114CFLAGS += --sysroot=$(CONFIG_SYSROOT)
     115export SYSROOT=$(CONFIG_SYSROOT)
     116endif
     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:
     122CRYPT_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)
     123ifeq ($(CRYPT_AVAILABLE),y)
    100124LDLIBS += m crypt
     125else
     126LDLIBS += m
     127endif
    101128
    102129ifeq ($(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.)
     137LDLIBS += pam pam_misc pthread
    104138endif
    105139
    106140ifeq ($(CONFIG_SELINUX),y)
    107 LDLIBS += selinux sepol
     141SELINUX_PC_MODULES = libselinux libsepol
     142$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
     143CPPFLAGS += $(SELINUX_CFLAGS)
     144LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
    108145endif
    109146
     
    126163endif
    127164
     165ifneq ($(CONFIG_EXTRA_LDFLAGS),)
     166EXTRA_LDFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_LDFLAGS)))
     167#"))
     168endif
     169
     170ifneq ($(CONFIG_EXTRA_LDLIBS),)
     171LDLIBS += $(strip $(subst ",,$(CONFIG_EXTRA_LDLIBS)))
     172#"))
     173endif
     174
    128175# Busybox is a stack-fatty so make sure we increase default size
    129176# TODO: use "make stksizes" to find & fix big stack users
Note: See TracChangeset for help on using the changeset viewer.