Patchwork [libffi] fix (gcc) PR libffi/49594 (bootstrap fail on ppc/darwin8 with multilibs)

login
register
mail settings
Submitter IainS
Date July 2, 2011, 1:04 p.m.
Message ID <85D6B171-727F-4D0E-896A-218994CEB9EB@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/102990/
State New
Headers show

Comments

IainS - July 2, 2011, 1:04 p.m.
Hi,

The bug exists on 4.6 and trunk.

The fix is pretty close to obvious.  The size of the pointer to  
dyld_stub_binding_helper needs to track m32/m64.

bootstrapped on native powerpc-apple-darwin8 on a G5 tested as below  
(using gcc-4_6-branch revision 175752).
Index: libffi/src/powerpc/darwin_closure.S
===================================================================
--- libffi/src/powerpc/darwin_closure.S	(revision 175752)
+++ libffi/src/powerpc/darwin_closure.S	(working copy)
@@ -534,7 +534,7 @@ L_ffi_closure_helper_DARWIN$stub:
 	.lazy_symbol_pointer
 L_ffi_closure_helper_DARWIN$lazy_ptr:
 	.indirect_symbol _ffi_closure_helper_DARWIN
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper
 
 #if defined(__ppc64__)
 	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
@@ -553,7 +553,8 @@ L_darwin64_struct_ret_by_value_p$stub:
 	.lazy_symbol_pointer
 L_darwin64_struct_ret_by_value_p$lazy_ptr:
 	.indirect_symbol _darwin64_struct_ret_by_value_p
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper
+
 	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
 	.align 5
 L_darwin64_pass_struct_floats$stub:
@@ -570,6 +571,6 @@ L_darwin64_pass_struct_floats$stub:
 	.lazy_symbol_pointer
 L_darwin64_pass_struct_floats$lazy_ptr:
 	.indirect_symbol _darwin64_pass_struct_floats
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper
 #  endif
 #endif
Mike Stump - July 2, 2011, 5:17 p.m.
On Jul 2, 2011, at 6:04 AM, Iain Sandoe <developer@sandoe-acoustics.co.uk> wrote:.
> The fix is pretty close to obvious.  The size of the pointer to dyld_stub_binding_helper needs to track m32/m64.

> OK for trunk and 4.6

Ok.

Patch

===

Native configuration is powerpc-apple-darwin8
---

Running target unix/-m32

		=== libffi Summary for unix/-m32 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

Running target unix/-m64

		=== libffi Summary for unix/-m64 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

		=== libffi Summary ===

# of expected passes		3268
# of expected failures		20
# of unsupported tests		30


OK for trunk and 4.6?

Iain


Index: libffi/src/powerpc/darwin_closure.S
===================================================================
--- libffi/src/powerpc/darwin_closure.S	(revision 175752)
+++ libffi/src/powerpc/darwin_closure.S	(working copy)
@@ -534,7 +534,7 @@  L_ffi_closure_helper_DARWIN$stub:
  	.lazy_symbol_pointer
  L_ffi_closure_helper_DARWIN$lazy_ptr:
  	.indirect_symbol _ffi_closure_helper_DARWIN
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper

  #if defined(__ppc64__)
  	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
@@ -553,7 +553,8 @@  L_darwin64_struct_ret_by_value_p$stub:
  	.lazy_symbol_pointer
  L_darwin64_struct_ret_by_value_p$lazy_ptr:
  	.indirect_symbol _darwin64_struct_ret_by_value_p
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper
+
  	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
  	.align 5
  L_darwin64_pass_struct_floats$stub:
@@ -570,6 +571,6 @@  L_darwin64_pass_struct_floats$stub:
  	.lazy_symbol_pointer
  L_darwin64_pass_struct_floats$lazy_ptr:
  	.indirect_symbol _darwin64_pass_struct_floats
-	.long	dyld_stub_binding_helper
+	.g_long	dyld_stub_binding_helper
  #  endif
  #endif