unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70349: Clang fails to communicate RUNPATH?
@ 2024-04-12  9:36 Liliana Marie Prikler
  0 siblings, 0 replies; only message in thread
From: Liliana Marie Prikler @ 2024-04-12  9:36 UTC (permalink / raw)
  To: 70349

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

Hi Guix,

I've noticed a strange error when attempting to build my software
against clang-toolchain.  I've attached a minimally breaking example,
but the gist of it is that RUNPATH validation fails as shown below.

  starting phase `validate-runpath'
  validating RUNPATH of 1 binaries in
  "/gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin"...
  /gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin/hello:
  error: depends on 'libfmt.so.9', which cannot be found in RUNPATH
  ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib")

Is this expected?  I know that the -for-system have historically
disregarded the existence of clang-toolchain and hence led to issues,
but I think this is something else…

Cheers

[-- Attachment #2: why-hello.scm --]
[-- Type: text/x-scheme, Size: 1446 bytes --]

(use-modules (gnu packages pretty-print)
             (gnu packages pkg-config)
             (guix packages)
             (guix gexp)
             (guix transformations)
             (guix build-system meson)
             ((guix licenses) #:select (gpl3+))
             ((guix git-download) #:select (git-file-name))
             (srfi srfi-26))

(define why-hello
  (package
   (name "why-hello")
   (version "0")
   (source (file-union (git-file-name name version)
            `(("hello.cpp" ,(plain-file "hello.cpp"
                       "\
#include <fmt/format.h>

int
main()
{
  fmt::print (\"{}\\n\", \"Hello, world\");
  return 0;
}
"))
              ("meson.build" ,(plain-file "meson.build"
                                          "\
project('hello', 'cpp', default_options: ['cpp_std=c++20'])
executable('hello', files('hello.cpp'), install: true,
           dependencies: [dependency('fmt')])
")))))
   (build-system meson-build-system)
   (inputs (list fmt))
   (native-inputs (list pkg-config))
   (home-page (and=> (current-filename)
                     (cute string-append "file://" <>)))
   (synopsis "Hello world")
   (description "This package provides a simple program that builds with
GCC/G++ normally, but fails miserably when the clang-toolchain is used.")
   (license gpl3+)))

(define why-hello-clang
  ((options->transformation
    '((with-c-toolchain . "why-hello=clang-toolchain")))
   why-hello))

why-hello-clang

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-12  9:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12  9:36 bug#70349: Clang fails to communicate RUNPATH? Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).