mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
Add nls.mk and patch to avoid the build ending in an error:
In function 'write_table',
inlined from 'write_tables' at rpc_tblout.c:73:4,
inlined from 't_output.constprop' at rpc_main.c:841:3:
rpc_tblout.c:91:26: error: '%s' directive writing likely 1 or more bytes into a region of size between 0 and 99 [-Werror=format-overflow=]
91 | s_print (progvers, "%s_%s",
| ^
rpc_tblout.c:91:26: note: assuming directive output of 1 byte
In function 'sprintf',
inlined from 'write_table' at rpc_tblout.c:91:7,
inlined from 'write_tables' at rpc_tblout.c:73:4,
inlined from 't_output.constprop' at rpc_main.c:841:3:
/scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/include/bits/stdio2.h:30:10: note: '__builtin___sprintf_chk' output 2 or more bytes (assuming 102) into a destination of size 100
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^
lto1: some warnings being treated as errors
make[6]: *** [/scratch/union/tmp/ccHfYNRX.mk:2: /scratch/union/tmp/ccudJcWZ.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
mold: fatal: lto-wrapper failed
Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc
Co-developed-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
33 lines
813 B
Diff
33 lines
813 B
Diff
--- a/tools/rpcgen/rpc_tblout.c
|
|
+++ b/tools/rpcgen/rpc_tblout.c
|
|
@@ -82,14 +82,19 @@ write_table (const definition * def)
|
|
proc_list *proc;
|
|
int current;
|
|
int expected;
|
|
- char progvers[100];
|
|
+ char *progvers;
|
|
int warning;
|
|
+ int a;
|
|
|
|
for (vp = def->def.pr.versions; vp != NULL; vp = vp->next)
|
|
{
|
|
warning = 0;
|
|
- s_print (progvers, "%s_%s",
|
|
+ a = asprintf (&progvers, "%s_%s",
|
|
locase (def->def_name), vp->vers_num);
|
|
+ if (a == -1)
|
|
+ {
|
|
+ return;
|
|
+ }
|
|
/* print the table header */
|
|
f_print (fout, tbl_hdr, progvers);
|
|
|
|
@@ -146,6 +151,7 @@ write_table (const definition * def)
|
|
/* print the table trailer */
|
|
f_print (fout, tbl_end);
|
|
f_print (fout, tbl_nproc, progvers, progvers, progvers);
|
|
+ free (progvers);
|
|
}
|
|
}
|
|
|