@@ -24,6 +24,9 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlin
new_rpaths = []
modified = False
for rpath in rpaths:
+ if rpath.startswith('/native-rpath-padding-'):
+ modified = True
+ continue
# If rpath is already dynamic copy it to new_rpath and continue
if rpath.find("$ORIGIN") != -1:
new_rpaths.append(rpath)
@@ -101,6 +101,7 @@ SSTATEPREINSTFUNCS = ""
SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
SSTATEPOSTINSTFUNCS = ""
EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR"
+EXTRA_STAGING_FIXMES:append:class-native = " NATIVE_RPATH_PADDING"
# Check whether sstate exists for tasks that support sstate and are in the
# locked signatures file.
@@ -580,6 +580,7 @@ BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
export CXXFLAGS = "${TARGET_CXXFLAGS}"
TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
+NATIVE_RPATH_PADDING = "/native-rpath-padding-${@'x' * (512 - len(d.expand('${STAGING_LIBDIR_NATIVE}:${STAGING_BASE_LIBDIR_NATIVE}:/native-rpath-padding-')))}"
export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
-L${STAGING_BASE_LIBDIR_NATIVE} \
-Wl,--enable-new-dtags \
@@ -587,6 +588,8 @@ export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
-Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
-Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
-Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
+ -Wl,-rpath,${NATIVE_RPATH_PADDING} \
+ -Wl,--build-id=none \
-Wl,-O1"
BUILDSDK_LDFLAGS = "-Wl,-O1"
Try to make sure that the RUNTIME dynamic entry size is the same for all binaries produced with the native compiler. This is necessary in order to produce identical binaries when using differently sized buildpaths. Remove the build ID since it depends on the rpath at link-time, otherwise binaries built in two different build paths will differ. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> --- meta/classes/chrpath.bbclass | 3 +++ meta/classes/sstate.bbclass | 1 + meta/conf/bitbake.conf | 3 +++ 3 files changed, 7 insertions(+)