This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Go patch committed: Implement new syscall package


Ian,

> It's possible that this patch will once again break the Solaris and Irix
> support.  I've tried to ensure that I didn't make any stupid errors, but
> I haven't done any actual testing.  Sorry about any problems.

it did (as expected :-), but in easy to fix ways (at least for getting
libgo to compile again):

* go/syscall/wait.c doesn't compile on Solaris (cannot test IRIX right
  now since bootstrap is broken):

/vol/gcc/src/hg/trunk/local/libgo/go/syscall/wait.c: In function 'TrapCause':
/vol/gcc/src/hg/trunk/local/libgo/go/syscall/wait.c:98:22: error: unused parameter 'w' [-Werror=unused-parameter]

  I'm marking the arg as unused to work around this since including it
  in #ifndef __linux__ seemed uglier.  I'll check if I can find the trap
  cause from the wait status, but a quick check of Solaris manpages and
  headers found nothing (at least not via wait* functions).

* sys/syscall/exec_unix.go doesn't compile either:

/vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_unix.go:163:21: error: reference to undefined name '_PTRACE_TRACEME'

  forkAndExecInChild uses _PTRACE_TRACEME, but mksysinfo only emitted
  PTRACE_TRACEME if _PTRACE_TRACEME is missing.

Unfortunately, testsuite results are a mess: all link tests fail like
this:

Undefined			first referenced
 symbol  			    in file
flock                               /var/gcc/regression/trunk/10-gcc/build/i386-pc-solaris2.10/libgo/.libs/libgo.so
ld: fatal: symbol referencing errors. No output written to a.out
collect2: error: ld returned 1 exit status
FAIL: asn1

The 64-bit tests are even worse:

Undefined			first referenced
 symbol  			    in file
flock                               /var/gcc/regression/trunk/10-gcc/build/i386-pc-solaris2.10/amd64/libgo/.libs/libgo.so
ptrace                              /var/gcc/regression/trunk/10-gcc/build/i386-pc-solaris2.10/amd64/libgo/.libs/libgo.so
ld: fatal: symbol referencing errors. No output written to a.out
collect2: error: ld returned 1 exit status
FAIL: asn1

I've not yet checked how to avoid this, but at least the ptrace stuff
worked (as in: didn't try to use 64-bit ptrace which doesn't exist)
before.

	Rainer


2011-10-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgo:
	* go/syscall/wait.c (TrapCause): Declare w unused.
	* mksysinfo.sh: Emit _PTRACE_TRACEME if missing.

diff --git a/libgo/go/syscall/wait.c b/libgo/go/syscall/wait.c
--- a/libgo/go/syscall/wait.c
+++ b/libgo/go/syscall/wait.c
@@ -95,7 +95,7 @@ extern int TrapCause (uint32_t *w)
   __asm__ ("libgo_syscall.syscall.TrapCause.N32_libgo_syscall.syscall.WaitStatus");
 
 int
-TrapCause (uint32_t *w)
+TrapCause (uint32_t *w __attribute__ ((unused)))
 {
 #ifndef __linux__
   return -1;
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -251,7 +251,7 @@ if ! grep '^const PTRACE_EVENT_EXIT' ${O
   echo "const PTRACE_EVENT_EXIT = 6" >> ${OUT}
 fi
 if ! grep '^const _PTRACE_TRACEME' ${OUT} > /dev/null 2>&1; then
-  echo "const PTRACE_TRACEME = 0" >> ${OUT}
+  echo "const _PTRACE_TRACEME = 0" >> ${OUT}
 fi
 
 # The registers returned by PTRACE_GETREGS.  This is probably


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]