public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gccgo on sparc
@ 2011-08-22 11:28 Maciej Bliziński
  2011-08-22 17:19 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Maciej Bliziński @ 2011-08-22 11:28 UTC (permalink / raw)
  To: gcc-help

I had a go at compiling the Go frontend on Solaris. The i386 build
completed fine, but the sparc build has failed.  I thought it would be
really cool to provide a sparc port of the Go language, so here are
some details of the problem, perhaps someone will have an idea how to
make it build.  The immediate problem looks like this: when building
syscall.o, the following error shows up:

sysinfo.go:3083:26: error: unexpected semicolon or newline in type declaration

Looking around the line 3083 of sysinfo.go, the difference between
i386/Solaris and sparc/Solaris is this:

i386 (builds fine):

type Iovec_len_t uint32
  type Iovec struct { Base *byte; Len Iovec_len_t; }
  type Msghdr_controllen_t uint32
  type Msghdr struct { Name *byte; Namelen uint32; Iov *Iovec; Iovlen
int32; Control *byte; Controllen Msghdr_controllen_t; Flags int32; }

sparc (build fails):

type Iovec_len_t int32
  type Iovec struct { Base _caddr_t; Len Iovec_len_t; }
  type Msghdr_controllen_t
  type Msghdr struct { Name *byte; Namelen uint32; Iov *Iovec; Iovlen
int32; msg_accrights _caddr_t; msg_accrightslen int32; }

The first observation is that on sparc there's nothing after the
Msghdr_controllen_t.  Does anyone have an advice where to look to make
it build?

Maciej

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

* Re: gccgo on sparc
  2011-08-22 11:28 gccgo on sparc Maciej Bliziński
@ 2011-08-22 17:19 ` Ian Lance Taylor
  2011-08-23 23:34   ` Maciej Bliziński
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2011-08-22 17:19 UTC (permalink / raw)
  To: Maciej Bliziński; +Cc: gcc-help

Maciej Bliziński <maciej@opencsw.org> writes:

> type Iovec_len_t int32
>   type Iovec struct { Base _caddr_t; Len Iovec_len_t; }
>   type Msghdr_controllen_t
>   type Msghdr struct { Name *byte; Namelen uint32; Iov *Iovec; Iovlen
> int32; msg_accrights _caddr_t; msg_accrightslen int32; }
>
> The first observation is that on sparc there's nothing after the
> Msghdr_controllen_t.  Does anyone have an advice where to look to make
> it build?

Which version of gcc are you building?  Best to stick with mainline for
this.

If you are using mainline, then what does the definition of "struct
msghdr" look like in <sys/socket.h> (it may be defined in some header
file #included by <sys/socket.h>)?

Also, look for "type _msghdr" in gen-sysinfo.go.  What does the type
look like?

The definition of Msghdr_controllen_t is generated by the shell script
mksysinfo.sh.  Something is going wrong there.

Ian

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

* Re: gccgo on sparc
  2011-08-22 17:19 ` Ian Lance Taylor
@ 2011-08-23 23:34   ` Maciej Bliziński
  2011-08-24  0:30     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Maciej Bliziński @ 2011-08-23 23:34 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

2011/8/22 Ian Lance Taylor <iant@google.com>:
> Maciej Bliziński <maciej@opencsw.org> writes:
>
>> type Iovec_len_t int32
>>   type Iovec struct { Base _caddr_t; Len Iovec_len_t; }
>>   type Msghdr_controllen_t
>>   type Msghdr struct { Name *byte; Namelen uint32; Iov *Iovec; Iovlen
>> int32; msg_accrights _caddr_t; msg_accrightslen int32; }
>>
>> The first observation is that on sparc there's nothing after the
>> Msghdr_controllen_t.  Does anyone have an advice where to look to make
>> it build?
>
> Which version of gcc are you building?  Best to stick with mainline for
> this.

I started with the gcc-4.6.1 tarball.

> If you are using mainline, then what does the definition of "struct
> msghdr" look like in <sys/socket.h> (it may be defined in some header
> file #included by <sys/socket.h>)?

maciej@unstable9s :~/src/opencsw/pkg/gcc4/branches/gccgo > ggrep -A14
"struct msghdr {" /usr/include/sys/socket.h
struct msghdr {
        void            *msg_name;              /* optional address */
        socklen_t       msg_namelen;            /* size of address */
        struct iovec    *msg_iov;               /* scatter/gather array */
        int             msg_iovlen;             /* # elements in msg_iov */

#if defined(_XPG4_2) || defined(_KERNEL)
        void            *msg_control;           /* ancillary data */
        socklen_t       msg_controllen;         /* ancillary data buffer len */
        int             msg_flags;              /* flags on received message */
#else
        caddr_t         msg_accrights;  /* access rights sent/received */
        int             msg_accrightslen;
#endif  /* defined(_XPG4_2) || defined(_KERNEL) */
};

> Also, look for "type _msghdr" in gen-sysinfo.go.  What does the type
> look like?

Splitting into multi-line:

type _msghdr struct {
msg_name *byte;
msg_namelen uint32;
msg_iov *_iovec;
msg_iovlen int32;
msg_accrights _caddr_t;
msg_accrightslen int32;
}

> The definition of Msghdr_controllen_t is generated by the shell script
> mksysinfo.sh.  Something is going wrong there.

Looking at mksysinfo.sh, the first thing I noticed is the use of the
"if ! ...; then ..; fi" construct together with "#!/bin/sh". On
Solaris, /bin/sh does not support the "if ! ..." syntax. You need to
say "if ...; then nothing; else ...; fi".

#!/bin/sh

# Invalid
if ! false; then
  echo "Test 1"
fi

# Valid
if false; then
  echo -n # nothing
else
  echo "Test 2"
fi

The other option is to use a different shell.

What's the exact problem with Msghdr_controllen_t I don't know yet, I
will look at the shell script more closely and reply again.

Maciej

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

* Re: gccgo on sparc
  2011-08-23 23:34   ` Maciej Bliziński
@ 2011-08-24  0:30     ` Ian Lance Taylor
  2011-08-24  8:13       ` Maciej Bliziński
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2011-08-24  0:30 UTC (permalink / raw)
  To: Maciej Bliziński; +Cc: gcc-help

Maciej Bliziński <maciej@opencsw.org> writes:

>> Which version of gcc are you building?  Best to stick with mainline for
>> this.
>
> I started with the gcc-4.6.1 tarball.

Most, perhaps all, of the issues you mention are fixed in mainline.

Ian

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

* Re: gccgo on sparc
  2011-08-24  0:30     ` Ian Lance Taylor
@ 2011-08-24  8:13       ` Maciej Bliziński
  0 siblings, 0 replies; 5+ messages in thread
From: Maciej Bliziński @ 2011-08-24  8:13 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

2011/8/24 Ian Lance Taylor <iant@google.com>:
> Maciej Bliziński <maciej@opencsw.org> writes:
>
>>> Which version of gcc are you building?  Best to stick with mainline for
>>> this.
>>
>> I started with the gcc-4.6.1 tarball.
>
> Most, perhaps all, of the issues you mention are fixed in mainline.

True.  I checked out trunk from subversion and it built with no
problems.  The OpenCSW package building system works best if you build
from tarballs, so I'll try the 4.7 snapshots now. I understand that
there shouldn't be a big difference between the mainline and the
latest snapshot.

Maciej

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

end of thread, other threads:[~2011-08-24  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22 11:28 gccgo on sparc Maciej Bliziński
2011-08-22 17:19 ` Ian Lance Taylor
2011-08-23 23:34   ` Maciej Bliziński
2011-08-24  0:30     ` Ian Lance Taylor
2011-08-24  8:13       ` Maciej Bliziński

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).