depends does not compile with clang-16 (fontconfig) #27299

issue maflcko openend this issue on March 22, 2023
  1. maflcko commented at 12:26 pm on March 22, 2023: member

    Steps to reproduce on a fresh install of Ubuntu Lunar:

    export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git --depth=1 ./bitcoin-core && cd bitcoin-core && apt install libc++abi-16-dev libc++-16-dev clang-16 llvm-16 build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison -y

    Then:

    0( cd depends && make CC=clang-16 CXX="clang++-16" fontconfig )
    

    Output:

     0Making all in fc-list
     1make[3]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
     2  CC       fc-list.o
     3fc-list.c:119:27: error: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     4            format = (FcChar8 *) strdup (optarg);
     5                                 ^
     6fc-list.c:119:27: note: did you mean 'strcmp'?
     7/usr/include/string.h:156:12: note: 'strcmp' declared here
     8extern int strcmp (const char *__s1, const char *__s2)
     9           ^
    10fc-list.c:119:15: warning: cast to 'FcChar8 *' (aka 'unsigned char *') from smaller integer type 'int' [-Wint-to-pointer-cast]
    11            format = (FcChar8 *) strdup (optarg);
    12                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    131 warning and 1 error generated.
    14make[3]: *** [Makefile:510: fc-list.o] Error 1
    15make[3]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
    16make[2]: *** [Makefile:581: all-recursive] Error 1
    17make[2]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
    18make[1]: *** [Makefile:465: all] Error 2
    19make[1]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
    20make: *** [funcs.mk:291: /bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/./.stamp_built] Error 2
    
  2. maflcko commented at 12:28 pm on March 22, 2023: member

    Same for qrencode:

     0# ( cd depends && make CC=clang-16 CXX="clang++-16" qrencode ) 
     1Building qrencode...
     2make[1]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
     3make  all-recursive
     4make[2]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
     5Making all in .
     6make[3]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
     7/bin/bash ./libtool  --tag=CC   --mode=compile clang-16 -DHAVE_CONFIG_H -I.   -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include  -Wall -pipe -std=c11 -O2 -c -o split.lo split.c
     8libtool: compile:  clang-16 -DHAVE_CONFIG_H -I. -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include -Wall -pipe -std=c11 -O2 -c split.c  -fPIC -DPIC -o split.o
     9split.c:287:11: error: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    10        newstr = strdup(str);
    11                 ^
    12split.c:287:11: note: did you mean 'strcmp'?
    13/usr/include/string.h:156:12: note: 'strcmp' declared here
    14extern int strcmp (const char *__s1, const char *__s2)
    15           ^
    16split.c:287:9: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
    17        newstr = strdup(str);
    18               ^ ~~~~~~~~~~~
    192 errors generated.
    20make[3]: *** [Makefile:635: split.lo] Error 1
    21make[3]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
    22make[2]: *** [Makefile:750: all-recursive] Error 1
    23make[2]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
    24make[1]: *** [Makefile:448: all] Error 2
    25make[1]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047'
    26make: *** [funcs.mk:291: /bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-f8b44fab047/./.stamp_built] Error 2
    
  3. maflcko commented at 12:32 pm on March 22, 2023: member

    The qrencode issue also with clang-15:

     0# ( cd depends && make CC=clang-15 CXX="clang++-15" qrencode ) 
     1Building qrencode...
     2make[1]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
     3make  all-recursive
     4make[2]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
     5Making all in .
     6make[3]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
     7/bin/bash ./libtool  --tag=CC   --mode=compile clang-15 -DHAVE_CONFIG_H -I.   -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include  -Wall -pipe -std=c11 -O2 -c -o split.lo split.c
     8libtool: compile:  clang-15 -DHAVE_CONFIG_H -I. -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include -Wall -pipe -std=c11 -O2 -c split.c  -fPIC -DPIC -o split.o
     9split.c:287:11: warning: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    10        newstr = strdup(str);
    11                 ^
    12split.c:287:9: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
    13        newstr = strdup(str);
    14               ^ ~~~~~~~~~~~
    151 warning and 1 error generated.
    16make[3]: *** [Makefile:635: split.lo] Error 1
    17make[3]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
    18make[2]: *** [Makefile:750: all-recursive] Error 1
    19make[2]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
    20make[1]: *** [Makefile:448: all] Error 2
    21make[1]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa'
    22make: *** [funcs.mk:291: /bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/qrencode/3.4.4-ba1c2aba6fa/./.stamp_built] Error 2
    
  4. fanquake referenced this in commit abea7fc421 on Mar 23, 2023
  5. fanquake referenced this in commit eb1c3adf38 on Mar 23, 2023
  6. fanquake referenced this in commit ad62bd5d6a on Mar 27, 2023
  7. fanquake commented at 11:29 am on March 27, 2023: member

    Same for qrencode: The qrencode issue also with clang-15:

    This portion of this issue should have been addressed by #27312.

  8. maflcko added the label GUI on Mar 27, 2023
  9. maflcko added the label Build system on Mar 27, 2023
  10. maflcko commented at 12:23 pm on March 27, 2023: member
    Maybe fontconfig can also be worked around with something like +$(package)_cflags += -Wno-int-conversion -Wno-implicit-function-declaration?
  11. fanquake commented at 2:36 pm on March 27, 2023: member

    Maybe fontconfig can also be worked around with something like

    Yea, looks like doing the same as qrencode, without a package bump, is going to be good enough for now, to solve clang-16. Going to update #27301 shortly.

  12. sidhujag referenced this in commit 26134c90aa on Mar 27, 2023
  13. fanquake closed this on Mar 27, 2023

  14. sidhujag referenced this in commit 2d65d29021 on Mar 27, 2023
  15. RandyMcMillan referenced this in commit ccd5f875f0 on May 27, 2023
  16. lyricidal referenced this in commit ce65587c6a on Jul 10, 2023
  17. bitcoin locked this on Mar 26, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me