diff mbox

Go patch committed: Update libgo to Go release r60

Message ID yddr537z566.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Sept. 23, 2011, 2:47 p.m. UTC
Ian,

>>> Is tIOC defined in gen-sysinfo.go?  In <sys/termios.h>?  Does some other
>>
>> Only as
>>
>> // unknowndefine tIOC ('t'<<8)
>
> Ah.
>
> I committed this patch which may fix this problem.  Bootstrapped and ran
> Go testsuite on x86_64-unknown-linux-gnu.  You'll have to remove
> TARGET/libgo/s-sysinfo to force sysinfo.go to be rebuilt.

that does the trick to correctly define TIOCNOTTY and TIOCSCTTY on
Solaris.  I'm currently running a i386-pc-solaris2.10 bootstrap with a
single-line change to mksysinfo.sh:


I'm undecided if I need to add an autoconf check for that file.  At
least on Linux, IRIX, Solaris and Tru64 UNIX, it is present.  I'll deal
with the replacement of TIOCSCTTY by TIOCNXCL on IRIX separately.

Thanks.
	Rainer

Comments

Rainer Orth Sept. 23, 2011, 3:18 p.m. UTC | #1
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Ian,
>
>>>> Is tIOC defined in gen-sysinfo.go?  In <sys/termios.h>?  Does some other
>>>
>>> Only as
>>>
>>> // unknowndefine tIOC ('t'<<8)
>>
>> Ah.
>>
>> I committed this patch which may fix this problem.  Bootstrapped and ran
>> Go testsuite on x86_64-unknown-linux-gnu.  You'll have to remove
>> TARGET/libgo/s-sysinfo to force sysinfo.go to be rebuilt.
>
> that does the trick to correctly define TIOCNOTTY and TIOCSCTTY on
> Solaris.  I'm currently running a i386-pc-solaris2.10 bootstrap with a
> single-line change to mksysinfo.sh:

Unfortunately, the

/vol/gcc/src/hg/trunk/local/libgo/syscalls/exec.go:11:14: error: imported and not used: unsafe

error remains.  I've no idea what triggers it.

	Rainer
Ian Lance Taylor Sept. 23, 2011, 3:30 p.m. UTC | #2
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> that does the trick to correctly define TIOCNOTTY and TIOCSCTTY on
> Solaris.  I'm currently running a i386-pc-solaris2.10 bootstrap with a
> single-line change to mksysinfo.sh:
>
> diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
> --- a/libgo/mksysinfo.sh
> +++ b/libgo/mksysinfo.sh
> @@ -43,6 +43,7 @@ cat > sysinfo.c <<EOF
>  #include <netinet/tcp.h>
>  #include <signal.h>
>  #include <sys/ioctl.h>
> +#include <termios.h>
>  #if defined(HAVE_SYSCALL_H)
>  #include <syscall.h>
>  #endif
>
> I'm undecided if I need to add an autoconf check for that file.  At
> least on Linux, IRIX, Solaris and Tru64 UNIX, it is present.  I'll deal
> with the replacement of TIOCSCTTY by TIOCNXCL on IRIX separately.

Thanks, I went ahead and committed this patch.  <termios.h> was in
POSIX.1 from 1986 or thereabouts, so I think it is safe to use today.

Ian
Ian Lance Taylor Sept. 23, 2011, 5:45 p.m. UTC | #3
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Unfortunately, the
>
> /vol/gcc/src/hg/trunk/local/libgo/syscalls/exec.go:11:14: error: imported and not used: unsafe
>
> error remains.  I've no idea what triggers it.

Bother.  Neither do I.  I just looked through the code and it all looks
fine.  The reference to unsafe.Pointer will be parsed by
Parse::operand.  On one of the lines which uses unsafe.Pointer, it will
see "unsafe", see that it is a package, and call package->set_used().
That will set the flag which is later tested by Gogo::clear_file_scope
to prevent the warning.

I tried compiling the set of files which will be compiled on Solaris,
but still couldn't recreate the problem.

Ian
Rainer Orth Sept. 23, 2011, 5:51 p.m. UTC | #4
Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> Unfortunately, the
>>
>> /vol/gcc/src/hg/trunk/local/libgo/syscalls/exec.go:11:14: error: imported and not used: unsafe
>>
>> error remains.  I've no idea what triggers it.
>
> Bother.  Neither do I.  I just looked through the code and it all looks
> fine.  The reference to unsafe.Pointer will be parsed by
> Parse::operand.  On one of the lines which uses unsafe.Pointer, it will
> see "unsafe", see that it is a package, and call package->set_used().
> That will set the flag which is later tested by Gogo::clear_file_scope
> to prevent the warning.
>
> I tried compiling the set of files which will be compiled on Solaris,
> but still couldn't recreate the problem.

Ok, I'll do some digging over the weekend.  Perhaps I can figure it out.

Thanks.
        Rainer
Rainer Orth Sept. 26, 2011, 10:06 a.m. UTC | #5
Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> Unfortunately, the
>>
>> /vol/gcc/src/hg/trunk/local/libgo/syscalls/exec.go:11:14: error: imported and not used: unsafe
>>
>> error remains.  I've no idea what triggers it.
>
> Bother.  Neither do I.  I just looked through the code and it all looks
> fine.  The reference to unsafe.Pointer will be parsed by
> Parse::operand.  On one of the lines which uses unsafe.Pointer, it will
> see "unsafe", see that it is a package, and call package->set_used().
> That will set the flag which is later tested by Gogo::clear_file_scope
> to prevent the warning.
>
> I tried compiling the set of files which will be compiled on Solaris,
> but still couldn't recreate the problem.

the problem turned out to be obvious once you ignore most of the error
message ;-(  The spurious import is in sysinfo.go, which unconditionally
imports the package, but only uses in some cases.

For now, I've cheated and simply commented the `import "unsafe"' in
mksysinfo.sh.  I've not checked if you can emit that last if it has
actually been used anywere, or need a more involved scheme.

Apart from the (already fixed) go.* dejagnu errors, I noticed another
problem: the libgo net test now fails on Solaris, but only with Sun ld:

Undefined                       first referenced
 symbol                             in file
getaddrinfo                         _gotest_.o  (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
freeaddrinfo                        _gotest_.o  (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
gai_strerror                        _gotest_.o  (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
ld: fatal: symbol referencing errors. No output written to a.out
collect2: error: ld returned 1 exit status
FAIL: net

It seems like the test wants to be linked with -lsocket directly.  It
wasn't run before by default (though I'm pretty sure it worked if one
included it).  The latest merge has lost support for
GCCGO_RUN_ALL_TESTS.

	Rainer
diff mbox

Patch

diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -43,6 +43,7 @@  cat > sysinfo.c <<EOF
 #include <netinet/tcp.h>
 #include <signal.h>
 #include <sys/ioctl.h>
+#include <termios.h>
 #if defined(HAVE_SYSCALL_H)
 #include <syscall.h>
 #endif