public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Problem with darwin_closure.S on 10.4.11/gcc 4.3.3
@ 2013-10-23 13:13 mansky
  2013-10-23 16:03 ` Jay K
  0 siblings, 1 reply; 4+ messages in thread
From: mansky @ 2013-10-23 13:13 UTC (permalink / raw)
  To: libffi-discuss; +Cc: Edmund Mansky

Hi all,

I am trying to build libffi on a PowerMac G4 (ppc 7455 v3.2 dual  
867MHz CPUs) and keep getting errors in the build from the assembly  
code darwin_closure.S

The configure script, invoked with no arguments, seems to run fine  
and ends with no errors.
I do see a message near the end about a buggy sed, but get a  
directory "powerpc-apple-darwin8.11.0" as expected.

Running gmake (GNU make 3.80) then results in:

[eikonal:mansky] mansky%gmake > ./config_results8.txt
darwin_closure.S:140:Missing ')' assumed
darwin_closure.S:140:Parameter syntax error (parameter 2)
darwin_closure.S:149:Missing ')' assumed
darwin_closure.S:149:Missing ')' assumed
darwin_closure.S:149:Missing ')' assumed
darwin_closure.S:149:Parameter syntax error (parameter 2)
darwin_closure.S:150:Missing ')' assumed
darwin_closure.S:150:Missing ')' assumed
darwin_closure.S:150:Missing ')' assumed
darwin_closure.S:150:Parameter syntax error (parameter 2)
darwin_closure.S:151:Missing ')' assumed
darwin_closure.S:151:Missing ')' assumed
darwin_closure.S:151:Missing ')' assumed
darwin_closure.S:151:Parameter syntax error (parameter 2)
darwin_closure.S:152:Missing ')' assumed
darwin_closure.S:152:Missing ')' assumed
darwin_closure.S:152:Missing ')' assumed
darwin_closure.S:152:Parameter syntax error (parameter 2)
darwin_closure.S:153:Missing ')' assumed
darwin_closure.S:153:Missing ')' assumed
darwin_closure.S:153:Missing ')' assumed
darwin_closure.S:153:Parameter syntax error (parameter 2)
darwin_closure.S:154:Missing ')' assumed
darwin_closure.S:154:Missing ')' assumed
darwin_closure.S:154:Missing ')' assumed
darwin_closure.S:154:Parameter syntax error (parameter 2)
darwin_closure.S:155:Missing ')' assumed
darwin_closure.S:155:Missing ')' assumed
darwin_closure.S:155:Missing ')' assumed
darwin_closure.S:155:Parameter syntax error (parameter 2)
darwin_closure.S:156:Missing ')' assumed
darwin_closure.S:156:Missing ')' assumed
darwin_closure.S:156:Missing ')' assumed
darwin_closure.S:156:Parameter syntax error (parameter 2)
darwin_closure.S:178:Missing ')' assumed
darwin_closure.S:178:Missing ')' assumed
darwin_closure.S:178:Parameter syntax error (parameter 3)
darwin_closure.S:181:Missing ')' assumed
darwin_closure.S:181:Missing ')' assumed
darwin_closure.S:181:Parameter syntax error (parameter 3)
darwin_closure.S:201:Missing ')' assumed
darwin_closure.S:201:Missing ')' assumed
darwin_closure.S:201:Parameter syntax error (parameter 3)
../src/powerpc/darwin_closure.S:455:Missing ')' assumed
../src/powerpc/darwin_closure.S:455:Parameter syntax error (parameter 3)
gmake[3]: *** [src/powerpc/darwin_closure.lo] Error 1
gmake[2]: *** [all-recursive] Error 1
gmake[1]: *** [all] Error 2
gmake: *** [all-all] Error 2

I have a copy of the Apple Mac OSX Assembler Guide (dated 2005), but  
could not find the entry for the commands "sgu" or "sg", so am unsure  
what the exact syntax should be for these assembler commands.

Where is the constant __ppc64__ defined in the code? Is it defined in  
libffi code itself somewhere, or in the OSX system headers ? I  
compared my G4 with my G5 and could not find __ppc64__ defined in the  
system headers there either.

Any tips or ideas about this would be greatly appreciated!

Thanks,

--Ed


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Problem with darwin_closure.S on 10.4.11/gcc 4.3.3
  2013-10-23 13:13 Problem with darwin_closure.S on 10.4.11/gcc 4.3.3 mansky
@ 2013-10-23 16:03 ` Jay K
  2013-10-23 17:51   ` Ed Mansky
  0 siblings, 1 reply; 4+ messages in thread
From: Jay K @ 2013-10-23 16:03 UTC (permalink / raw)
  To: mansky, libffi-discuss

----------------------------------------
> CC: mansky@mindspring.com
> From: mansky@mindspring.com
>
>...
> Where is the constant __ppc64__ defined in the code? Is it defined in
> libffi code itself somewhere, or in the OSX system headers ? I
> compared my G4 with my G5 and could not find __ppc64__ defined in the
> system headers there either.
>...
>
> Thanks,
> --Ed


 #defines often come from within cc. 
 Try this: 

  echo> 1.c   
  echo> 1.s   

    cc -dM -c  1.s -E    
    cc -dM -c  1.c -E    

  or  

    cc -arch ppc -dM -c  1.s -E  | grep ppc  

    cc -m64 -arch ppc -dM -c  1.s -E  | grep ppc  


(man gcc> 1.txt ; edit 1.txt) 


 - Jay 		 	   		  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Problem with darwin_closure.S on 10.4.11/gcc 4.3.3
  2013-10-23 16:03 ` Jay K
@ 2013-10-23 17:51   ` Ed Mansky
  2013-10-23 18:16     ` David Fang
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Mansky @ 2013-10-23 17:51 UTC (permalink / raw)
  To: libffi-discuss; +Cc: jay.krell

Thanks Jay, that tip was very helpful. I didn't think about the 
define coming from cc.

In my case, it is indeed __ppc__ that is defined as expected for my 
PPC 7450 G4.

I have narrowed down the issue to version 3.0.10.

I downloaded 3.0.4 of libffi. Builds fine on Darwin 8.11.0 on my G4
version 3.0.9 builds too, some warnings from ffi_darwin.c in function ffi_call.
version 3.0.10 build fails with the same errors in darwin_closure.S I 
noted earlier.

So, the code that was added in 3.0.10 to darwin_closure.S, 
specifically the SAVE_SIZE define used in LCFI1 label in the sgu 
command seems to be a problem.

I'd be happy to look into these, if anyone could point me to the 
right OSX assembler manual that has sg and sgu commands in it, that 
would be great.

For now, I'll fall back to 3.0.4 and go with that version.

--Ed

>---------------------------------------- > CC: 
>mansky@mindspring.com > From: mansky@mindspring.com > >... > Where 
>is the constant __ppc64__ defined in the code? Is it defined in > 
>libffi code itself somewhere, or in the OSX system headers ? I > 
>compared my G4 with my G5 and could not find __ppc64__ defined in 
>the > system headers there either. >... > > Thanks, > --Ed  #defines 
>often come from within cc.   Try this:    echo> 1.c      echo> 1.s 
>cc -dM -c  1.s -E         cc -dM -c  1.c -E       or       cc -arch 
>ppc -dM -c  1.s -E  | grep ppc       cc -m64 -arch ppc -dM -c  1.s 
>-E  | grep ppc   (man gcc> 1.txt ; edit 1.txt)   - Jay 
>	  


-- 
E. J. Mansky II
Eikonal Research Institute
Bend, Oregon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Problem with darwin_closure.S on 10.4.11/gcc 4.3.3
  2013-10-23 17:51   ` Ed Mansky
@ 2013-10-23 18:16     ` David Fang
  0 siblings, 0 replies; 4+ messages in thread
From: David Fang @ 2013-10-23 18:16 UTC (permalink / raw)
  To: Ed Mansky; +Cc: libffi-discuss, jay.krell

Hi,
 	It might also help to direct gcc (-B) to use a newer assembler, 
or in this case directly invoke a newer assembler.  I often have to use 
odcctools' "as" (circa 2009-08-08) on powerpc-darwin8.  It should be 
available through fink (package I maintain) or macports.
 	In fink, we've never been able to get libffi tests to pass after 
3.0.4 on powerpc-darwin8.  I have a bug report here:
https://github.com/atgreen/libffi/issues/53
 	I suspect there are some incompatibilities with the 
system libunwind and unwind info, which changed from darwin9 to darwin10. 
I have not investigated further.

Fang

> Thanks Jay, that tip was very helpful. I didn't think about the define coming 
> from cc.
>
> In my case, it is indeed __ppc__ that is defined as expected for my PPC 7450 
> G4.
>
> I have narrowed down the issue to version 3.0.10.
>
> I downloaded 3.0.4 of libffi. Builds fine on Darwin 8.11.0 on my G4
> version 3.0.9 builds too, some warnings from ffi_darwin.c in function 
> ffi_call.
> version 3.0.10 build fails with the same errors in darwin_closure.S I noted 
> earlier.
>
> So, the code that was added in 3.0.10 to darwin_closure.S, specifically the 
> SAVE_SIZE define used in LCFI1 label in the sgu command seems to be a 
> problem.
>
> I'd be happy to look into these, if anyone could point me to the right OSX 
> assembler manual that has sg and sgu commands in it, that would be great.
>
> For now, I'll fall back to 3.0.4 and go with that version.
>
> --Ed
>
>> ---------------------------------------- > CC: mansky@mindspring.com > 
>> From: mansky@mindspring.com > >... > Where is the constant __ppc64__ 
>> defined in the code? Is it defined in > libffi code itself somewhere, or in 
>> the OSX system headers ? I > compared my G4 with my G5 and could not find 
>> __ppc64__ defined in the > system headers there either. >... > > Thanks, > 
>> --Ed  #defines often come from within cc.   Try this:    echo> 1.c 
>> echo> 1.s cc -dM -c  1.s -E         cc -dM -c  1.c -E       or       cc 
>> -arch ppc -dM -c  1.s -E  | grep ppc       cc -m64 -arch ppc -dM -c  1.s -E 
>> | grep ppc   (man gcc> 1.txt ; edit 1.txt)   - Jay
>> 
>
>
>

-- 
David Fang
http://www.csl.cornell.edu/~fang/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-23 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 13:13 Problem with darwin_closure.S on 10.4.11/gcc 4.3.3 mansky
2013-10-23 16:03 ` Jay K
2013-10-23 17:51   ` Ed Mansky
2013-10-23 18:16     ` David Fang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).