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 <[email protected]> --- meta/classes/chrpath.bbclass | 5 ++++- meta/conf/bitbake.conf | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass index 26b984c4db..a0f2cf0598 100644 --- a/meta/classes/chrpath.bbclass +++ b/meta/classes/chrpath.bbclass @@ -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 diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index fba99e8f0c..1799127c2a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -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"
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#159184): https://lists.openembedded.org/g/openembedded-core/message/159184 Mute This Topic: https://lists.openembedded.org/mt/87507058/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
