Blame SOURCES/rhel8_build.patch

608733
--- crash-7.2.3/Makefile.orig
608733
+++ crash-7.2.3/Makefile
608733
@@ -198,7 +198,7 @@ GDB_FLAGS=
608733
 # TARGET_CFLAGS will be configured automatically by configure
608733
 TARGET_CFLAGS=
608733
 
608733
-CRASH_CFLAGS=-g -D${TARGET} ${TARGET_CFLAGS} ${GDB_FLAGS} ${CFLAGS}
608733
+CRASH_CFLAGS=-g -D${TARGET} ${TARGET_CFLAGS} ${GDB_FLAGS} ${CFLAGS} ${CPPFLAGS} -fPIE
608733
 
608733
 GPL_FILES=COPYING3
608733
 TAR_FILES=${SOURCE_FILES} Makefile ${GPL_FILES} README .rh_rpm_package crash.8 \
608733
@@ -228,7 +228,7 @@ all: make_configure
608733
 gdb_merge: force
608733
 	@if [ ! -f ${GDB}/README ]; then \
608733
 	  make --no-print-directory gdb_unzip; fi
608733
-	@echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic" > ${GDB}/gdb/mergelibs
608733
+	@echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic -Wl,-z,now -fpie" > ${GDB}/gdb/mergelibs
608733
 	@echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
608733
 	@rm -f ${PROGRAM}
608733
 	@if [ ! -f ${GDB}/config.status ]; then \
608733
--- crash-7.2.3/configure.c.orig
608733
+++ crash-7.2.3/configure.c
608733
@@ -780,7 +780,8 @@ build_configure(struct supported_gdb_ver
608733
                         fprintf(fp2, "%s\n", sp->GDB);
608733
                         sprintf(target_data.gdb_version, "%s", &sp->GDB[4]);
608733
 		} else if (strncmp(buf, "LDFLAGS=", strlen("LDFLAGS=")) == 0) {
608733
-                       	fprintf(fp2, "LDFLAGS=%s\n", ldflags ? ldflags : "");
608733
+			if (ldflags)
608733
+                       		fprintf(fp2, "LDFLAGS=%s\n", ldflags ? ldflags : "");
608733
 		} else
608733
 			fprintf(fp2, "%s", buf);
608733