From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ting-Wei Lan Subject: bug#35775: Test gremlin.scm fails on foreign distributions Date: Fri, 17 May 2019 21:44:01 +0800 Message-ID: <3df718af-5469-4f1e-6e60-ef0d93673616@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1610438DD40A35E732B72825" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRdAW-0006QG-W0 for bug-guix@gnu.org; Fri, 17 May 2019 09:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRdAU-0000Ky-KY for bug-guix@gnu.org; Fri, 17 May 2019 09:45:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRdAU-0000Ki-Fc for bug-guix@gnu.org; Fri, 17 May 2019 09:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hRdAU-0004jg-Ao for bug-guix@gnu.org; Fri, 17 May 2019 09:45:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:34877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRd9b-0005vz-7e for bug-guix@gnu.org; Fri, 17 May 2019 09:44:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRd9a-0007Mp-2i for bug-guix@gnu.org; Fri, 17 May 2019 09:44:07 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:45220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRd9Z-0007Lt-Qi for bug-guix@gnu.org; Fri, 17 May 2019 09:44:06 -0400 Received: by mail-pf1-x42f.google.com with SMTP id s11so3702920pfm.12 for ; Fri, 17 May 2019 06:44:05 -0700 (PDT) Received: from wn.lant.com.tw ([106.104.151.171]) by smtp.gmail.com with ESMTPSA id t5sm9900079pgn.80.2019.05.17.06.44.02 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 06:44:03 -0700 (PDT) Content-Language: en-US List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 35775@debbugs.gnu.org This is a multi-part message in MIME format. --------------1610438DD40A35E732B72825 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit There are two failed tests in tests/gremlin.scm. The first one is 'elf-dynamic-info-needed, executable'. It seems that it assumes the guile executable always links to libguile-2.2, libgc, libunistring, libffi. However, on Fedora 30, /usr/bin/guile2.2 only links to libguile-2.2, causing the test to fail because it cannot find libgc, libunistring, libffi in NEEDED. $ readelf -d /usr/bin/guile2.2 Dynamic section at offset 0x2d78 contains 28 entries:   Tag        Type                         Name/Value  0x0000000000000001 (NEEDED)             Shared library: [libguile-2.2.so.1]  0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]  0x000000000000000c (INIT)               0x1000  0x000000000000000d (FINI)               0x13b8  0x0000000000000019 (INIT_ARRAY)         0x3d60  0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)  0x000000000000001a (FINI_ARRAY)         0x3d68  0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)  0x000000006ffffef5 (GNU_HASH)           0x368  0x0000000000000005 (STRTAB)             0x5a0  0x0000000000000006 (SYMTAB)             0x3a8  0x000000000000000a (STRSZ)              339 (bytes)  0x000000000000000b (SYMENT)             24 (bytes)  0x0000000000000015 (DEBUG)              0x0  0x0000000000000003 (PLTGOT)             0x3f78  0x0000000000000002 (PLTRELSZ)           216 (bytes)  0x0000000000000014 (PLTREL)             RELA  0x0000000000000017 (JMPREL)             0x870  0x0000000000000007 (RELA)               0x780  0x0000000000000008 (RELASZ)             240 (bytes)  0x0000000000000009 (RELAENT)            24 (bytes)  0x0000000000000018 (BIND_NOW)             0x000000006ffffffb (FLAGS_1)            Flags: NOW PIE  0x000000006ffffffe (VERNEED)            0x720  0x000000006fffffff (VERNEEDNUM)         2  0x000000006ffffff0 (VERSYM)             0x6f4  0x000000006ffffff9 (RELACOUNT)          3  0x0000000000000000 (NULL)               0x0 I guess it may be related to the use of -Wl,--as-needed. The default LDFLAGS for building packages includes -Wl,--as-needed since Fedora 30. The second one is 'strip-runpath'. It seems that the reason is that strip-runpath expects the executable to have RUNPATH because -Wl,-rpath is used during linking. However, on systems which don't configure ld to use --enable-new-dtags by default, RPATH is used instead of RUNPATH, causing strip-runpath to fail. If I add '-Wl,--enable-new-dtags' to the C compiler command line used by the test, the test passes. expected-value: "hello\n" actual-value: #f actual-error: + (wrong-type-arg +   "struct_vtable" +   "Wrong type argument in position ~A (expecting ~A): ~S" +   (1 "struct" #f) +   (#f)) result: FAIL I attached a patch which makes the tests pass on Fedora 30, but I am not sure whether it is the correct way to fix things. --------------1610438DD40A35E732B72825 Content-Type: text/x-patch; name="guix-1.0.0-tests-gremlin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="guix-1.0.0-tests-gremlin.patch" diff --git a/tests/gremlin.scm b/tests/gremlin.scm index 77a5dc1998..b0bb7a8e49 100644 --- a/tests/gremlin.scm +++ b/tests/gremlin.scm @@ -52,7 +52,7 @@ (or (not dyninfo) ;static executable (lset<= string=? (list (string-append "libguile-" (effective-version)) - "libgc" "libunistring" "libffi") + "libc") (map (lambda (lib) (string-take lib (string-contains lib ".so"))) (elf-dynamic-info-needed dyninfo)))))) @@ -79,7 +79,7 @@ (lambda (port) (display "int main () { puts(\"hello\"); }" port))) (invoke c-compiler "t.c" - "-Wl,-rpath=/foo" "-Wl,-rpath=/bar") + "-Wl,--enable-new-dtags" "-Wl,-rpath=/foo" "-Wl,-rpath=/bar") (let* ((dyninfo (elf-dynamic-info (parse-elf (call-with-input-file "a.out" get-bytevector-all)))) --------------1610438DD40A35E732B72825--