On Fri, Apr 16, 2021 at 2:28 AM Shiva <emailshivasubraman...@gmail.com> wrote:
>
> Since I haven't generated the various ztypes_nsx_GOARCH.go files, I think I 
> need to use +build nsx and not ignore the build for types_nsx.go.
>
> I found a way to run bootstrap.bat on windows but I was told that I had to 
> run make.bat instead, so I did. I had to add "nsx" to the array 'okgoos' in 
> cmd\dist\build.c to be able to run make.bat so I did that too. And the output 
> from make.bat had a lot of the same warning 'this statement may fall through 
> [-Wimplicit-fallthrough=]' and I ignored them. And I had to update sym.c 
> (liblink)'s headers array with an entry for nsx which made me realise that 
> the following files will need to have 'switch cases' for Hnsx on a bunch of 
> other asm*/obj files under cmd\*l and liblink. So I did them too.
>
>  I know that I also have to update cmd\ld\elf.c where I see three references 
> required for Hnsx - one at elfinit and the other two under asmbelf function - 
> one while setting interpreter and the other for setting elf protected headers 
> (?). But I'm uncertain about the changes required in that file especially the 
> one setting the interpreter because that requires pointing to the dynamic 
> linker loader (different ones for OABI and EABI) in asm.c under cmd\*l 
> directories? Can you please advise?

I think you are on the wrong path here.  The idea of using
bootstrap.bash is that you should not have to edit any of the Go 1.4 C
code at all.  The idea is that you run bootstrap.bash on a system that
already has a working Go compiler installed.  That working Go compiler
is then used as a cross-compiler to build a toolchain that will run on
nsx.  That requires editing the Go tip code to support nsx.  It does
not require editing any of the Go 1.4 code, and should not require
editing any C code at all.

Ian


> On Wednesday, April 14, 2021 at 8:25:55 PM UTC+1 Ian Lance Taylor wrote:
>>
>> On Wed, Apr 14, 2021 at 8:25 AM Shiva <emailshiva...@gmail.com> wrote:
>> >
>> > One file specifically, types_linux.go which I duped into types_nsx.go has 
>> > a build statement that goes like this '+build ignore'. Github discussions 
>> > around this suggest to me that I don't have to build this? But happy to be 
>> > corrected.
>>
>> The "+build ignore" line means that the file will not be built as part
>> of an ordinary "go build" or "go install". For a file like
>> syscall/types_linux.go, that is because the file originally served as
>> input to cgo -godefs as part of generating the various
>> ztypes_linux_GOARCH.go files.
>>
>> > Also, can I build the bootstrap on windows or can I only do it in a POSIX 
>> > environment - I don't see bootstrap.bat and running bootstrap.bash with 
>> > GOOS=nsx and GOARCH=amd64 simply returns back the prompt?
>>
>> You should be able to build a bootstrap on Windows but you'll have to
>> either replicate bootstrap.bash in a Windows style, or you'll have to
>> use something like cygwin to run the bootstrap.bash shell script.
>> There aren't that many real commands in bootstrap.bash so I think that
>> creating a minimal bootstrap.bat would be fairly simple.
>>
>> 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 golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/420ce2be-b241-435f-89f9-b5f7c121bb9an%40googlegroups.com.

-- 
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/CAOyqgcVeX2bTbP0jdwQGAC3w4Ew04agKEa3w%3DiNyFVFMcQKoCw%40mail.gmail.com.

Reply via email to