Source: gmtsar Version: 6.5+ds-3 Severity: serious Tags: FTBFS, patch User: debian-ri...@lists.debian.org Usertags: riscv64
Dear gmtsar maintainer, The package gmtsar build failed on riscv64 .The crucial buildd log below: ``` make[3]: Entering directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/ers_line_fixer' gcc -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/gmtsar-6.5+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -z muldefs -g -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=gnu99 -I./include -Wdate-time -D_FORTIFY_SOURCE=2 -c -o ers_line_fixer.o ers_line_fixer.c gcc: error: unrecognized command-line option ‘-m64’ make[3]: *** [<builtin>: ers_line_fixer.o] Error 1 make[3]: Leaving directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/ers_line_fixer' make[3]: Entering directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/read_data_file_dpaf' gcc -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/gmtsar-6.5+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -z muldefs -g -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=gnu99 -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -c -o read_data_file_dpaf.o read_data_file_dpaf.c gcc: error: unrecognized command-line option ‘-m64’ make[3]: *** [<builtin>: read_data_file_dpaf.o] Error 1 make[3]: Leaving directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/read_data_file_dpaf' make[3]: Entering directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/read_data_file_ccrs' gcc -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/gmtsar-6.5+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -z muldefs -g -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=gnu99 -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -c -o read_data_file_ccrs.o read_data_file_ccrs.c gcc: error: unrecognized command-line option ‘-m64’ make[3]: *** [<builtin>: read_data_file_ccrs.o] Error 1 make[3]: Leaving directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/read_data_file_ccrs' make[3]: Entering directory '/build/reproducible-path/gmtsar-6.5+ds/preproc/ERS_preproc/read_sarleader_dpaf' gcc -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/gmtsar-6.5+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -z muldefs -g -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=gnu99 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o read_sarleader_dpaf.o read_sarleader_dpaf.c gcc -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/gmtsar-6.5+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -z muldefs -g -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=gnu99 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o make_prm_dpaf.o make_prm_dpaf.c gcc: error: unrecognized command-line option ‘-m64’ gcc: error: unrecognized command-line option ‘-m64’ make[3]: *** [<builtin>: read_sarleader_dpaf.o] Error 1 make[3]: *** Waiting for unfinished jobs.... ``` The full buildd log is here: https://buildd.debian.org/status/fetch.php?pkg=gmtsar&arch=riscv64&ver=6.5%2Bds-3&stamp=1744870597&raw=0 My solution to this issue: The build process for gmtsar fails on riscv64 because the C compiler encounters an unrecognized command-line option -m64.This option is incorrectly added to CFLAGS and LDFLAGS by the configure script. The logic in configure.ac determines the -m<bits> flag based on gmt-config --bits. While this works for x86_64, the -m64 flag is not valid for the RISC-V GCC toolchain, which infers 64-bit targeting automatically.The configure.ac script has specific workarounds for aarch64 and loongarch64 to avoid adding this flag, but a similar condition for riscv64 is missing.We can modify configure.ac to add a condition for host_cpu = "riscv64" to prevent appending -m<bits> (specifically -m64) to GCC_64 and LDFLAGS for this architecture, similar to how it's handled for aarch64.I have tested that locally, and it works well.The debdiff patch is in the attachment.Please let me know whether this solution can be accepted. Gui-Yue Best Regards
disable_-m64_option_on_riscv64.patch
Description: Binary data