Hi Than,

Thank you for the prompt reply, my apologies for not being descriptive of 
the context. 
Yes, it's a gollvm-compiled program on arm and we just started 
investigating the ABI part, I'm wondering if any documents about go's 
internals are available to help understand it and related areas more 
deeply. 

On Wednesday, July 17, 2019 at 12:12:54 AM UTC+8, Than McIntosh wrote:
>
> Hi,
>
> Just to make sure I understand the context for the question -- this is a 
> gollvm-compiled program that you are talking about, not something compiled 
> with the main Go compiler?
>
> If so, then there isn't anything special happening when Go calls into C, 
> both will share the same ABI / calling convention. 
>
> Also wanted to make sure you are aware that for Gollvm to work on Arm, the 
> compiler has to implement the ARM C ABI properly (which at the moment is 
> not implemented). See this thread for context:
>
> https://groups.google.com/d/msg/golang-nuts/Tf0BOTtEpOs/0Wdol4pMDgAJ
>
> Cheers, Than
>
>
> On Tue, Jul 16, 2019 at 12:01 PM xiang...@gmail.com <javascript:> <
> xiang...@gmail.com <javascript:>> wrote:
>
>> Hi Ian,
>>
>> Could you please share some code pointers or documents about how 'go' 
>> functions calling 'c' functions is implemented,
>> I'm looking into the following function 
>> at gofrontend/libgo/go/bytes/bytes.go:102, where c-function IndexByte in 
>> bytealg.c/bytealg.c:90
>> is called but with wrong argument bindings, the issue is sort of expected 
>> as a bunch of changes on arm are not in place now.
>> Thanks a lot. 
>>     
>> // IndexByte returns the index of the first instance of c in b, or -1 if 
>> c is not present in b.
>> func IndexByte(b []byte, c byte) int {
>> return bytealg.IndexByte(b, c)
>> }
>>
>>
>> On Tuesday, July 16, 2019 at 5:40:24 AM UTC+8, Ian Lance Taylor wrote:
>>>
>>> On Mon, Jul 15, 2019 at 7:39 AM Xiangdong Ji <xiang...@gmail.com> 
>>> wrote: 
>>> > 
>>> > I am trying to build gollvm on ARM with a few experimental changes, 
>>> looks like some ARM Neon intrinsics in 
>>> > libgo/runtime/aeshash.c are not supported by GCC 7/8, wo
>>
>>  
>>
>>> ndering if it could be solved by any additional compile 
>>> > options, or should the latest gcc-9 or clang be used? 
>>>
>>> The arm64 support in aeshash.c was added in GCC 9.  In general there 
>>> is no expectation that the files in GCC 9 can be compiled by earlier 
>>> versions of GCC.  Many times it will work, but not always, and this 
>>> may be a case where it fails (I haven't checked).  It's not feasible 
>>> for us to ensure that files distributed with GCC 9 can be compiled by 
>>> earlier versions of GCC. 
>>>
>>> In any case, if your goal is to build GoLLVM, then you should be 
>>> compiling this file with clang.  And it sounds like you can do that. 
>>> So there doesn't seem to be much reason to compile it with GCC.  I 
>>> understand that you are having trouble building GoLLVM, but it's not 
>>> clear to me why building this file with GCC rather than clang will 
>>> help with that. 
>>>
>>> Ian 
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golan...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/954aea89-c6ad-422a-9599-47336f0bec53%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/954aea89-c6ad-422a-9599-47336f0bec53%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1559c121-67db-402c-a8be-6674645cfdb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to