Skip to content
/ spack Public
forked from spack/spack
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gartung buildcache reconstruct rpaths #3

Closed
wants to merge 26 commits into from

Conversation

gartung
Copy link
Owner

@gartung gartung commented Feb 19, 2020

No description provided.

Store a dictionary mapping of original dependency prefixes to dependency hashes

Use the loaded spec to grab the new dependency prefixes in the new directory layout.

Map the original dependency prefixes to the new dependency prefixes using the dependency hashes.

Use the dependency prefixes map to replace original rpaths with new rpaths preserving the order.
For mach-o binaries, use the dependency prefixes map to replace the dependency library entires for libraries and executables and the replace the library id for libraries.

On Linux, patchelf is used to replace the rpaths of elf binaries.
On macOS, install_name_tool is used to replace the rpaths and  dependency libraries  of mach-o binaries and the id of mach-o libraries.
On Linux, macholib is used to replace the dependency libraries of mach-o binaries and the id of mach-o libraries.

Binary text with padding replacement is attempted for all binaries for the following paths:
spack layout root
spack prefix
sbang script location
dependency prefixes
package prefix
 Text replacement is attempted for all text files using the paths above.

Symbolic links to the absolute path of the package install prefix are replaced, all others produce warnings.
Conflicts:
	lib/spack/spack/binary_distribution.py
	lib/spack/spack/test/packaging.py
…paths' into gartung-buildcache-reconstruct-rpaths

Conflicts:
	lib/spack/spack/binary_distribution.py
	lib/spack/spack/test/packaging.py
This will allow matching specs from other archs, for example
installing macOS buildcaches on linux hosts.
@gartung gartung closed this Feb 25, 2020
gartung pushed a commit that referenced this pull request Jun 4, 2020
* Fixed building coreutils on Darwin

* Bump nano version to 4.9

* Coreutils: Add program prefix g so we don't conflict with Apple utilities

* Fix intendation

* Make format more spack like

* Removed unnecesary changes

* Merge branch 'develop' of github.com:DiegoMagdaleno/spack into develop

Fix linking libgit2 on Darwin

* Revert "Merge pull request #3 from spack/develop"

This reverts commit 58dbbdb, reversing
changes made to dd7a413.

* Revert "Revert "Merge pull request #3 from spack/develop""

This reverts commit f956aa7.

* Revert "Merge branch 'develop' of github.com:DiegoMagdaleno/spack into develop"

This reverts commit 50321f7.
gartung pushed a commit that referenced this pull request Aug 1, 2020
Whenever attempting to use any ncurses functionality within cscope, a
page fault would result within the ncurses library.

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7fad3cf in termattrs_sp () from .../lib/libncursesw.so.6
    (gdb) bt
    #0  0x00007ffff7fad3cf in termattrs_sp () from .../lib/libncursesw.so.6
    #1  0x00007ffff7faa794 in _nc_setupscreen_sp () from .../lib/libncursesw.so.6
    #2  0x00007ffff7fa614c in newterm_sp () from .../lib/libncursesw.so.6
    #3  0x00007ffff7fa65b9 in newterm () from .../lib/libncursesw.so.6
    #4  0x00007ffff7fa2970 in initscr () from .../lib/libncursesw.so.6
    #5  0x0000000000403dc2 in main (argc=<optimized out>, argv=0x7fffffffcea8) at main.c:574

This is due to a conflict between libtinfo.so and libtinfow.so. Both are
linked into cscope:

    $ ldd $(which cscope)
    /bin/bash: .../lib/libtinfo.so.6: no version information available (required by /bin/bash)
        linux-vdso.so.1 (0x00007fff5dbcb000)
        libncursesw.so.6 => .../lib/libncursesw.so.6 (0x00007f435cc69000)
        libtinfo.so.6 => .../lib/libtinfo.so.6 (0x00007f435cc2c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f435ca29000)
        libtinfow.so.6 => .../lib/libtinfow.so.6 (0x00007f435c9e8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f435cca7000)

Specifically linking libtinfow.so instead of libtinfo.so resolves the
issue.

All instances of '...' above represent the path to the installed ncurses
for Spack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant