openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.49k forks source link

transmission: Build fails with `error: conflicting types for 'strtod'; have 'long double(const char * restrict, char ** restrict)'` in 22.03. #19103

Open dreirund opened 2 years ago

dreirund commented 2 years ago

Maintainer:

@dangowrt

Environment:

Description:

make -j6 fails in above configuration on package/feeds/packages/transmission.

An explicit run of
make -j1 V=sc package/feeds/packages/transmission/compile
fails with error: conflicting types for 'strtod'; have 'long double(const char * restrict, char ** restrict)':

[...]
Making all in dht
make[5]: Entering directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00/third-party/dht'
ccache_cc -DPACKAGE_NAME=\"transmission\" -DPACKAGE_TARNAME=\"transmission\" -DPACKAGE_VERSION=\"3.00\" -DPACKAGE_STRING=\"transmission\ 3.00\" -DPACKAGE_BUGREPORT=\"https://github.com/transmission/transmission\" -DPACKAGE_URL=\"\" -DPACKAGE=\"transmission\" -DVERSION=\"3.00\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DECL_POSIX_FADVISE=1 -DWITH_UTP=1 -DTR_LIGHTWEIGHT=1 -I.   -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/usr/include -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include -I/[...]/openwrt-22.03/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/libiconv-stub/include -I/[...]/openwrt-22.03/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/libintl-stub/include  -DNDEBUG -Dstrtold=strtod  -O3 -pipe -g0 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00=transmission-3.00 -DPIC -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/[...]/openwrt-22.03/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/libiconv-stub/include -I/[...]/openwrt-22.03/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/libintl-stub/include -ffunction-sections -fdata-sections -flto  -std=gnu99 -ggdb3 -Wall -W -Wpointer-arith -Wformat-security -Wundef -Wcast-align -Wstrict-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Wunused-parameter -Wwrite-strings -Winline -Wfloat-equal -Wextra -Winit-self -Wvariadic-macros -MT dht.o -MD -MP -MF .deps/dht.Tpo -c -o dht.o dht.c
<command-line>: error: conflicting types for 'strtod'; have 'long double(const char * restrict,  char ** restrict)'
In file included from ../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdlib.h:22,
                 from dht.c:35:
/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/stdlib.h:29:8: note: previous declaration of 'strtod' with type 'double(const char * restrict,  char ** restrict)'
   29 | double strtod (const char *__restrict, char **__restrict);
      |        ^~~~~~
dht.c: In function 'is_martian':
dht.c:367:35: warning: cast increases required alignment of target type [-Wcast-align]
  367 |         struct sockaddr_in *sin = (struct sockaddr_in*)sa;
      |                                   ^
dht.c:375:37: warning: cast increases required alignment of target type [-Wcast-align]
  375 |         struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
      |                                     ^
dht.c: In function 'storage_store':
dht.c:1432:35: warning: cast increases required alignment of target type [-Wcast-align]
 1432 |         struct sockaddr_in *sin = (struct sockaddr_in*)sa;
      |                                   ^
dht.c:1436:37: warning: cast increases required alignment of target type [-Wcast-align]
 1436 |         struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
      |                                     ^
dht.c: In function 'make_token':
dht.c:1559:35: warning: cast increases required alignment of target type [-Wcast-align]
 1559 |         struct sockaddr_in *sin = (struct sockaddr_in*)sa;
      |                                   ^
dht.c:1564:37: warning: cast increases required alignment of target type [-Wcast-align]
 1564 |         struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
      |                                     ^
dht.c: In function 'dht_periodic':
dht.c:2251:35: warning: cast increases required alignment of target type [-Wcast-align]
 2251 |                     port = htons(((struct sockaddr_in*)from)->sin_port);
      |                                   ^
dht.c:2254:35: warning: cast increases required alignment of target type [-Wcast-align]
 2254 |                     port = htons(((struct sockaddr_in6*)from)->sin6_port);
      |                                   ^
make[5]: *** [Makefile:437: dht.o] Error 1
make[5]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00/third-party/dht'
make[4]: *** [Makefile:444: all-recursive] Error 1
make[4]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00/third-party'
make[3]: *** [Makefile:492: all-recursive] Error 1
make[3]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00'
make[2]: *** [Makefile:143: /[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/transmission-3.00/.built] Error 2
make[2]: Leaving directory '/[...]/openwrt-22.03/feeds/packages/net/transmission'
time: package/feeds/packages/transmission/compile#0.59#0.15#0.70
    ERROR: package/feeds/packages/transmission failed to build.
[...]

→ Full make output.

Adding to package/feeds/packages/transmission/Makefile the line

PKG_FORTIFY_SOURCE:=0

does not help (I came to this idea because of the In file included from ../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdlib.h:22, which contains fortify).

Issue also persists when I select only transmission-daemon and luci-app-transmission:

CONFIG_PACKAGE_luci-app-transmission=m
# CONFIG_PACKAGE_transmission-cli is not set
CONFIG_PACKAGE_transmission-daemon=m
# CONFIG_PACKAGE_transmission-remote is not set
# CONFIG_PACKAGE_transmission-web is not set
# CONFIG_PACKAGE_transmission-web-control is not set
neheb commented 2 years ago

This failure has to be a joke.

strtod returns a double. strtold returns a long double.

<command-line>: error: conflicting types for 'strtod'; have 'long double(const char * restrict,  char ** restrict)'

command line?