A new user interface for you! Read more...

File otp_src_20.0-erts-cflags.patch of Package erlang

diff -Ndurp otp_src_20.0/erts/configure.in otp_src_20.0-erts-cflags/erts/configure.in
--- otp_src_20.0/erts/configure.in	2017-06-21 11:53:21.000000000 +0300
+++ otp_src_20.0-erts-cflags/erts/configure.in	2017-06-29 02:13:38.528112768 +0300
@@ -456,37 +456,6 @@ dnl
 
 extra_flags="-I${ERL_TOP}/erts/$host $OTP_EXTRA_FLAGS"
 CFLAGS="$CFLAGS $extra_flags"
-DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags $DEBUG_CFLAGS"
-DEBUG_FLAGS=-g
-
-dnl
-dnl Adjust DEBUG_CFLAGS to match CFLAGS in terms of -m
-dnl
-
-case $CFLAGS in
-	*-m64*)
-		case $DEBUG_CFLAGS in
-			*-m64*)
-				;;
-			*)
-				DEBUG_CFLAGS="-m64 $DEBUG_CFLAGS"
-				;;
-		esac
-		;;
-	*-m32*)
-		case $DEBUG_CFLAGS in
-			*-m32*)
-				;;
-			*)
-				DEBUG_CFLAGS="-m32 $DEBUG_CFLAGS"
-				;;
-		esac
-		;;
-	*)
-		;;
-esac
-
-
 
 CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
 case $host_os in
@@ -573,8 +542,7 @@ else
   WFLAGS=""
   WERRORFLAGS=""
 fi
-dnl DEBUG_FLAGS is obsolete (I hope)
-AC_SUBST(DEBUG_FLAGS)
+
 AC_SUBST(DEBUG_CFLAGS)
 AC_SUBST(WFLAGS)
 AC_SUBST(WERRORFLAGS)
diff -Ndurp otp_src_20.0/erts/emulator/Makefile.in otp_src_20.0-erts-cflags/erts/emulator/Makefile.in
--- otp_src_20.0/erts/emulator/Makefile.in	2017-06-21 11:53:21.000000000 +0300
+++ otp_src_20.0-erts-cflags/erts/emulator/Makefile.in	2017-06-29 02:13:38.528112768 +0300
@@ -288,14 +288,6 @@ ifeq (@EMU_LOCK_CHECKING@,yes)
 NO_INLINE_FUNCTIONS=true
 endif
 
-ifneq ($(filter tile-%,$(TARGET)), )
-# -O2 generally produces faster for tile-cc, because the code is smaller.
-# Since tile-cc looks like gcc, we need to override the normal gcc -O3 setting.
-OPT_LEVEL = -O2
-else
-OPT_LEVEL = -O3
-endif
-
 ifeq ($(GCC),yes)
 ifeq ($(NO_INLINE_FUNCTIONS),true)
 GEN_OPT_FLGS = $(OPT_LEVEL) -fno-inline-functions
@@ -337,11 +329,10 @@ CS_PURIFY =
 CS_TYPE_FLAGS = $(subst QUANTIFY,FAKE_QUANTIFY, \
 		$(subst PURIFY,FAKE_PURIFY, $(TYPE_FLAGS)))
 endif
-CS_CFLAGS_ = $(CS_TYPE_FLAGS) $(DEFS) $(WFLAGS)
 ifeq ($(GCC),yes)
-CS_CFLAGS = $(subst -O2, $(GEN_OPT_FLGS) $(UNROLL_FLG), $(CS_CFLAGS_))
+CS_CFLAGS = $(CS_TYPE_FLAGS) $(GEN_OPT_FLGS) $(UNROLL_FLG) $(DEFS) $(WFLAGS)
 else
-CS_CFLAGS = $(CS_CFLAGS_)
+CS_CFLAGS = $(CS_TYPE_FLAGS) $(DEFS) $(WFLAGS)
 endif
 CS_LDFLAGS = $(LDFLAGS)
 CS_LIBS = -L../lib/internal/$(TARGET) -lerts_internal$(TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ @SOCKET_LIBS@
@@ -964,7 +955,7 @@ $(OBJDIR)/%.o: hipe/%.S
 	$(V_CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 $(OBJDIR)/%.o: hipe/%.c
-	$(V_CC) $(subst O2,O3, $(CFLAGS)) $(INCLUDES) -c $< -o $@
+	$(V_CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 $(BINDIR)/hipe_mkliterals$(TF_MARKER):	$(OBJDIR)/hipe_mkliterals.o
 	$(ld_verbose)$(CC) $(LDFLAGS) -o $@ $< $(ORIG_LIBS)
@@ -1016,7 +1007,7 @@ $(OBJDIR)/hipe_arm_bifs.o:	$(TTF_DIR)/hi
 # Use -fomit-frame-pointer to work around gcc (v4.5.2) bug causing
 # "error: r7 cannot be used in asm here" for DEBUG build.
 $(OBJDIR)/hipe_arm.o:           hipe/hipe_arm.c
-	$(V_CC) $(subst O2,O3, $(CFLAGS)) -fomit-frame-pointer $(INCLUDES) -c $< -o $@
+	$(V_CC) $(CFLAGS) -fomit-frame-pointer $(INCLUDES) -c $< -o $@
 
 # end of HiPE section
 ########################################
diff -Ndurp otp_src_20.0/erts/emulator/zlib/zlib.mk otp_src_20.0-erts-cflags/erts/emulator/zlib/zlib.mk
--- otp_src_20.0/erts/emulator/zlib/zlib.mk	2017-06-21 11:53:21.000000000 +0300
+++ otp_src_20.0-erts-cflags/erts/emulator/zlib/zlib.mk	2017-06-29 02:13:38.528112768 +0300
@@ -54,7 +54,7 @@ else  # gcov
 ifeq ($(TYPE),debug)
 ZLIB_CFLAGS = $(DEBUG_CFLAGS) $(DEFS) $(THR_DEFS)
 else # debug
-ZLIB_CFLAGS = $(subst -O2, -O3, $(CONFIGURE_CFLAGS) $(DEFS) $(THR_DEFS))
+ZLIB_CFLAGS = $(CONFIGURE_CFLAGS) $(DEFS) $(THR_DEFS)
 #ZLIB_CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
 #ZLIB_CFLAGS=-g -DDEBUG
 #ZLIB_CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
diff -Ndurp otp_src_20.0/erts/lib_src/Makefile.in otp_src_20.0-erts-cflags/erts/lib_src/Makefile.in
--- otp_src_20.0/erts/lib_src/Makefile.in	2017-06-21 11:53:21.000000000 +0300
+++ otp_src_20.0-erts-cflags/erts/lib_src/Makefile.in	2017-06-29 02:13:38.528112768 +0300
@@ -39,7 +39,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@
 ERLANG_OSTYPE=@ERLANG_OSTYPE@
 
 OMIT_FP=false
-CFLAGS=$(subst O2,O3, @CFLAGS@)
+CFLAGS=@CFLAGS@
 
 ifeq ($(TYPE),debug)
 CFLAGS=@DEBUG_CFLAGS@ -DDEBUG