Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487) [committed]

Message ID 877e0qv5t6.fsf@mid.deneb.enyo.de
State Committed
Headers

Commit Message

Florian Weimer Feb. 13, 2020, 3:57 p.m. UTC
  * Joseph Myers:

> On Thu, 13 Feb 2020, Florian Weimer wrote:
>
>> Thanks for fixing this.  Unfortunately, the test doesn't build on ia64
>> because GCC does not support -fstack-protector-all there:
>> 
>> cc1: error: ‘-fstack-protector’ not supported for this target [-Werror]
>> cc1: all warnings being treated as errors
>> make[3]: *** [/mnt/scratch1/fw/bmg/default/build/glibcs/ia64-linux-gnu/glibc/sysd-rules:639: /mnt/scratch1/fw/bmg/default/build/glibcs/ia64-linux-gnu/glibc/math/test-sinl-pseudo.o] Error 1
>
> It looks like ifeq ($(have-ssp),yes) will be needed around that CFLAGS 
> setting.  (I took the unconditional CFLAGS setting from where such a 
> setting is used in debug/Makefile, but I see that in fact the addition of 
> the test there is conditional.  In this case, the test is appropriate 
> unconditionally, it's just the use of -fstack-protector-all that needs to 
> be conditional.)

This patch seems to fix the build.  Okay to install?

Subject: math/test-sinl-pseudo: Use stack protector only if available

This fixes commit 9333498794cde1d5cca518badf79533a24114b6f ("Avoid
ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487).").
  

Comments

Joseph Myers Feb. 13, 2020, 3:59 p.m. UTC | #1
On Thu, 13 Feb 2020, Florian Weimer wrote:

> This patch seems to fix the build.  Okay to install?
> 
> Subject: math/test-sinl-pseudo: Use stack protector only if available
> 
> This fixes commit 9333498794cde1d5cca518badf79533a24114b6f ("Avoid
> ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487).").

OK.
  

Patch

diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
index 318628aed6..9785b03801 100644
--- a/sysdeps/ieee754/ldbl-96/Makefile
+++ b/sysdeps/ieee754/ldbl-96/Makefile
@@ -18,5 +18,7 @@ 
 
 ifeq ($(subdir),math)
 tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo
+ifeq ($(have-ssp),yes)
 CFLAGS-test-sinl-pseudo.c += -fstack-protector-all
-endif
+endif 
+endif # $(subdir) == math