arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh911307.patch

147e83
#
147e83
# Red Hat BZ:
147e83
# https://bugzilla.redhat.com/show_bug.cgi?id=911307
147e83
#
147e83
# Sourceware BZ: None.
147e83
#
147e83
# Upstreamm submission: Not yet completed.
147e83
#
147e83
# ChangeLog
147e83
#
147e83
# 2013-02-27  Carlos O'Donell  <carlos@redhat.com>
147e83
#
147e83
#	* elf/Makefile (CFLAGS-.o): Add -fno-tree-loop-distribute-patterns.
147e83
#	(CFLAGS-.os): Likewise.
147e83
#	(CFLAGS-.op): Likewise.
147e83
#	(CFLAGS-.ob): Likewise.
147e83
#	(CFLAGS-.oS): Likewise.
147e83
#	* string/Makefile (CFLAGS-.o): Likewise.
147e83
#	(CFLAGS-.os): Likewise.
147e83
#	(CFLAGS-.op): Likewise.
147e83
#	(CFLAGS-.ob): Likewise.
147e83
#	(CFLAGS-.oS): Likewise.
147e83
#
147e83
diff -urN glibc-2.17-c758a686/string/Makefile glibc-2.17-c758a686/string/Makefile
147e83
--- glibc-2.17-c758a686/string/Makefile	2013-02-27 18:07:34.618968703 -0500
147e83
+++ glibc-2.17-c758a686/string/Makefile	2013-02-27 18:08:16.075796160 -0500
147e83
@@ -78,6 +78,14 @@
147e83
 CFLAGS-bug-strstr1.c = -fno-builtin
147e83
 CFLAGS-bug-strcasestr1.c = -fno-builtin
147e83
 
147e83
+# Disable any optimization which might result in function calls to the very
147e83
+# same functions we are trying to compile, thus creating an infinite loop.
147e83
+CFLAGS-.o += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.os += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.op += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.ob += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.oS += -fno-tree-loop-distribute-patterns
147e83
+
147e83
 ifeq ($(run-built-tests),yes)
147e83
 tests: $(objpfx)tst-svc.out
147e83
 $(objpfx)tst-svc.out: tst-svc.input $(objpfx)tst-svc
147e83
diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile
147e83
--- glibc-2.17-c758a686/elf/Makefile	2013-02-27 18:07:13.812055613 -0500
147e83
+++ glibc-2.17-c758a686/elf/Makefile	2013-02-27 18:08:16.075796160 -0500
147e83
@@ -432,6 +432,16 @@
147e83
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
147e83
 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
147e83
 
147e83
+# Disable any optimization which might result in function calls during early
147e83
+# dynamic loader startup. We disable -ftree-loop-distribute-patterns which
147e83
+# might convert code into calls to functions like memcpy or memset when the PLT
147e83
+# is not yet setup.
147e83
+CFLAGS-.o += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.os += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.op += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.ob += -fno-tree-loop-distribute-patterns
147e83
+CFLAGS-.oS += -fno-tree-loop-distribute-patterns
147e83
+
147e83
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
147e83
 generated += $(addsuffix .so,$(strip $(modules-names)))