Trying to get Pike (7.8.700 still) to compile on Debian GNU/Hurd (which was officially released(!) on May 23, for some value of "released"), I found three issues:
1. PATH_MAX used as the size of the buffer passed to realpath() in system.c. pathnames can be arbirarily long on Hurd, so one should in this instance pass NULL to realpath and let it allocate the returned string itself.
2. mach/message.h, which defines mach_msg_type_number_t, is not included by mach/task_info.h (or either of the other two .h files); we have to include it ourselves directly.
3. The GTK2 module uses a couple of Xlib functions without explicitly linking with -lX11, instead relying on the GTK libs to pull it in. This practice is discouraged/deprecated, but apparently still works with the toolchains on most of the architectures; I don't know why Debian GNU/Hurd is different in this regard.
I've created a patch that addresses these issues, but I'm not sure if it integrates in the most clean way. It's also untested, because pike dies right away when run to generate the documentation (I've: uncommented the several fprintf calls in object.c):
Need a new master object... Builtin_constants: 0x871ae3c Cannot load master object yet! /home/holmgren/pike7.8-7.8.700/src/object.c:695: Fatal error: Couldn't load master object. No stack - no backtrace.
Backtrace from gdb: #9 0x08144d47 in debug_fatal (fmt=fmt@entry=0x84b6eb7 "Couldn't load master object.\n") at /home/holmgren/pike7.8-7.8.700/src/error.c:654 #10 0x08186ce9 in debug_master () at /home/holmgren/pike7.8-7.8.700/src/object.c:695 #11 0x083beca9 in resolve_syms () at /Users/hww3/pike- build/src/post_modules/GSSAPI/gssapi.cmod:434 #12 0x083bf12d in get_dd_oid (gss_oid=0x182d8c0) at /Users/hww3/pike- build/src/post_modules/GSSAPI/gssapi.cmod:351 #13 0x083ca9c8 in pike_module_GSSAPI_init () at /Users/hww3/pike- build/src/post_modules/GSSAPI/gssapi.cmod:4450 #14 0x082106d7 in init_modules () at /home/holmgren/pike7.8-7.8.700/src/module.c:424 #15 0x0817b7a5 in init_pike_runtime (exit_cb=0x80e6f00 exit@plt) at /home/holmgren/pike7.8-7.8.700/src/pike_embed.c:418 #16 0x080e8f1d in main (argc=4, argv=0x3dffd68) at /home/holmgren/pike7.8-7.8.700/src/main.c:610
It seems that _static_modules isn't set yet. Any idea why? Or rather, why is debug_master() called while initializing the static modules?
Oh, now I know! The problem is of course that the modules aren't being linked dynamically at all. That's probably the reason behind issue #3, too. I guess there's been some code rot because nobody ever links the modules statically. You might want to look into why static modules don't work - but probably not...
On torsdagen den 6 juni 2013, Magnus Holmgren wrote:
Oh, now I know! The problem is of course that the modules aren't being linked dynamically at all. That's probably the reason behind issue #3, too. I guess there's been some code rot because nobody ever links the modules statically. You might want to look into why static modules don't work - but probably not...
Excerpt from config.log:
configure:75019: checking if dynamic loading works /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -c -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O3 -pipe - ggdb3 -fPIC conftest.c -o conftest.o /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -Wl,-Bshareable -Wl,-z,relro -Wl,--as-needed -L/home/holmgren/pike7.8-7.8.700/build/gnu-0.3-i686- at386/bundles/lib32 -L/home/holmgren/pike7.8-7.8.700/build/gnu-0.3-i686-at386/bundles/lib/32 -L/home/holmgren/pike7.8-7.8.700/build/gnu-0.3-i686- at386/bundles/lib/. -L/usr/lib/gcc/i486-gnu/4.7 -R/usr/lib/gcc/i486-gnu/4.7 -L/usr/lib/i386-gnu -R/usr/lib/i386-gnu -L/lib/i386-gnu -R/lib/i386-gnu conftest.o -o conftest.so /usr/lib/i386-gnu/libcrt_nonshared.a(elf-init.oS): In function `__libc_csu_init': (.text+0x2b): undefined reference to `__init_array_end' /usr/bin/ld.bfd.real: /usr/lib/i386-gnu/libcrt_nonshared.a(elf-init.oS): relocation R_386_GOTOFF against undefined hidden symbol `__init_array_end' can not be used when making a shared object /usr/bin/ld.bfd.real: final link failed: Bad value collect2: error: ld returned 1 exit status configure:75083: result: no
On torsdagen den 6 juni 2013, Magnus Holmgren wrote:
On torsdagen den 6 juni 2013, Magnus Holmgren wrote:
Oh, now I know! The problem is of course that the modules aren't being linked dynamically at all. That's probably the reason behind issue #3, too. I guess there's been some code rot because nobody ever links the modules statically. You might want to look into why static modules don't work - but probably not...
Excerpt from config.log:
configure:75019: checking if dynamic loading works /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -c -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O3 -pipe - ggdb3 -fPIC conftest.c -o conftest.o /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -Wl,-Bshareable -Wl,-z,relro -Wl,--as-needed
What "GNU" system did you have in mind here?
GNU*) LDSHARED="$REALCC -Wl,-Bshareable";;
(src/configure.in line 7893). With the usual -shared, building dynamic modules works.
On torsdagen den 6 juni 2013, Magnus Holmgren wrote:
Excerpt from config.log:
configure:75019: checking if dynamic loading works /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -c -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O3 -pipe - ggdb3 -fPIC conftest.c -o conftest.o /home/holmgren/pike7.8-7.8.700/bin/smartlink gcc -Wl,-Bshareable -Wl,-z,relro -Wl,--as-needed
What "GNU" system did you have in mind here?
GNU*) LDSHARED="$REALCC -Wl,-Bshareable";;
(src/configure.in line 7893). With the usual -shared, building dynamic modules works.
It looks like it supposed to be for GNU Hurd as of September 1997:
commit fee8ccc0f72ef9278a0ceaf9c75088d31ab6d9a0 Author: Niels Möller nisse@lysator.liu.se Date: Sun Sep 21 23:08:02 1997 +0200
Recognize the GNU Hurd.
Rev: src/configure.in:1.121
pike-devel@lists.lysator.liu.se