summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2022-02-04 20:59:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-07 10:08:59 +0000
commit0f82f85dc9f8caf1fbf08af24ee98cbd5b5668a0 (patch)
tree9808d1f6d8c149a2a8393ce23357d5fcdc8b02b1 /scripts
parent276975e4ea78691d092ddcca50098ed177357a74 (diff)
downloadpoky-0f82f85dc9f8caf1fbf08af24ee98cbd5b5668a0.tar.gz
runqemu: preload uninative libraries when host gl drivers are in use
Some of the host distributions build the drivers in a way (RPATH/RUNPATH) that tricks uninative loader into loading pieces of the host libc, if the same pieces haven't been previously loaded by native binaries. Mixing the two libc versions leads to failures. This change ensures that the correct (uninative) versions are always in use. (From OE-Core rev: 39c10816d5ec9d9c7952d786d7a3f942d25d0c27) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 07429372ea..5c108ec23a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -461,6 +461,14 @@ class BaseConfig(object):
461 raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") 461 raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.")
462 os.environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip() 462 os.environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip()
463 463
464 # This preloads uninative libc pieces and therefore ensures that RPATH/RUNPATH
465 # in host mesa drivers doesn't trick uninative into loading host libc.
466 preload_items = ['libdl.so.2', 'librt.so.1', 'libpthread.so.0']
467 uninative_path = os.path.dirname(self.get("UNINATIVE_LOADER"))
468 if os.path.exists(uninative_path):
469 preload_paths = [os.path.join(uninative_path, i) for i in preload_items]
470 os.environ['LD_PRELOAD'] = " ".join(preload_paths)
471
464 def check_args(self): 472 def check_args(self):
465 for debug in ("-d", "--debug"): 473 for debug in ("-d", "--debug"):
466 if debug in sys.argv: 474 if debug in sys.argv: