Re: [PATCH] build: fix clang+glibc snprintf substitution error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 14, 2022 at 06:59:41PM -0400, Nicholas Vinson wrote:
When building with clang and glibc and -D_FORTIFY_SOURCE=2 is passed to
clang, the snprintf member of the expr_ops and obj_ops structures will
be incorrectly replaced with __builtin_snprintf_chk() which results in
"error: no member named '__builtin___snprintf_chk'" errors at build
time.

Please, report this to upstream compiler devel list too.

It's been reported upstream a few times already. Relevant links below.

https://github.com/llvm/llvm-project/issues/7591
https://github.com/llvm/llvm-project/issues/12053
https://github.com/llvm/llvm-project/issues/17831


This patch changes the member name from 'snprintf' to 'nftnl_snprintf'
to prevent the replacement.

This bug can be emulated using GCC by undefining the __va_arg_pack macro
before stdio.h is included.

This patch is based on the notes provided in
https://bugs.gentoo.org/807766.

Please, rename it to .output instead, I'd suggest.

Renamed from nftnl_snprintf to .output.

Thanks,
Nicholas Vinson



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux