http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51124

--- Comment #2 from Jack Howarth <howarth at nitro dot med.uc.edu> 2011-12-16 
15:19:55 UTC ---
On x86_64-apple-darwin11, the failure of...

FAIL: libitm.c/clone-1.c execution test

at -m32/-m64 appears to be due to the -pie linker default when targeting
darwin11.
If I append -Wl,-no_pie to the compilation of the clone-1.exe testcase, the
resulting
binaries for both -m32 and -m64 execute fine. For...

/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/
/sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20111215/libitm/testsuite/libitm.c/clone-1.c
-B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/./libitm/
-I/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/./libitm
-I/sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20111215/libitm/testsuite/..
-shared-libgcc -fmessage-length=0 -fgnu-tm -O2
-L/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/./libitm/.libs
-litm -lm -m64 -o ./clone-1.exe

the failing PIE executable debugs in gdb (with aslr enabled) as...

gdb ./clone-1.exeGNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov  3
21:59:02 UTC 2011)Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared
libraries .... done

(gdb) set disable-aslr 0
(gdb) r
Starting program:
/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/libitm/testsuite/clone-1.exe
 
Reading symbols for shared libraries + done
Reading symbols for shared libraries ++++........................ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000001000010a8
clone_entry_compare (a=0x100001098, b=0x1000010a8) at
../../../gcc-4.7-20111215/libitm/clone.cc:105
105      if (aa->orig < bb->orig)
(gdb) bt
#0  clone_entry_compare (a=0x100001098, b=0x1000010a8) at
../../../gcc-4.7-20111215/libitm/clone.cc:105
#1  0x00007fff8ddd4894 in _qsort ()
#2  0x0000000104e388e6 in _ITM_registerTMCloneTable (xent=0x100001098, size=2)
at ../../../gcc-4.7-20111215/libitm/clone.cc:155
Current language:  auto; currently c++
(gdb) 

The remaining failures at -m64-only of...

FAIL: libitm.c/memcpy-1.c execution test
FAIL: libitm.c/memset-1.c execution test

are not solved with -Wl,-no_pie and the binaries fail with the output...

libitm: pr_undoLogCode not supported

Reply via email to