diff mbox

Hurd port for gcc go PATCH 1-4(23)

Message ID 1480103846.24382.99.camel@gmail.com
State New
Headers show

Commit Message

Svante Signell Nov. 25, 2016, 7:57 p.m. UTC
Hi,

Attached are patches to enable gccgo to build properly on Debian
GNU/Hurd on gcc-6 (6-6.2.1-5).

The first three patches are Debian-specific:

* debian_rules.defs.diff: Enables build of gccgo for GNU/Hurd

Define patches for the generated series file:
* debian_rules.patch.diff:  Enables split-stack support.
* debian_rules.patch.diff:  Does not enable split-stack support.

* src_gcc_config_i386_gnu.h.diff: Enable split-stack support

The test suite results are as follows:
Without split-stack support:
              === go Summary ===
# of expected passes            7359
# of unexpected failures        7
# of expected failures          1
# of untested testcases         10
# of unsupported tests          2
                === libgo Summary ===
# of expected passes            121
# of unexpected failures        13

With split-stack support:

                === go Summary ===
# of expected passes            7366
# of unexpected failures        8
# of expected failures          1
# of untested testcases         6
# of unsupported tests          2
                === libgo Summary ===
# of expected passes            120
# of unexpected failures        14

All failing go tests and more than half of the libgo tests are runtime
errors due to exception handling not working as expected:
Aborted
runtime_sighandler ...
fatal error: unexpected signal during runtime execution
panic: runtime error: invalid memory address or nil pointer dereference

The above problems are probably due to some remaining issues in
gnumach/hurd/glibc to be solved. According to Samuel Thibault these
problems can be handled late when the patches are accepted upstream or
in Debian gcc. Another more annoying gnumch/hurd/glibc bug is that the
built program go (go-6 in Debian) gets killed when executed from the
shell vi path, but not when issued directly: /usr/bin/go-6 works fine.
 go-6
Segmentation fault (core dumped)
gdb /usr/bin/go-6 -c ./core
warning: Unexpected size of section `.reg2/16883' in core file.
Core was generated by `go-6'.
Program terminated with signal SIGSEGV, Segmentation fault.

warning: Unexpected size of section `.reg2/16883' in core file.
#0  0x01e854ae in ?? ()
(gdb) bt
#0  0x01e854ae in ?? ()
#1  0x00000000 in ?? ()

Nevertheless, it seems like not so much is left for gccgo working
properly on GNU/Hurd.

Thanks!
diff mbox

Patch

Index: gcc-6-6.2.1-4.1/src/gcc/config/i386/gnu.h
===================================================================
--- gcc-6-6.2.1-4.1.orig/src/gcc/config/i386/gnu.h
+++ gcc-6-6.2.1-4.1/src/gcc/config/i386/gnu.h
@@ -37,11 +37,14 @@  along with GCC.  If not, see <http://www
 
 #ifdef TARGET_LIBC_PROVIDES_SSP
 
-/* Not supported yet.  */
-# undef TARGET_THREAD_SSP_OFFSET
-
-/* Not supported yet.  */
-# undef TARGET_CAN_SPLIT_STACK
-# undef TARGET_THREAD_SPLIT_STACK_OFFSET
+/* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
+#define TARGET_THREAD_SSP_OFFSET        0x14
 
+/* We only build the -fsplit-stack support in libgcc if the
+   assembler has full support for the CFI directives.  */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+#define TARGET_CAN_SPLIT_STACK
+#endif
+/* We steal the last transactional memory word.  */
+#define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
 #endif