[5/8] elf: Emit tunconf "not recognized" warning on stderr

Message ID 20260706211524.3801466-6-adhemerval.zanella@linaro.org (mailing list archive)
State Dropped
Headers
Series Fixes for the system-wide tunables support |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-arm fail Patch failed to apply

Commit Message

Adhemerval Zanella July 6, 2026, 9:14 p.m. UTC
  For consistency with other errors.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 elf/tunconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

DJ Delorie July 9, 2026, 2:20 a.m. UTC | #1
Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> For consistency with other errors.

I did it this way so it *wasn't* an error, just a warning.  We don't
have warning_at_line().  I couldn't think of a good reason to limit the
cache only to tunables that the current version of ldconfig knows about,
so I didn't.  This way we can support multiple versions of glibc and
evern non-glibc tunables (assuming the application had a way to get to
them).

> diff --git a/elf/tunconf.c b/elf/tunconf.c

> -    printf ("%s:%d: Warning: tunable %s not recognized.\n",
> -	    filename, lineno, name);
> +    error_at_line (0, 0, filename, lineno,
> +		   "Warning: tunable %s not recognized", name);
  
Adhemerval Zanella July 9, 2026, 12:01 p.m. UTC | #2
On 08/07/26 23:20, DJ Delorie wrote:
> 
> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>> For consistency with other errors.
> 
> I did it this way so it *wasn't* an error, just a warning.  We don't
> have warning_at_line().  I couldn't think of a good reason to limit the
> cache only to tunables that the current version of ldconfig knows about,
> so I didn't.  This way we can support multiple versions of glibc and
> evern non-glibc tunables (assuming the application had a way to get to
> them).

Fair enough, ignoring unknown tunable should be ok for cache generation.
I withdraw this patch.

> 
>> diff --git a/elf/tunconf.c b/elf/tunconf.c
> 
>> -    printf ("%s:%d: Warning: tunable %s not recognized.\n",
>> -	    filename, lineno, name);
>> +    error_at_line (0, 0, filename, lineno,
>> +		   "Warning: tunable %s not recognized", name);
>
  

Patch

diff --git a/elf/tunconf.c b/elf/tunconf.c
index c27b50b1de0..fa0d01b53e4 100644
--- a/elf/tunconf.c
+++ b/elf/tunconf.c
@@ -316,8 +316,8 @@  add_tunable (char *line, const char *filename, int lineno)
 	break;
       }
   if (id == -1)
-    printf ("%s:%d: Warning: tunable %s not recognized.\n",
-	    filename, lineno, name);
+    error_at_line (0, 0, filename, lineno,
+		   "Warning: tunable %s not recognized", name);
 
   entry = (struct tunable_entry_int *) xcalloc (sizeof (struct tunable_entry_int), 1);
   entry->name = cache_store_string (name);