Re: Selectively disable uninative for a recipe

Richard Purdie

On Wed, 2021-11-24 at 19:21 -0500, Mohammed Billoo wrote:

I need to add TI MCU firmware as part of an OE/Yocto build for a
project that I am working on. Basically, the firmware needs to be
built during the overall image build and be stored in the RFS. My
strategy to build the firmware was to set up the TI toolchain as part
of the image build. Since I have the toolchain components and believe
it to be unnecessary (if not impossible) to build them from source, I
have the necessary pre-built components (provided by TI) as tarballs
uploaded somewhere.

In determining the best way to use a pre-built toolchain, I just
copied the gcc-linaro-baremetal-arm-native recipe. But, when I go to
bake my recipe for the toolchain, I get the following error:

ERROR: ti-bios-1.0-r0 do_populate_sysroot: Error executing a python
function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
*** 0002:uninative_changeinterp(d)
File: '/home/mbilloo/yocto-builds/norbert/yocto/build-doris/../layers/poky/meta/classes/uninative.bbclass',
lineno: 170, function: uninative_changeinterp
0166: continue
0167: if not elf.isDynamic():
0168: continue
*** 0170: subprocess.check_output(("patchelf-uninative",
"--set-interpreter", d.getVar("UNINATIVE_LOADER"), f),
File: '/usr/lib64/python3.8/', lineno: 411, function: check_output
0407: # Explicitly passing input=None was previously
equivalent to passing an
0408: # empty string. That is maintained here for
backwards compatibility.
0409: kwargs['input'] = '' if
kwargs.get('universal_newlines', False) else b''
*** 0411: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
0412: **kwargs).stdout
0415:class CompletedProcess(object):
File: '/usr/lib64/python3.8/', lineno: 512, function: run
0508: # We don't call process.wait() as .__exit__ does
that for us.
0509: raise
0510: retcode = process.poll()
0511: if check and retcode:
*** 0512: raise CalledProcessError(retcode, process.args,
0513: output=stdout, stderr=stderr)
0514: return CompletedProcess(process.args, retcode, stdout, stderr)
Exception: subprocess.CalledProcessError: Command
'('patchelf-uninative', '--set-interpreter',
returned non-zero exit status 1.

Subprocess output:
patchelf: cannot find section '.gnu.version_r'

It looks like uninative is ultimately being inherited and there are
some steps taken to eliminate any host-dependencies for the toolchain
binaries. Is there a way to disable this inheritance only for this
recipe (if I globally disable uninative in my conf file, the recipe
bakes just fine, but obviously can't do that)? Or, is there a better
way of accomplishing my goal?
You could define a new uninative_changeinterp() function in your recipe to
override the core one and make it do nothing. Not a particularly elegant
solution but should work...



Join to automatically receive all group messages.