[patch v4 3/4] Add system-wide tunables: Apply tunables part

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Feb 10 18:29:35 GMT 2026



On 10/02/26 00:03, DJ Delorie wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>>> Florian Weimer <fweimer@redhat.com> writes:
>>>>>>> +dl_strcmp(const char *s1, const char *s2)
>>>>>>> +dl_strlen(const char *s)
>>>>>>
>>>>>> That shouldn't be necessary, we have mechanisms for using string
>>>>>> functions from ld.so (rtld-str*.c wrappers of generic routines).
>>>>>
>>>>> I might need more clues here...
>>>>
>>>> What type of breakage do you see if you remove these workarounds?
>>>
>>> I meant, I need more clues for how to use rtld-str* that bypasses the
>>> ifunc versions.  The tunables loading happens before ifuncs are set up
>>> (or before libc.so is even loaded), so calls to the generic
>>> strcmp/strlen just crash.
>>
>> This should be enough:
>>
>> #include <dl-symbol-redir-ifunc.h>
> 
> Ok, weird... in the time since I added those functions, that #include
> was added to dl-tunables.c by bcae44ea8536b30a7119c0986ff5692bddacb672
> in 2024 to account for a compiler-introduced memset.
> 
> In 2025, though, 2ebfb31b35c89f8ba1da1ed8b90fba26566017a9 adds
> _dl_strlen() to dl-tunables.c because clang turns some constructs into
> a call to strlen.  (note: both by Adhemerval, so I hope not an accident).
> 
> I'm inclined to add _dl_strcmp() to Adhemerval's _dl_strlen() "just in
> case"...

I might revise it, I think the dl-symbol-redir-ifunc.h is the best way
to handle it. 

> 
> Although, just taking out my stuff and using strcmp() and strlen(), the
> testsuite passes, although I'm not building with clang.
> 



More information about the Libc-alpha mailing list