<div dir="ltr">Source: gmtsar<br>Version: 6.5+ds-3<div>Severity: serious<br>Tags: FTBFS, patch</div><div><div>User: <a href="mailto:debian-riscv@lists.debian.org" target="_blank">debian-riscv@lists.debian.org</a></div><div>Usertags: riscv64</div></div><div><br></div><div>Dear gmtsar maintainer,</div><div>The package gmtsar build failed on riscv64 .The crucial buildd log below:</div><div>```</div><div><pre style="color:rgb(0,0,0)">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....</pre></div><div>```</div><div>The full buildd log is here:</div><div><a href="https://buildd.debian.org/status/fetch.php?pkg=gmtsar&arch=riscv64&ver=6.5%2Bds-3&stamp=1744870597&raw=0">https://buildd.debian.org/status/fetch.php?pkg=gmtsar&arch=riscv64&ver=6.5%2Bds-3&stamp=1744870597&raw=0</a></div><div><br></div><div>My solution to this issue:</div><div>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 <a href="http://configure.ac">configure.ac</a> 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 <a href="http://configure.ac">configure.ac</a> script has specific workarounds for aarch64 and loongarch64 to avoid adding this flag, but a similar condition for riscv64 is missing.We can modify <a href="http://configure.ac">configure.ac</a> 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.</div><div><br></div><div>Gui-Yue</div><div>Best Regards</div></div>