all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 'libstdc++.so.6' cannot be found in RUNPATH ()
@ 2018-06-25 18:45 Hinko Kocevar
  2018-06-25 19:03 ` Pierre Neidhardt
  2018-06-26 11:43 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Hinko Kocevar @ 2018-06-25 18:45 UTC (permalink / raw)
  To: help-guix@gnu.org

Hi,

I have a prebuilt shared library that depends on 'libstdc++.so.6'. For that I installed gcc@5.4.0:lib and added it to the propagated-inputs:

    (propagated-inputs
      `(("gcc:lib" ,gcc "lib")))

The package builds fine, but validate-runpath phase fails with messages:

starting phase `validate-runpath'
validating RUNPATH of 10 binaries in "/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib"...
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so.2: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so.2: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libshamrockcif.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libshamrockcif.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libshamrockcif.so.2: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libshamrockcif.so.2: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libandor.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libandor.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libandor.so.2: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libandor.so.2: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libshamrockcif.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libshamrockcif.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libshamrockcif.so.2: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64/libshamrockcif.so.2: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
phase `validate-runpath' failed after 0.0 seconds


I can see the path to gcc-5.4.0-lib/lib in exported LIBRARY_PATH inside the the environment-variables, after keep the build tree. If I enter the environment and then issue ldd the results looks like this:

hinxx@obzen /tmp/guix-build-epics-adandor-R2-7.drv-0/ADAndor-R2-7 $ ldd /gnu/store/y7i1a9nv3y45zm2zg1sp2wa0nlzdw9f0-epics-adandor-R2-7/lib/linux-x86_64/libandor.so
ldd: warning: you do not have execution permission for `/gnu/store/y7i1a9nv3y45zm2zg1sp2wa0nlzdw9f0-epics-adandor-R2-7/lib/linux-x86_64/libandor.so'
	linux-vdso.so.1 (0x00007ffd4b5fd000)
	libpthread.so.0 => /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libpthread.so.0 (0x00007f4ca7abe000)
	libdl.so.2 => /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libdl.so.2 (0x00007f4ca78ba000)
	librt.so.1 => /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/librt.so.1 (0x00007f4ca76b2000)
	libstdc++.so.6 => not found
	libm.so.6 => /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libm.so.6 (0x00007f4ca73a0000)
	libgcc_s.so.1 => not found
	libc.so.6 => /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libc.so.6 (0x00007f4ca7001000)
	/gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/ld-linux-x86-64.so.2 (0x00007f4ca85b4000)



Any ideas why is it failing to locate libstdc++.so.6?

TIA,
Hinko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 'libstdc++.so.6' cannot be found in RUNPATH ()
  2018-06-25 18:45 'libstdc++.so.6' cannot be found in RUNPATH () Hinko Kocevar
@ 2018-06-25 19:03 ` Pierre Neidhardt
  2018-06-25 19:57   ` Hinko Kocevar
  2018-06-26 11:43 ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Pierre Neidhardt @ 2018-06-25 19:03 UTC (permalink / raw)
  To: Hinko Kocevar; +Cc: help-guix@gnu.org

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

Hi Hinko!

Packaging is done in a sandboxed environment that is totally independent of your
installation.
So you don't need to install gcc at all.

You don't need to propagate the input either, because the end-user only cares
about the package, not the dependent libraries.

Last, you seem to have forgotten the version in the input.

Try with the following line instead:

    (inputs
      `(("gcc:lib" ,gcc-5 "lib")))

Hope that helps.



-- 
Pierre Neidhardt

Speak softly and own a big, mean Doberman.
		-- Dave Millman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 'libstdc++.so.6' cannot be found in RUNPATH ()
  2018-06-25 19:03 ` Pierre Neidhardt
@ 2018-06-25 19:57   ` Hinko Kocevar
  0 siblings, 0 replies; 6+ messages in thread
From: Hinko Kocevar @ 2018-06-25 19:57 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix@gnu.org

Hi Pierre!

thank you for the input. I've made the changes as suggested.
Sadly it does not help, I'm getting the same behavior.

Inside the environment-variables I can see the gcc-5.4.0-lib listed:

export LIBRARY_PATH="/gnu/store/bzn4wyrbdmfc1bd7lq05db5psfl5f8x8-perl-5.26.0/lib:/gnu/store/6hicns85s8ddp0y539wdspwx22ac2kmv-bzip2-1.0.6/lib:/gnu/store/g3nari57wcfnm00kv9bnpyzdzfq4h8pk-xz-5.2.2/lib:/gnu/store/msw2q7nr3vfmgwyxf15y0x7qbngs9y3d-file-5.30/lib:/gnu/store/9pq16kfcldqqcbd58mmfp37g3awhg4sd-gawk-4.1.4/lib:/gnu/store/nnykzgwfy8mwh2gmxm715sjxykg8qjwn-binutils-2.28/lib:/gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib:/gnu/store/y31sxrygd9ifpxra06bmlx8c52gbydd4-glibc-utf8-locales-2.25/lib:/gnu/store/mpa86gcr3wk7yzvbdxc58j5vddqcs3w0-epics-base-3.15.5/lib:/gnu/store/j9rxwf40xw2r5drycijl4l25l4bja8qv-epics-asyn-R4-33/lib:/gnu/store/f0m8rdd0vv0gdddi2grpcb5swxd5zp2f-epics-busy-R1-7/lib:/gnu/store/61fcp65n6jvaz2hyzy31im408h5a79yl-epics-autosave-R5-9/lib:/gnu/store/s55cw29248kzl3c61vgawb4csrbkivry-epics-calc-R3-7/lib:/gnu/store/6dv72pq83gv7y2qxk60rasa2dqjr2nmm-epics-sscan-R2-11/lib:/gnu/store/a35yjr26wizmj7vbxbf2s8x3p6g7hb4m-epics-seq-R2-2-6/lib:/gnu/store/gs898mgcbzi0zx5wikylz0zrb756mg75-epics-adsupport-R1-4/lib:/gnu/store/i4vqyz44pa31iypwbq06zvw52yk2jmlg-epics-adcore-R3-2/lib:/gnu/store/mipizipnr4y2hly9b429j8id1albbgqi-readline-7.0/lib:/gnu/store/2rzp2py00609lvkh977bfyxja7wd5idx-gcc-5.4.0-lib/lib:/gnu/store/09j7scnl3hahcmql986fsjpzj6gqsmzv-ncurses-6.0/lib"

Let me point out that the library depending on libstdc++.so.6 does not get compiled, nor does the package use it in anyway. What I'm getting at is that since libstdc++.so.6 is not actually referenced by the package in any way (though the failing lib), can it be that that gcc-5.4.0-lib gets stripped away somewhere along the way?

Thanks!
Hinko
________________________________________
From: Pierre Neidhardt <ambrevar@gmail.com>
Sent: Monday, June 25, 2018 9:03 PM
To: Hinko Kocevar
Cc: help-guix@gnu.org
Subject: Re: 'libstdc++.so.6' cannot be found in RUNPATH ()

Hi Hinko!

Packaging is done in a sandboxed environment that is totally independent of your
installation.
So you don't need to install gcc at all.

You don't need to propagate the input either, because the end-user only cares
about the package, not the dependent libraries.

Last, you seem to have forgotten the version in the input.

Try with the following line instead:

    (inputs
      `(("gcc:lib" ,gcc-5 "lib")))

Hope that helps.



--
Pierre Neidhardt

Speak softly and own a big, mean Doberman.
                -- Dave Millman

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 'libstdc++.so.6' cannot be found in RUNPATH ()
  2018-06-25 18:45 'libstdc++.so.6' cannot be found in RUNPATH () Hinko Kocevar
  2018-06-25 19:03 ` Pierre Neidhardt
@ 2018-06-26 11:43 ` Ludovic Courtès
  2018-06-26 12:35   ` Hinko Kocevar
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-06-26 11:43 UTC (permalink / raw)
  To: Hinko Kocevar; +Cc: help-guix@gnu.org

Hinko Kocevar <Hinko.Kocevar@esss.se> skribis:

> The package builds fine, but validate-runpath phase fails with messages:
>
> starting phase `validate-runpath'
> validating RUNPATH of 10 binaries in "/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib"...
> /gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()

What this phase does is traverse all the binaries and make sure that
every shared library they depend on (the ‘NEEDED’ entry of the ELF file)
can be found in their ‘RUNPATH’.  IOW, that’s a QA check that we make on
packages by default.

Packages built on systems that follow the file system hierarchy standard
(FHS) typically don’t do that because they assume that things like
libstdc++.so can be found in the “standard location”—i.e., /usr/lib or
similar.

Anyway, you can forcefully bypass this check if you think it’s unneeded,
by adding:

  #:validate-runpath? #f

to the ‘arguments’ field of your package.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 'libstdc++.so.6' cannot be found in RUNPATH ()
  2018-06-26 11:43 ` Ludovic Courtès
@ 2018-06-26 12:35   ` Hinko Kocevar
  2018-06-27 17:53     ` Timothy Sample
  0 siblings, 1 reply; 6+ messages in thread
From: Hinko Kocevar @ 2018-06-26 12:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix@gnu.org

Hi Ludovic,

Thank you for the insight.

Is there a way to have the check pass by other means (i.e not skip the check)?

I will resort to skipping the check as immediate solution.

/hinko
________________________________________
From: Ludovic Courtès <ludo@gnu.org>
Sent: Tuesday, June 26, 2018 1:43:01 PM
To: Hinko Kocevar
Cc: help-guix@gnu.org
Subject: Re: 'libstdc++.so.6' cannot be found in RUNPATH ()

Hinko Kocevar <Hinko.Kocevar@esss.se> skribis:

> The package builds fine, but validate-runpath phase fails with messages:
>
> starting phase `validate-runpath'
> validating RUNPATH of 10 binaries in "/gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib"...
> /gnu/store/i7qkw5j3d0rm00l2k88p0bbaj6b204fh-epics-adandor-R2-7/lib/linux-x86_64-debug/libandor.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()

What this phase does is traverse all the binaries and make sure that
every shared library they depend on (the ‘NEEDED’ entry of the ELF file)
can be found in their ‘RUNPATH’.  IOW, that’s a QA check that we make on
packages by default.

Packages built on systems that follow the file system hierarchy standard
(FHS) typically don’t do that because they assume that things like
libstdc++.so can be found in the “standard location”—i.e., /usr/lib or
similar.

Anyway, you can forcefully bypass this check if you think it’s unneeded,
by adding:

  #:validate-runpath? #f

to the ‘arguments’ field of your package.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 'libstdc++.so.6' cannot be found in RUNPATH ()
  2018-06-26 12:35   ` Hinko Kocevar
@ 2018-06-27 17:53     ` Timothy Sample
  0 siblings, 0 replies; 6+ messages in thread
From: Timothy Sample @ 2018-06-27 17:53 UTC (permalink / raw)
  To: Hinko Kocevar; +Cc: help-guix@gnu.org

Hi Hinko,

Hinko Kocevar <Hinko.Kocevar@esss.se> writes:

> Hi Ludovic,
>
> Thank you for the insight.
>
> Is there a way to have the check pass by other means (i.e not skip the check)?

One thing you could do is patch the RUNPATH of the library.  You can do
this with the ‘patchelf’ command.  A good starting place might be to
look at the Rust bootstrap package.  It uses ‘patchelf’ to update the
RUNPATH of binaries, and leaves the ‘validate-runpath’ phase in place.

> I will resort to skipping the check as immediate solution.
>
> /hinko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-27 17:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 18:45 'libstdc++.so.6' cannot be found in RUNPATH () Hinko Kocevar
2018-06-25 19:03 ` Pierre Neidhardt
2018-06-25 19:57   ` Hinko Kocevar
2018-06-26 11:43 ` Ludovic Courtès
2018-06-26 12:35   ` Hinko Kocevar
2018-06-27 17:53     ` Timothy Sample

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.