<div dir="ltr">Source: linphone<br>Version: 5.2.0-4.3<br>Severity: serious<br>Tags: FTBFS, patch<br>User: <a href="mailto:debian-riscv@lists.debian.org" target="_blank">debian-riscv@lists.debian.org</a><br>Usertags: riscv64<br>X-Debbugs-Cc: <a href="mailto:debian-riscv@lists.debian.org" target="_blank">debian-riscv@lists.debian.org</a><br><div><br></div><div>Dear linphone Maintainer,</div><div>The package linphone build failed on almost all architectures.The crucial buildd log below:</div><div>```</div><div><pre style="color:rgb(0,0,0)">[ 10%] Building CXX object coreapi/CMakeFiles/linphone-coreapi.dir/lsd.c.o
cd /<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/coreapi && /usr/bin/c++ -DBCTBX_LOG_DOMAIN=\"liblinphone\" -DBCTBX_STATIC -DCXX_WRAPPER_ENABLED -DHAVE_CONFIG_H -DJPEG_ENABLED -DLDAP_ENABLED -DLDAP_LIBS_DYNAMIC -DLINPHONE_EXPORTS -DQRCODE_ENABLED -DUSE_BELLESIP -DVCARD_ENABLED -DVIDEO_ENABLED -I/<<PKGBUILDDIR>>/coreapi -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/coreapi -I/usr/include/belle-sip -I/usr/include/OpenGL -I/usr/include/xsd -I/usr/include/libxml2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DPACKAGE_SOUND_DIR="\"/usr/share/sounds/linphone\"" -DPACKAGE_RING_DIR="\"/usr/share/sounds/linphone/rings\"" -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++17 -fPIC -Wall -Wconversion -Werror=return-type -Winit-self -Wno-error=deprecated-declarations -Wpointer-arith -Wuninitialized -Wunused -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -Wnon-virtual-dtor -Woverloaded-virtual -Wsuggest-override -Wno-error=suggest-override -MD -MT coreapi/CMakeFiles/linphone-coreapi.dir/lsd.c.o -MF CMakeFiles/linphone-coreapi.dir/lsd.c.o.d -o CMakeFiles/linphone-coreapi.dir/lsd.c.o -c /<<PKGBUILDDIR>>/coreapi/lsd.c
[ 10%] Building CXX object coreapi/CMakeFiles/linphone-coreapi.dir/misc.c.o
cd /<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/coreapi && /usr/bin/c++ -DBCTBX_LOG_DOMAIN=\"liblinphone\" -DBCTBX_STATIC -DCXX_WRAPPER_ENABLED -DHAVE_CONFIG_H -DJPEG_ENABLED -DLDAP_ENABLED -DLDAP_LIBS_DYNAMIC -DLINPHONE_EXPORTS -DQRCODE_ENABLED -DUSE_BELLESIP -DVCARD_ENABLED -DVIDEO_ENABLED -I/<<PKGBUILDDIR>>/coreapi -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/coreapi -I/usr/include/belle-sip -I/usr/include/OpenGL -I/usr/include/xsd -I/usr/include/libxml2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DPACKAGE_SOUND_DIR="\"/usr/share/sounds/linphone\"" -DPACKAGE_RING_DIR="\"/usr/share/sounds/linphone/rings\"" -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++17 -fPIC -Wall -Wconversion -Werror=return-type -Winit-self -Wno-error=deprecated-declarations -Wpointer-arith -Wuninitialized -Wunused -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -Wnon-virtual-dtor -Woverloaded-virtual -Wsuggest-override -Wno-error=suggest-override -MD -MT coreapi/CMakeFiles/linphone-coreapi.dir/misc.c.o -MF CMakeFiles/linphone-coreapi.dir/misc.c.o.d -o CMakeFiles/linphone-coreapi.dir/misc.c.o -c /<<PKGBUILDDIR>>/coreapi/misc.c
/<<PKGBUILDDIR>>/coreapi/lpconfig.c: In function ‘LpItem* lp_item_new(const char*, const char*)’:
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:127:22: note: in expansion of macro ‘lp_new0’
127 | LpItem *item=lp_new0(LpItem,1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: note: earlier argument should specify number of elements, later size of each element
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:127:22: note: in expansion of macro ‘lp_new0’
127 | LpItem *item=lp_new0(LpItem,1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c: In function ‘LpItem* lp_comment_new(const char*)’:
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:134:22: note: in expansion of macro ‘lp_new0’
134 | LpItem *item=lp_new0(LpItem,1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: note: earlier argument should specify number of elements, later size of each element
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:134:22: note: in expansion of macro ‘lp_new0’
134 | LpItem *item=lp_new0(LpItem,1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c: In function ‘LpSectionParam* lp_section_param_new(const char*, const char*)’:
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:150:33: note: in expansion of macro ‘lp_new0’
150 | LpSectionParam *param = lp_new0(LpSectionParam, 1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: note: earlier argument should specify number of elements, later size of each element
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:150:33: note: in expansion of macro ‘lp_new0’
150 | LpSectionParam *param = lp_new0(LpSectionParam, 1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c: In function ‘LpSection* lp_section_new(const char*)’:
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:157:24: note: in expansion of macro ‘lp_new0’
157 | LpSection *sec=lp_new0(LpSection,1);
| ^~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:70:39: note: earlier argument should specify number of elements, later size of each element
70 | #define lp_new0(type,n) (type*)calloc(sizeof(type),n)
| ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/lpconfig.c:157:24: note: in expansion of macro ‘lp_new0’
157 | LpSection *sec=lp_new0(LpSection,1);
| ^~~~~~~
cc1plus: all warnings being treated as errors
make[4]: *** [coreapi/CMakeFiles/linphone-coreapi.dir/build.make:485: coreapi/CMakeFiles/linphone-coreapi.dir/lpconfig.c.o] Error 1
make[4]: *** Waiting for unfinished jobs....
/<<PKGBUILDDIR>>/coreapi/misc.c: In function ‘void linphone_core_update_allocated_audio_bandwidth(LinphoneCore*)’:
/<<PKGBUILDDIR>>/coreapi/misc.c:74:48: warning: ‘const bctbx_list_t* linphone_core_get_audio_codecs(const LinphoneCore*)’ is deprecated [-Wdeprecated-declarations]
74 | for(elem=linphone_core_get_audio_codecs(lc);elem!=NULL;elem=elem->next){
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from /<<PKGBUILDDIR>>/src/conference/conference.h:27,
from /<<PKGBUILDDIR>>/src/conference/session/call-session.h:26,
from /<<PKGBUILDDIR>>/src/conference/session/streams.h:29,
from /<<PKGBUILDDIR>>/include/linphone/utils/utils.h:36,
from /<<PKGBUILDDIR>>/src/core/core-p.h:26,
from /<<PKGBUILDDIR>>/coreapi/misc.c:25:
/<<PKGBUILDDIR>>/include/linphone/core.h:7015:57: note: declared here
7015 | LINPHONE_PUBLIC LINPHONE_DEPRECATED const bctbx_list_t *linphone_core_get_audio_codecs(const LinphoneCore *core);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/misc.c: In function ‘int get_unique_transport(LinphoneCore*, LinphoneTransportType*, int*)’:
/<<PKGBUILDDIR>>/coreapi/misc.c:531:41: warning: ‘LinphoneStatus linphone_core_get_sip_transports(LinphoneCore*, LinphoneSipTransports*)’ is deprecated [-Wdeprecated-declarations]
531 | linphone_core_get_sip_transports(lc,&tp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/<<PKGBUILDDIR>>/include/linphone/core.h:7286:52: note: declared here
7286 | LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_get_sip_transports(LinphoneCore *core, LinphoneSipTransports *transports);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/misc.c: In function ‘void linphone_core_migrate_proxy_config(LinphoneCore*, LinphoneTransportType)’:
/<<PKGBUILDDIR>>/coreapi/misc.c:553:66: warning: ‘const char* linphone_proxy_config_get_route(const LinphoneProxyConfig*)’ is deprecated [-Wdeprecated-declarations]
553 | const char *route=linphone_proxy_config_get_route(cfg);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /<<PKGBUILDDIR>>/include/linphone/core.h:61:
/<<PKGBUILDDIR>>/include/linphone/proxy_config.h:766:49: note: declared here
766 | LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *proxy_config);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/misc.c:568:56: warning: ‘LinphoneStatus linphone_proxy_config_set_route(LinphoneProxyConfig*, const char*)’ is deprecated [-Wdeprecated-declarations]
568 | linphone_proxy_config_set_route(cfg,tmp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/<<PKGBUILDDIR>>/include/linphone/proxy_config.h:759:52: note: declared here
759 | LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_proxy_config_set_route(LinphoneProxyConfig *proxy_config, const char *route);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/misc.c: In function ‘LinphoneStatus linphone_core_migrate_to_multi_transport(LinphoneCore*)’:
/<<PKGBUILDDIR>>/coreapi/misc.c:589:57: warning: ‘LinphoneStatus linphone_core_set_sip_transports(LinphoneCore*, const LinphoneSipTransports*)’ is deprecated [-Wdeprecated-declarations]
589 | linphone_core_set_sip_transports(lc,&newtp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/<<PKGBUILDDIR>>/include/linphone/core.h:7273:52: note: declared here
7273 | LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_set_sip_transports(LinphoneCore *core, const LinphoneSipTransports *transports);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/coreapi/misc.c: In function ‘bool_t linphone_core_file_format_supported(LinphoneCore*, const char*)’:
/<<PKGBUILDDIR>>/coreapi/misc.c:937:70: warning: ‘const char** linphone_core_get_supported_file_formats(LinphoneCore*)’ is deprecated [-Wdeprecated-declarations]
937 | const char **formats=linphone_core_get_supported_file_formats(lc);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/<<PKGBUILDDIR>>/coreapi/misc.c:914:15: note: declared here
914 | const char ** linphone_core_get_supported_file_formats(LinphoneCore *core){
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: Leaving directory '/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu'
make[3]: *** [CMakeFiles/Makefile2:350: coreapi/CMakeFiles/linphone-coreapi.dir/all] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu'
make[2]: *** [Makefile:139: all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu'
dh_auto_build: error: cd obj-riscv64-linux-gnu && make -j4 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make[1]: *** [debian/rules:77: override_dh_auto_build-arch] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:50: binary-arch] Error 2
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit status 2</pre></div><div>```</div><div>The full buildd log is here:<br></div><div><a href="https://buildd.debian.org/status/fetch.php?pkg=linphone&arch=riscv64&ver=5.2.0-4.3%2Bb4&stamp=1727424865&raw=0">https://buildd.debian.org/status/fetch.php?pkg=linphone&arch=riscv64&ver=5.2.0-4.3%2Bb4&stamp=1727424865&raw=0</a><br></div><div>My solution to this issue:</div><div> The reason for the compilation failure is the incorrect parameter order of the <code>calloc</code> function. In the <code>lp_new0</code> macro, the first parameter should be the number of elements, and the second parameter should be the size of each element, but the current definition has them in the reverse order.
Modifying the macro definition will resolve this issue.I have test the solution locally ,and it works well.The deb-patch is in the attachment.Please let me know wheather this solution can be accepted.<br></div><div><br></div><div>Gui-Yue</div><div>Best Regards</div></div>