[Pkg-erlang-commits] r1869 - in erlang/trunk/debian: . patches

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Sat Nov 19 11:01:45 UTC 2016


Author: sgolovan
Date: 2016-11-19 11:01:45 +0000 (Sat, 19 Nov 2016)
New Revision: 1869

Added:
   erlang/trunk/debian/patches/hipe-nopie.patch
Modified:
   erlang/trunk/debian/changelog
   erlang/trunk/debian/patches/series
   erlang/trunk/debian/rules
Log:
[erlang]
  * Use the solution from upstream to build HiPE if GCC enables PIE by default.
    The previous one breaks erlang-wx (closes: #844593).


Modified: erlang/trunk/debian/changelog
===================================================================
--- erlang/trunk/debian/changelog	2016-11-11 06:35:19 UTC (rev 1868)
+++ erlang/trunk/debian/changelog	2016-11-19 11:01:45 UTC (rev 1869)
@@ -1,8 +1,9 @@
-erlang (1:19.1.6+dfsg-2) UNRELEASED; urgency=medium
+erlang (1:19.1.6+dfsg-2) unstable; urgency=medium
 
-  * NOT RELEASED YET
+  * Use the solution from upstream to build HiPE if GCC enables PIE by default.
+    The previous one breaks erlang-wx (closes: #844593).
 
- -- Sergei Golovan <sgolovan at debian.org>  Fri, 11 Nov 2016 09:35:18 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Sat, 19 Nov 2016 12:45:43 +0300
 
 erlang (1:19.1.6+dfsg-1) unstable; urgency=medium
 

Added: erlang/trunk/debian/patches/hipe-nopie.patch
===================================================================
--- erlang/trunk/debian/patches/hipe-nopie.patch	                        (rev 0)
+++ erlang/trunk/debian/patches/hipe-nopie.patch	2016-11-19 11:01:45 UTC (rev 1869)
@@ -0,0 +1,68 @@
+Author: Upstream
+Description: Patch fixes HiPE build for the case when the GCC compiler enables
+ PIE by default.
+Date: Wed, 9 Nov 2016 16:52:23 +0100
+
+--- a/erts/configure.in
++++ b/erts/configure.in
+@@ -2771,6 +2771,23 @@ if test "$cross_compiling" != "yes" && test X${enable_hipe} != Xno; then
+   fi
+ fi
+ 
++dnl Check to disable -fPIE and friends for HiPE on amd64
++if test X${enable_hipe} = Xyes && test X$ARCH = Xamd64; then
++   AC_TRY_COMPILE(, [#if defined(__pie__) || defined(__PIE__)
++		     #error -fPIE is enabled by default
++		     #endif],
++		    [AC_MSG_NOTICE([No -fPIE enabled by default])],
++		    [AC_MSG_WARN([Security feature -fPIE will be disabled for HiPE])
++		     STATIC_CFLAGS="-fno-PIE $STATIC_CFLAGS"
++		     saved_LDFLAGS=$LDFLAGS
++		     LDFLAGS="-no-pie $LDFLAGS"
++		     AC_TRY_LINK(,, [],
++			[AC_MSG_WARN([Linked does not accept option -no-pie])
++			 LDFLAGS=$saved_LDFLAGS])])
++
++fi
++
++
+ if test X${enable_fp_exceptions} = Xauto ; then
+    case $host_os in
+    	*linux*)
+--- a/erts/emulator/Makefile.in
++++ b/erts/emulator/Makefile.in
+@@ -49,6 +49,7 @@ CREATE_DIRS=
+ LDFLAGS=@LDFLAGS@
+ ARFLAGS=rc
+ OMIT_OMIT_FP=no
++TYPE_LIBS=
+ 
+ DIRTY_SCHEDULER_SUPPORT=@DIRTY_SCHEDULER_SUPPORT@
+ NEW_PURGE_STRATEGY=@NEW_PURGE_STRATEGY@
+@@ -90,7 +91,7 @@ PURIFY =
+ TYPEMARKER = .gcov
+ TYPE_FLAGS = $(DEBUG_CFLAGS) -DERTS_GCOV -DNO_JUMP_TABLE -fprofile-arcs -ftest-coverage -O0 -DERTS_CAN_INLINE=0 -DERTS_INLINE=
+ ifneq ($(findstring solaris,$(TARGET)),solaris)
+-LIBS += -lgcov
++TYPE_LIBS = -lgcov
+ endif
+ ENABLE_ALLOC_TYPE_VARS += debug
+ else
+@@ -146,6 +147,8 @@ endif
+ endif
+ endif
+ 
++LIBS += $(TYPE_LIBS)
++
+ comma:=,
+ space:=
+ space+=
+@@ -931,7 +934,7 @@ $(OBJDIR)/%.o: hipe/%.c
+ 	$(V_CC) $(subst O2,O3, $(CFLAGS)) $(INCLUDES) -c $< -o $@
+ 
+ $(BINDIR)/hipe_mkliterals$(TF_MARKER):	$(OBJDIR)/hipe_mkliterals.o
+-	$(ld_verbose)$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
++	$(ld_verbose)$(CC) $(LDFLAGS) -o $@ $< $(TYPE_LIBS)
+ 
+ $(OBJDIR)/hipe_mkliterals.o:	$(HIPE_ASM) $(TTF_DIR)/erl_alloc_types.h $(DTRACE_HEADERS) \
+ 	$(TTF_DIR)/OPCODES-GENERATED $(TARGET)/TABLES-GENERATED

Modified: erlang/trunk/debian/patches/series
===================================================================
--- erlang/trunk/debian/patches/series	2016-11-11 06:35:19 UTC (rev 1868)
+++ erlang/trunk/debian/patches/series	2016-11-19 11:01:45 UTC (rev 1869)
@@ -10,3 +10,4 @@
 wx3.0-constants.patch
 beamload.patch
 x32.patch
+hipe-nopie.patch

Modified: erlang/trunk/debian/rules
===================================================================
--- erlang/trunk/debian/rules	2016-11-11 06:35:19 UTC (rev 1868)
+++ erlang/trunk/debian/rules	2016-11-19 11:01:45 UTC (rev 1869)
@@ -67,13 +67,11 @@
 LIBSCTPDEP=$(shell grep-status -s Version -PX $(LIBSCTP) | sed -e's!^Version: \(.*\)-[^-]*!$(LIBSCTP) (>= \1)!')
 
 ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
-CFLAGS=-g -O2 -fno-strict-aliasing -fno-pie -no-pie
-LDFLAGS=-fno-pie -no-pie
+CFLAGS=-g -O2 -fno-strict-aliasing
 GEN_OPT_FLGS=-O2 -fno-strict-aliasing
 TYPE=debug
 else
-CFLAGS=-g -O2 -fno-strict-aliasing -fno-pie -no-pie
-LDFLAGS=-fno-pie -no-pie
+CFLAGS=-g -O2 -fno-strict-aliasing
 GEN_OPT_FLGS=-O2 -fno-strict-aliasing
 TYPE=
 endif
@@ -179,7 +177,6 @@
 	rm -f lib/dialyzer/SKIP
 	#
 	CFLAGS="$(CFLAGS)" \
-	LDFLAGS="$(LDFLAGS)" \
 	./configure --host=$(DEB_HOST_GNU_TYPE) \
 		    --build=$(DEB_BUILD_GNU_TYPE) \
 		    --prefix=/usr \
@@ -212,7 +209,6 @@
 	rm -f lib/dialyzer/SKIP
 	#
 	CFLAGS="$(CFLAGS)" \
-	LDFLAGS="$(LDFLAGS)" \
 	./configure --host=$(DEB_HOST_GNU_TYPE) \
 		    --build=$(DEB_BUILD_GNU_TYPE) \
 		    --prefix=/usr \




More information about the Pkg-erlang-commits mailing list