Ludovic Courtès writes: Hi, >> Something like that: sizeof-ifconf is set to 16 (like on x86_64), but >> it's size should be 8. > > Oh, that’s because ‘define-c-struct’ does all the work at > macro-expansion time, with the host types and alignment constraints. I > wonder how we didn’t notice it earlier. Cross-compiling from x86_64 to > ARMv7 has the same problem, but maybe the networking ioctls work by > chance. > > The patch below appears to fix it: Yes, it fixes the struct sizes in the cross-compiled .go file. Thanks! I have added it as the attached patch to "wip-hurd-vm" for now. I did ./pre-inst-env guild compile --target=i586-pc-gnu -o syscalls.go guix/build/syscalls.scm and copied that to the Hurd. When running this (changed #$... to UPPERCASE) --8<---------------cut here---------------start------------->8--- (use-modules (guix build syscalls)) (define LOOPBACK? #t) (define IP "127.0.0.1" ) (define INTERFACE "lo") (define NETMASK #f) (define GATEWAY #f) (format #t "ifreq-struct-size: ~a\n" (@@ (guix build syscalls) ifreq-struct-size)) (format #t "sizeof-ifconf: ~s\n" (@@ (guix build syscalls) sizeof-ifconf)) (define (test) (let* ((addr (inet-pton AF_INET IP)) (sockaddr (make-socket-address AF_INET addr 0)) (mask (and NETMASK (inet-pton AF_INET NETMASK))) (maskaddr (and mask (make-socket-address AF_INET mask 0))) (gateway (and GATEWAY (inet-pton AF_INET GATEWAY))) (gatewayaddr (and gateway (make-socket-address AF_INET gateway 0)))) (configure-network-interface INTERFACE sockaddr (logior IFF_UP (if LOOPBACK? IFF_LOOPBACK 0)) #:netmask maskaddr) (when gateway (let ((sock (socket AF_INET SOCK_DGRAM 0))) (add-network-route/gateway sock gatewayaddr) (close-port sock))))) (test) --8<---------------cut here---------------end--------------->8--- Now I see the correct sizes... root@guixygnu# guile -L . -C . static.scm ;;; note: source file /root/static.scm ;;; newer than compiled /root/.cache/guile/ccache/3.0-LE-4-4.2/root/static.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /root/static.scm ;;; compiled /root/.cache/guile/ccache/3.0-LE-4-4.2/root/static.scm.go ifreq-struct-size: 32 sizeof-ifconf: 8 Backtrace: In ice-9/boot-9.scm: 1736:10 9 (with-exception-handler _ _ #:unwind? _ # _) In unknown file: 8 (apply-smob/0 #) In ice-9/boot-9.scm: 718:2 7 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 6 (_ #(#(#))) In ice-9/boot-9.scm: 2806:4 5 (save-module-excursion _) 4351:12 4 (_) In static.scm: 24:4 3 (test) In guix/build/syscalls.scm: 1529:8 2 (configure-network-interface "lo" #(2 2130706433 0) 9 # _) 1464:18 1 (_ _ "lo" _) In unknown file: Exception thrown while printing backtrace: In procedure primitive-call-ip: Wrong type argument in position 1 (expecting PRIMITIVE_P): # ERROR: Value out of range 0 to 4294967295: -1 ...but still/again a similar range error; Ideas? Greetings, janneke