All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable
@ 2017-03-23  7:54 Wolfgang Grandegger
  2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 01/10] package/patchelf: use most recent version as a base for rpath sanitation Wolfgang Grandegger
                   ` (10 more replies)
  0 siblings, 11 replies; 35+ messages in thread
From: Wolfgang Grandegger @ 2017-03-23  7:54 UTC (permalink / raw)
  To: buildroot

Hello,

this is v3 of my RFC patch series to make the buildroot SDK (HOST_DIR)
relocatable. It sanitizes the RPATH of all ELF files in the "target"
and "host" tree using "patchelf --make-rpath-relative". I have started
the mainlining process implementing "--make-rpath-relative" using
GitHub pull request [1]... till now, no answer!

Furthermore this patch creates the script "relocate-sdk.sh" in the top
directory of the "host" tree allowing to relocate the SDK after it has
been moved to a new location. It replaces the old path with the new
one in all text files identified by "file --mime-type". The location
is stored in "usr/share/buildroot/sdk-location".

Unfortunately, "qmake" uses hard-coded pathes compiled into the QT5
libraries. To overcome this problem, "qt5pase" now creates "qt.conf".

Other Questions:

- Why do we want relative RPATHs starting with "$ORIGIN" also for ELF
  files in the target tree. "/lib" and "/usr/lib" have been removed
  already. 

Things not yet addressed:

- "make toolchain" creates a toolchain tree which still has references
  to the build system (in ELF and text files).  

Changes since v2:

- provide "qt.conf" to make "qmake" relocatable
- sed now uses the separator "\" to substitute the directory path.
  It's one of the few characters not allowed in file names. To
  avoid interpreting it as escape character, the "read -r" is used.
- The paranoia substituion check is done before doing the real
  substituion.

Changes since v1:

- The name SDK has been chosen for the relocatabed "HOST_DIR" (instead
  of toolchanin).
- The patchelf version bump and patching are now done by 2 patches
- No more helper functions are used in the Makefile to call "fix-rpath"
  but added directly.
- The staging tree is not touched any more... until we have a good
  reason to do so. 
- The sanitation is now performed by an optimized "fix-rpath" script.
- The relocate-sdk script is now copied for support/misc to the
  top directory of the host tree.

[1] https://github.com/NixOS/patchelf/pull/118

Samuel Martin (1):
  support/scripts: add fix-rpath script to sanitize the rpath

Wolfgang Grandegger (9):
  package/patchelf: use most recent version as a base for rpath
    sanitation
  package/patchelf: add patch for rpath sanitation under a root
    directory
  core: sanitize RPATH in host tree at the very end of the build
  core: sanitize RPATH in target tree at the end of the target
    finalization
  support/scripts: add reloacte-sdk.sh script for SDK relocation
  core: install relocation script and location at the end of the build
  external-toolchain: check if a buildroot SDK has already been
    relocated
  support/scripts: check-host-rpath now handles $ORIGIN as well
  package/qt5base: provide "qt.conf" to make "qmake" relocatable

 Makefile                                           |  10 +
 ...to-make-the-rpath-relative-under-a-specif.patch | 315 +++++++++++++++++++++
 package/patchelf/patchelf.hash                     |   2 +-
 package/patchelf/patchelf.mk                       |   6 +-
 package/qt5/qt5base/qt.conf.in                     |   6 +
 package/qt5/qt5base/qt5base.mk                     |   8 +
 support/misc/relocate-sdk.sh                       |  47 +++
 support/scripts/check-host-rpath                   |   2 +-
 support/scripts/fix-rpath                          | 103 +++++++
 toolchain/helpers.mk                               |  15 +
 .../toolchain-external/pkg-toolchain-external.mk   |   1 +
 11 files changed, 510 insertions(+), 5 deletions(-)
 create mode 100644 package/patchelf/0001-Add-option-to-make-the-rpath-relative-under-a-specif.patch
 create mode 100644 package/qt5/qt5base/qt.conf.in
 create mode 100755 support/misc/relocate-sdk.sh
 create mode 100755 support/scripts/fix-rpath

-- 
1.9.1

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

end of thread, other threads:[~2017-06-30 10:25 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23  7:54 [Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 01/10] package/patchelf: use most recent version as a base for rpath sanitation Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 02/10] package/patchelf: add patch for rpath sanitation under a root directory Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 03/10] support/scripts: add fix-rpath script to sanitize the rpath Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 04/10] core: sanitize RPATH in host tree at the very end of the build Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 05/10] core: sanitize RPATH in target tree at the end of the target finalization Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 06/10] support/scripts: add reloacte-sdk.sh script for SDK relocation Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 07/10] core: install relocation script and location at the end of the build Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 08/10] external-toolchain: check if a buildroot SDK has already been relocated Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 09/10] support/scripts: check-host-rpath now handles $ORIGIN as well Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 10/10] package/qt5base: provide "qt.conf" to make "qmake" relocatable Wolfgang Grandegger
2017-04-12 13:59 ` [Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable Arnout Vandecappelle
2017-04-27  9:37   ` Wolfgang Grandegger
2017-06-21  7:59     ` Wolfgang Grandegger
2017-06-21 21:03       ` Arnout Vandecappelle
2017-06-21 21:06         ` Arnout Vandecappelle
2017-06-27 10:54           ` Wolfgang Grandegger
2017-06-27 22:41             ` Arnout Vandecappelle
2017-06-28  6:51               ` Wolfgang Grandegger
2017-06-28 10:44                 ` Arnout Vandecappelle
2017-06-28 10:59                   ` Wolfgang Grandegger
2017-06-22  6:37         ` Wolfgang Grandegger
2017-06-27 22:47           ` Arnout Vandecappelle
2017-06-28  6:40             ` Peter Korsgaard
2017-06-28  6:45             ` Wolfgang Grandegger
2017-06-28 10:41               ` Arnout Vandecappelle
2017-06-28 10:57                 ` Wolfgang Grandegger
2017-06-28 11:16                   ` Arnout Vandecappelle
2017-06-28 12:36                     ` Wolfgang Grandegger
2017-06-28 19:33                       ` Arnout Vandecappelle
2017-06-29  6:13                         ` Wolfgang Grandegger
2017-06-29  8:02                           ` Wolfgang Grandegger
2017-06-30  8:50                             ` Wolfgang Grandegger
2017-06-30  9:14                               ` Wolfgang Grandegger
2017-06-30 10:25                                 ` Arnout Vandecappelle

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.