From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 25 03:43:40 2022 Received: (at 58033) by debbugs.gnu.org; 25 Sep 2022 07:43:40 +0000 Received: from localhost ([127.0.0.1]:45778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocMId-0002JD-TC for submit@debbugs.gnu.org; Sun, 25 Sep 2022 03:43:40 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:44799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc3u9-0003sn-4s for 58033@debbugs.gnu.org; Sat, 24 Sep 2022 08:05:10 -0400 Received: by mail-pg1-f180.google.com with SMTP id c7so2528411pgt.11 for <58033@debbugs.gnu.org>; Sat, 24 Sep 2022 05:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lukaszolszewski-info.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=wVWzHmkB6Vuvpfe6kEerV3tO/Uf0SQq4YaFsBecY0A4=; b=4AJg4BpCgLzMamAINoE/SAh2PHX0F1KMo19wWCgs/L917cmIEG4gyr0sxwBH7qX/t8 J+ugPYFgHiIumM7fZUXh6cmLmjbrbLO7KbZFpGo+Mh/lNwhFxhnfAcLKax8LBDCKXF2E ssLFbR2RN6Iapr7lISheSuJZboN0f6kc3xtAESM4dLixv21uA2WgYI5UiiiBmbWtJj3D zd/m7NrBn2u3gmRrZjd4ddaDs075Vv5Epmvg+J7xF1xOzktHjtnpBaC6jTfzxsw9yT47 nGGIM10/ldAFRhOsEGc6Z1E23kONRfhLrRM+hJbDwLVjWjjWZ8iTZBkxnrv9iB3pgTyT RR5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=wVWzHmkB6Vuvpfe6kEerV3tO/Uf0SQq4YaFsBecY0A4=; b=fgnhCwZSwYjgI/KQonSvSZPBw5QurD099y8jnQadmAyqIoKvHAFKY0bazB6DslwKng uHZ4zq0cT4RJWndieW14T4ae99dBfGgc5YVNCQzx2i+wU1bSlCp0ACJbHIVGqJ2Lsff9 iraHEaMoHgdodfKd5k5kkwllDcYaEm0g/cnIeyQN3mfChzM1hKFh/SL8Rfuj7u3JZKp5 qtzzk54hbJWQ9lwcBFybVPHzHo9dC7KJpGZZGuwWhKUKQuBr7cxpZPoe7CXUHTIe3xAb xIDDJ53oEhqU5t6c/DF5TKA4nHzDqz1gD8qshq0Ae/VFZLzajE//cWD1u/7El20+4lBq 1ZgQ== X-Gm-Message-State: ACrzQf2PpJ9eBqsdxIvFtiCqL63FKIdlWI+9BRLDwKwPjdLAqnLRtIFY AelmLh7jVshNzI5F4RB90SQQHBxxqTlRq3xqLKP6fBxiFzBCtg== X-Google-Smtp-Source: AMsMyM4R3DX6TNgsaGlMYLpi4iRbxLvD4maLYAf+zYtJb6yqix+qWVzGCGzf9zd0zdIV/1URzQxsIlsNUcBYRvIGDlY= X-Received: by 2002:a63:1203:0:b0:43c:7fa:f306 with SMTP id h3-20020a631203000000b0043c07faf306mr11463747pgl.169.1664021102990; Sat, 24 Sep 2022 05:05:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lukasz Olszewski Date: Sat, 24 Sep 2022 14:04:24 +0200 Message-ID: Subject: Re: A bug in file-dynamic-info used by validate-runpath in gnu-build-system and others. To: 58033@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58033 X-Mailman-Approved-At: Sun, 25 Sep 2022 03:43:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Also, to ensure all the information is provided. This is the code that resulted in the binary header being transformed: (add-after 'install 'fix-issue-with-libs (lambda* (#:key inputs outputs #:allow-other-keys) (chdir "..") (use-modules (ice-9 ftw) (ice-9 regex) (ice-9 rdelim) (ice-9 popen) (ice-9 textual-ports)) (let* ((libdir (string-append #$output "/lib"))) ;; ------------------------------ ;; patchelf (define (get-rpaths file) (format #t "Getting rpaths from ~a ...~%" file) (let* ((port (open-input-pipe (string-append "patchelf --print-rpath " file))) (str (read-line port))) ; from (ice-9 rdelim) (close-pipe port) str)) (define (patch-elf file) (format #t "Patching ~a ...~%" file) (define rpath (string-append (get-rpaths file) ":" #$extra-libs "/lib")) (display (string-append "We're setting rpath:" rpath)) (invoke "patchelf" "--set-rpath" rpath file)) (for-each (lambda (file) (when (elf-file? file) (patch-elf file))) (find-files #$output ".*"))))) I can run the patch-elf procedure in repl and it runs fine, but being run during the build it results in the problematic elf header. The build was run twice with the same result both times. Regards, Lukasz