[PATCH] fortify-headers: fix compilation with GCC 10.3
Hauke Mehrtens
hauke at hauke-m.de
Tue Apr 13 23:53:16 BST 2021
On 4/13/21 6:03 AM, Rosen Penev wrote:
> For some reason, fortified mempcpy does not work with GCC 10.3. It
> worked with GCC 10.2.
>
> Some output with tvheadend:
>
> error: 'mempcpy' undeclared here (not in a function);
> did you mean 'memccpy'?
> 144 | _FORTIFY_FN(mempcpy) void *mempcpy(void *__d,
> const void *__s, size_t __n)
> | ^~~~~~~
> note: in definition of macro '_FORTIFY_ORIG'
> 20 | #define _FORTIFY_ORIG(p,fn)
> __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
> note: in expansion of macro
> '_FORTIFY_FN'
> 144 | _FORTIFY_FN(mempcpy) void
> *mempcpy(void *__d, const void *__s, size_t __n)
> In function 'mempcpy':
> error: called object '__orig_mempcpy' is not a
> function or function pointer
> 151 | return _orig_mempcpy(__d, __s, __n);
>
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
> toolchain/fortify-headers/Makefile | 2 +-
> toolchain/fortify-headers/patches/010-mempcpy.patch | 11 +++++++++++
> 2 files changed, 12 insertions(+), 1 deletion(-)
> create mode 100644 toolchain/fortify-headers/patches/010-mempcpy.patch
>
Could you please share your OpenWrt configuration.
With this configuration it is compiling for me:
-------------
hauke at hauke-t480:~/openwrt/openwrt$ ./scripts/diffconfig.sh
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_DEVICE_generic=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_GCC_USE_VERSION_10=y
# CONFIG_GCC_USE_VERSION_8 is not set
CONFIG_GCC_VERSION="10.3.0"
CONFIG_GCC_VERSION_10=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_OPTIMIZE_SPEED=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_tvheadend=y
CONFIG_PACKAGE_zlib=y
CONFIG_TVHEADEND_CWC_SUPPORT=y
CONFIG_TVHEADEND_DVBSCAN_SUPPORT=y
CONFIG_TVHEADEND_LINUXDVB_SUPPORT=y
----------------
This could be similar to the umdns problem which only shows up on 32 bit
platforms.
Hauke
More information about the openwrt-devel
mailing list