Bug#1107403: gmtsar:FTBFS:build failed(gcc: error: unrecognized command-line option =?UTF-8?Q?=E2=80=98-m64=E2=80=99?=)
Yue Gui
yuemeng.gui at gmail.com
Sat Jun 7 10:27:00 BST 2025
Source: gmtsar
Version: 6.5+ds-3
Severity: serious
Tags: FTBFS, patch
User: debian-riscv at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250607/742a1edd/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disable_-m64_option_on_riscv64.patch
Type: application/octet-stream
Size: 1472 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250607/742a1edd/attachment-0001.obj>
More information about the Pkg-grass-devel
mailing list