From 1ea2095081a5a2e04dfabefe3f9922a2b2f1d250 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 11 Jan 2020 23:44:38 +0100 Subject: [PATCH] asterisk-16.x: fix compile with PKG_ASLR_PIE CFLAGS aren't used when compiling objects for check_expr2. This commits adds the flags, which fixes the compilation when PKG_ASLR_PIE is enabled. Note: The STANDALONE define is removed because it is already defined in _ASTCFLAGS. Signed-off-by: Sebastian Kemper (cherry picked from commit 357949967f330ae1e6d199d1c362f2666de82c43) --- net/asterisk-16.x/Makefile | 2 +- .../patches/056-fix-check_expr2-build.patch | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/net/asterisk-16.x/Makefile b/net/asterisk-16.x/Makefile index cbe9b59..ab0f172 100644 --- a/net/asterisk-16.x/Makefile +++ b/net/asterisk-16.x/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk AST_MAJOR_VERSION:=16 PKG_NAME:=asterisk$(AST_MAJOR_VERSION) PKG_VERSION:=$(AST_MAJOR_VERSION).3.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases diff --git a/net/asterisk-16.x/patches/056-fix-check_expr2-build.patch b/net/asterisk-16.x/patches/056-fix-check_expr2-build.patch index edc1edf..537281d 100644 --- a/net/asterisk-16.x/patches/056-fix-check_expr2-build.patch +++ b/net/asterisk-16.x/patches/056-fix-check_expr2-build.patch @@ -1,6 +1,33 @@ +From 06e8d5ad8e4728a716bf357c8d7f70367ae10280 Mon Sep 17 00:00:00 2001 +From: Sebastian Kemper +Date: Sun, 12 Jan 2020 12:37:46 +0100 +Subject: [PATCH] check_expr2: fix cross-compile/hardening issues + +When building check_expr2 with ASLR PIE hardening enabled the linker +fails. This is resolved by adding the regular compiler flags when +building the object files from ast_expr2f.c and ast_expr2.c. + +Note: The STANDALONE define is removed because it is already defined in +_ASTCFLAGS. YY_NO_INPUT is defined so that the compile survives +'--enable-dev-mode'. + +ASTERISK-28685 #close + +Signed-off-by: Sebastian Kemper +Change-Id: If435b7db9f9ad8266245bda51c81c220f9658915 +Taken just Makefile changes from commit: 06e8d5ad8e4728a716bf357c8d7f70367ae10280 --- a/utils/Makefile +++ b/utils/Makefile @@ -187,7 +187,6 @@ check_expr2: $(ASTTOPDIR)/main/ast_expr2 + + check_expr2: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h astmm.o + $(ECHO_PREFIX) echo " [CC] ast_expr2f.c -> ast_expr2fz.o" +- $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2fz.o ++ $(CC) -g -c -I$(ASTTOPDIR)/include $(_ASTCFLAGS) $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2fz.o + $(ECHO_PREFIX) echo " [CC] ast_expr2.c -> ast_expr2z.o" +- $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE2 $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2z.o ++ $(CC) -g -c -I$(ASTTOPDIR)/include $(_ASTCFLAGS) -DSTANDALONE2 $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2z.o + $(ECHO_PREFIX) echo " [LD] ast_expr2fz.o ast_expr2z.o -> check_expr2" $(CC) -g -o check_expr2 ast_expr2fz.o ast_expr2z.o astmm.o -lm $(_ASTLDFLAGS) $(ECHO_PREFIX) echo " [RM] ast_expr2fz.o ast_expr2z.o" rm ast_expr2z.o ast_expr2fz.o -- 2.30.2