@@ -2,7 +2,7 @@ CHRPATH_BIN ?= "chrpath"
PREPROCESS_RELOCATE_DIRS ?= ""
def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlinks = False):
- import subprocess, oe.qa
+ import subprocess, oe.qa, re
with oe.qa.ELFFile(fpath) as elf:
try:
@@ -20,6 +20,9 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlin
# Throw away everything other than the rpath list
curr_rpath = out.partition("RPATH=")[2]
#bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
+ # Inject native libdir and baselibdir
+ curr_rpath = re.sub(r'/non/existent/libdir-native-marker-x+', d.expand('${STAGING_LIBDIR_NATIVE}'), curr_rpath)
+ curr_rpath = re.sub(r'/non/existent/base-libdir-native-marker-x+', d.expand('${STAGING_BASE_LIBDIR_NATIVE}'), curr_rpath)
rpaths = curr_rpath.strip().split(":")
new_rpaths = []
modified = False
@@ -585,8 +585,8 @@ export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
-Wl,--enable-new-dtags \
-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
-Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
- -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
- -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
+ -Wl,-rpath,${@'/non/existent/libdir-native-marker-'.ljust(256, 'x')} \
+ -Wl,-rpath,${@'/non/existent/base-libdir-native-marker-'.ljust(256, 'x')} \
-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. This is a first step for producing identical native binaries when using different build paths. 'zstd-native' is a working example. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> --- meta/classes/chrpath.bbclass | 5 ++++- meta/conf/bitbake.conf | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-)