-
- Downloads
sysdep: Reference the test code from main
With lld 14 and no additional LDFLAGS the referenced foo()-function was optimized out, as an executable was compiled with no reference to the function, also removing the undefined references to the tested libc functions. This caused the sysdep mechanism to misdetect hasutmploginlogout.h-yes.c and sysdep/hasutmplogwtmp.h-yes.c on musl libc as true, while it should be false, which broke the build later on on the real references in tinyssh code. This can also be reproduced with gcc with CFLAGS=-ffunction-sections and LDFLAGS=-Wl,--gc-sections. Instead reference them, but do not evaluate them at runtime by making the prequisite argc == 0. This should be safe from being optimized out even with LTO.
Showing
- sysdep/haslogintty.h-yes.c 3 additions, 1 deletionsysdep/haslogintty.h-yes.c
- sysdep/hasopenpty.h-yes.c 3 additions, 1 deletionsysdep/hasopenpty.h-yes.c
- sysdep/hasutmploginlogout.h-yes.c 3 additions, 1 deletionsysdep/hasutmploginlogout.h-yes.c
- sysdep/hasutmplogwtmp.h-yes.c 3 additions, 1 deletionsysdep/hasutmplogwtmp.h-yes.c
- sysdep/hasutmpx.h-yes.c 3 additions, 1 deletionsysdep/hasutmpx.h-yes.c
- sysdep/hasutmpxupdwtmpx.h-yes.c 3 additions, 1 deletionsysdep/hasutmpxupdwtmpx.h-yes.c
Please register or sign in to comment