Author: lnicoara Date: Sat Sep 15 15:08:37 2012 New Revision: 1385076 URL: http://svn.apache.org/viewvc?rev=1385076&view=rev Log: 2012-09-15 Liviu Nicoara <lnico...@apache.org>
Merged revision 1385075 from 4.2.x: 2012-09-15 Liviu Nicoara <lnico...@apache.org> * src/x86_64/atomic.s: (ALIGN_DIR,TYPE_DIR) new, accommodate Mach-O assembler, conditional based on __MACH__, defined by both gcc and clang * etc/config/gcc.config: on Darwin link with libsupc++ only, implies using a GNU stock compiler, not LLVM Modified: stdcxx/trunk/ (props changed) stdcxx/trunk/etc/config/gcc.config stdcxx/trunk/src/x86_64/ (props changed) stdcxx/trunk/src/x86_64/atomic.s Propchange: stdcxx/trunk/ ------------------------------------------------------------------------------ Merged /stdcxx/branches/4.2.x:r1385075 Modified: stdcxx/trunk/etc/config/gcc.config URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/gcc.config?rev=1385076&r1=1385075&r2=1385076&view=diff ============================================================================== --- stdcxx/trunk/etc/config/gcc.config (original) +++ stdcxx/trunk/etc/config/gcc.config Sat Sep 15 15:08:37 2012 @@ -40,6 +40,7 @@ ifeq ($(OSNAME),AIX) else ifeq ($(OSNAME),Darwin) OS_MAJOR := $(shell uname -r | sed "s/^\([1-9]*\).*/\1/") + OS_MINOR := $(shell uname -r | sed "s/^[1-9][0-9]*\.\([1-9]*\).*/\1/") endif endif @@ -168,14 +169,13 @@ endif ifneq ($(CXX_MAJOR),2) # gcc 3.x needs to explicitly link with libsupc++ for language support # g++ 3.x links with it as well as libstdc++ automatically - LDLIBS = -lsupc++ - ifeq ($(OSNAME),Darwin) - # link with gcc_eh to resolve the _Unwind_xxx functions - # (shouldn't we link with it on all platforms?) - LDLIBS += -lgcc_eh - endif -endif # gcc > 2 + # Recently, Apple ships a C++ compiler based on LLVM which does not + # include a C++ support library; gcc builds on Darwin require a stock + # GNU compiler + + LDLIBS = -lsupc++ +endif # gcc > 2 # The flag(s) to use to embed a library search path into generated executables. ifeq ($(OSNAME),Linux) Propchange: stdcxx/trunk/src/x86_64/ ------------------------------------------------------------------------------ Merged /stdcxx/branches/4.2.x/src/x86_64:r1385075 Modified: stdcxx/trunk/src/x86_64/atomic.s URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/x86_64/atomic.s?rev=1385076&r1=1385075&r2=1385076&view=diff ============================================================================== --- stdcxx/trunk/src/x86_64/atomic.s (original) +++ stdcxx/trunk/src/x86_64/atomic.s Sat Sep 15 15:08:37 2012 @@ -26,8 +26,17 @@ * **************************************************************************/ +#if defined (__MACH__) +// Mac OS X Mach-O assembler: no .type, power of two alignment +# define ALIGN_DIR .align 4 +# define TYPE_DIR(ignore,ignore2) +#else +# define ALIGN_DIR .align 16 +# define TYPE_DIR(sym,attr) .type sym, attr +#endif // __MACH__ + .text - .align 16 + ALIGN_DIR /*************************************************************************** * extern "C" int8_t __rw_atomic_xchg8 (int8_t *x, int8_t y); @@ -37,7 +46,7 @@ **************************************************************************/ .globl __rw_atomic_xchg8 - .type __rw_atomic_xchg8, @function + TYPE_DIR (__rw_atomic_xchg8, STT_FUNC) __rw_atomic_xchg8: /* ; int8_t (int8_t *x, int8_t y) */ movq %rdi, %rcx /* ; %rcx = x */ movb %sil, %al /* ; %al = y */ @@ -53,7 +62,7 @@ __rw_atomic_xchg8: /* ; **************************************************************************/ .globl __rw_atomic_xchg16 - .type __rw_atomic_xchg16, @function + TYPE_DIR (__rw_atomic_xchg16, STT_FUNC) __rw_atomic_xchg16: /* ; int16_t (int16_t *x, int16_t y) */ movq %rdi, %rcx /* ; %rcx = x */ movw %si, %ax /* ; %ax = y */ @@ -69,7 +78,7 @@ __rw_atomic_xchg16: /* ; **************************************************************************/ .globl __rw_atomic_xchg32 - .type __rw_atomic_xchg32, @function + TYPE_DIR (__rw_atomic_xchg32, STT_FUNC) __rw_atomic_xchg32: /* ; int32_t (int32_t *x, int32_t y) */ movq %rdi, %rcx /* ; %rcx = x */ movl %esi, %eax /* ; %eax = y */ @@ -85,7 +94,7 @@ __rw_atomic_xchg32: /* ; **************************************************************************/ .globl __rw_atomic_xchg64 - .type __rw_atomic_xchg64, @function + TYPE_DIR (__rw_atomic_xchg64, STT_FUNC) __rw_atomic_xchg64: /* ; int64_t (int64_t *x, int64_t y) */ movq %rdi, %rcx /* ; %rcx = x */ movq %rsi, %rax /* ; %rax = y */ @@ -101,7 +110,7 @@ __rw_atomic_xchg64: /* ; **************************************************************************/ .globl __rw_atomic_add8 - .type __rw_atomic_add8, @function + TYPE_DIR (__rw_atomic_add8, STT_FUNC) __rw_atomic_add8: /* ; int8_t (int8_t *dst, int8_t inc) */ movq %rdi, %rcx /* ; %rcx = dst */ movl %esi, %eax /* ; %eax = inc */ @@ -123,7 +132,7 @@ __rw_atomic_add8: /* ; **************************************************************************/ .globl __rw_atomic_add16 - .type __rw_atomic_add16, @function + TYPE_DIR (__rw_atomic_add16, STT_FUNC) __rw_atomic_add16: /* ; int16_t (int16_t *dst, int16_t inc) */ movq %rdi, %rcx /* ; %rcx = dst */ movw %si, %ax /* ; %ax = inc */ @@ -146,7 +155,7 @@ __rw_atomic_add16: /* ; **************************************************************************/ .globl __rw_atomic_add32 - .type __rw_atomic_add32, @function + TYPE_DIR (__rw_atomic_add32, STT_FUNC) __rw_atomic_add32: /* ; int32_t (int32_t *dst, int32_t inc) */ movq %rdi, %rcx /* ; %rcx = dst */ movl %esi, %edx /* ; %edx = inc */ @@ -169,7 +178,7 @@ __rw_atomic_add32: /* ; **************************************************************************/ .globl __rw_atomic_add64 - .type __rw_atomic_add64, @function + TYPE_DIR (__rw_atomic_add64, STT_FUNC) __rw_atomic_add64: /* ; int64_t (int64_t *dst, int64_t inc) */ movq %rdi, %rcx /* ; %rcx = dst */ movq %rsi, %rdx /* ; %edx = inc */