From 01243348d38cbe650a8aef21c101cb34f5e5550d Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 26 Nov 2017 21:58:15 +0100 Subject: [PATCH] libre: Use default Build/Compile routing Change from custom make call to using the default Build/Compile routine. This applies the standard memory corruption mitigation methods, e.g. FORTIFY_SOURCE and RELRO to the package, if they are enabled (default). Signed-off-by: Sebastian Kemper --- libs/re/Makefile | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/libs/re/Makefile b/libs/re/Makefile index 52774c6..7fcafe8 100644 --- a/libs/re/Makefile +++ b/libs/re/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=re PKG_VERSION:=0.5.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.creytiv.com/pub @@ -20,6 +20,8 @@ PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=docs/COPYING PKG_MAINTAINER:=Jiri Slachta +PKG_INSTALL:=1 + include $(INCLUDE_DIR)/package.mk define Package/libre @@ -31,26 +33,26 @@ define Package/libre URL:=http://www.creytiv.com/ endef -TARGET_CFLAGS += $(FPIC) +# re.mk is used for this and all related packages (rem, restund and baresip). +# It relies on SYSROOT and SYSROOT_ALT being set. SYSROOT is used for finding +# toolchain headers (like pthread.h). SYSROOT_ALT is used for finding headers +# from other packages, like openssl etc. +# +# CFLAGS are picked up from the environment, as well as CPPFLAGS (and LD etc.). +# But LDFLAGS aren't picked up, so they need to be handed over via +# EXTRA_LFLAGS. ifneq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),) TARGET_CFLAGS += -D_GNU_SOURCE endif -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - HAVE_LIBRESOLV= \ - CC="$(TARGET_CC)" \ - EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ - EXTRA_LFLAGS="-lm" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ - SYSROOT_ALT="$(STAGING_DIR)/usr" \ - RELEASE=1 \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - OS=linux \ - all install -endef +MAKE_FLAGS+= \ + HAVE_LIBRESOLV= \ + EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \ + SYSROOT="$(shell $(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s|/include/pthread.h||p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + OS=linux define Build/InstallDev $(INSTALL_DIR) $(1)/usr/share/re