[PATCH] elf: Fix tests that rely on ld.so.cache for cross-compiling

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Jan 29 13:59:25 GMT 2021



On 29/01/2021 10:40, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> For configurations with cross-compiling equal to 'maybe' or 'no',
>> ldconfig will not run and thus the ld.so.cache will not be created
>> on the container testroot.pristine.
>>
>> This lead to failures on both tst-glibc-hwcaps-prepend-cache and
>> tst-ldconfig-ld_so_conf-update on environments where the same
>> compiler can be used to build different ABIs (powerpc and x86 for
>> instance).
>>
>> This patch addas a new test-container hook, ldconfig.run, that
>> triggers a ldconfig execution prior the test execution.
> 
> Commit subject does not match patch: No tests are fixed yet, I think.

The fix is due the new two files:

  elf/tst-glibc-hwcaps-prepend-cache.root/ldconfig.run
  elf/tst-ldconfig-ld_so_conf-update.root/ldconfig.run

Otherwise in such described scenario ld.so.cache won't exist, the
tests will try to load it and failure will set the process to not
try to reload the cache (and then any ld.so.cache update won't change
dlopen outcome).

> 
> Should running ldconfig automatically trigger post-clean activities?

At least in such scenarios the ld.so.cache is already deleted, since
the sync with the pristine will detect the file existence.  Running
the tests with test-container -v I see:

sync /home/azanella/Projects/glibc/build/i686-linux-gnu/testroot.pristine/etc/ to /home/azanella/Projects/glibc/build/i686-linux-gnu/testroot.root/etc/ and delete
-F /home/azanella/Projects/glibc/build/i686-linux-gnu/testroot.root/etc/ld.so.conf
-F /home/azanella/Projects/glibc/build/i686-linux-gnu/testroot.root/etc/ld.so.cache

> 
> Place of the invocation of ldconfig in the patch looks right to me.
> 
> Thanks,
> Florian
> 


More information about the Libc-alpha mailing list