This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][committed] Fix failure in nptl/tst-cleanup2 with GCC-4.9


Greetings,

I've committed attached patch as obvious.

When building with gcc (GCC) 4.9.0 20131114 (experimental),
a call to 'sprintf(NULL, ...)' gets compiled into UD2 on x86_64,
and the test fails with unexpected SIGILL.

Since we really do want to call sprintf here, the fix is for GCC to
ignore its builtin knowledge of what sprintf does.

Thanks,


P.S. I had committed and reverted an earlier obvious patch (which proved
to not be so obvious after all): 71655786bcb9ccc4fe2b062520a2538a8f802e74
that added SIGILL handling. We do realy want to call sprintf here, so
that wasn't the right fix.


nptl/ChangeLog
2013-11-20  Paul Pluzhnikov  <ppluzhnikov@google.com

	* Makefile (tst-cleanup2, tst-cleanupx2): Add -fno-builtin

diff --git a/nptl/Makefile b/nptl/Makefile
index cd601e5..82f2d0a 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -278,6 +278,10 @@ gen-as-const-headers = pthread-errnos.sym
 
 LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
 
+# GCC-4.9 compiles 'sprintf(NULL, ...)' into UD2 on x86_64 without -fno-builtin
+CFLAGS-tst-cleanup2.c = -fno-builtin
+CFLAGS-tst-cleanupx2.c = -fno-builtin
+
 include ../Makeconfig
 
 ifeq ($(have-forced-unwind),yes)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]