Source: liboprf
Version:  0.3.2-1
Severity: serious
Tags: FTBFS, patch
User: debian-ri...@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: debian-ri...@lists.debian.org

Dear liboprf Maintainer,
The package liboprf build failed on  architectures other than x86 and
i386.The crucial buildd log below:
```

make -C noise_xk all
cc -g -O2 -Werror=implicit-function-declaration
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
-Werror=format-security -fPIC -Wl,-z,defs -Wl,-z,relro
-Wl,-z,noexecstack -Wl,-z,now -Wtrampolines
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-fcf-protection=full -fstack-clash-protection  -Inoise_xk/include
-Inoise_xk/include/karmel -Inoise_xk/include/karmel/minimal
-Wdate-time -D_FORTIFY_SOURCE=2  -c -o oprf.o oprf.c
cc -g -O2 -Werror=implicit-function-declaration
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
-Werror=format-security -fPIC -Wl,-z,defs -Wl,-z,relro
-Wl,-z,noexecstack -Wl,-z,now -Wtrampolines
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-fcf-protection=full -fstack-clash-protection  -Inoise_xk/include
-Inoise_xk/include/karmel -Inoise_xk/include/karmel/minimal
-Wdate-time -D_FORTIFY_SOURCE=2  -c -o toprf.o toprf.c
cc -g -O2 -Werror=implicit-function-declaration
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
-Werror=format-security -fPIC -Wl,-z,defs -Wl,-z,relro
-Wl,-z,noexecstack -Wl,-z,now -Wtrampolines
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-fcf-protection=full -fstack-clash-protection  -Inoise_xk/include
-Inoise_xk/include/karmel -Inoise_xk/include/karmel/minimal
-Wdate-time -D_FORTIFY_SOURCE=2  -c -o dkg.o dkg.c
make[2]: Entering directory '/<<PKGBUILDDIR>>/src'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent
make rule.
cc -g -O2 -Werror=implicit-function-declaration
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
-Werror=format-security -fPIC -Wl,-z,defs -Wl,-z,relro
-Wl,-z,noexecstack -Wl,-z,now -Wtrampolines
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-fcf-protection=full -fstack-clash-protection  -Inoise_xk/include
-Inoise_xk/include/karmel -Inoise_xk/include/karmel/minimal -Iinclude
-I include/karmel -I include/karmel/minimal -Wall -Wextra -Werror
-std=c11 -Wno-unused-variable -Wno-unknown-warning-option
-Wno-unused-but-set-variable -Wno-unused-parameter
-Wno-infinite-recursion -fpic -g -fwrapv -D_BSD_SOURCE
-D_DEFAULT_SOURCE -DWITH_SODIUM -O2 -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic
-Werror=format-security -Werror=implicit-function-declaration -ftrapv
-Wl,--error-unresolved-symbols -Wl,-z,defs -Wl,-z,relro
-Wl,-z,noexecstack -fcf-protection=full -fstack-clash-protection
-Wdate-time -D_FORTIFY_SOURCE=2  -c -o src/Noise_XK.o src/Noise_XK.c
cc1: error: ‘-fcf-protection=full’ is not supported for this target
cc1: error: ‘-fcf-protection=full’ is not supported for this target
cc1: error: ‘-fcf-protection=full’ is not supported for this target
make[1]: *** [<builtin>: oprf.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [<builtin>: toprf.o] Error 1
make[1]: *** [<builtin>: dkg.o] Error 1
cc1: error: ‘-fcf-protection=full’ is not supported for this target
cc1: note: unrecognized command-line option
‘-Wno-unknown-warning-option’ may have been intended to silence
earlier diagnostics
make[2]: *** [<builtin>: src/Noise_XK.o] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>/src/noise_xk'
make[1]: *** [makefile:52: noise_xk/liboprf-noiseXK.so] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/src'
dh_auto_build: error: cd src && make -j4 "INSTALL=install
--strip-program=true" returned exit code 2
make: *** [debian/rules:18: binary-arch] Error 25
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned
exit status 2

```
The full buildd log is here:
https://buildd.debian.org/status/fetch.php?pkg=liboprf&arch=riscv64&ver=0.3.2-1&stamp=1726337751&raw=0

My solution to this issue:
  This error is caused by the fact that architectures other than x86 do not
support -fcf-protection=full. We can add a condition to check if the host
architecture is x86. If it is not x86, this CFLAG should be disabled.
   Additionally, when running tests for this package on the RISC-V
architecture, executing ulimit -s 66000; ./tp-dkg-corrupt 3 2 triggers a
Segmentation fault for an unknown reason. Therefore, I have temporarily
disabled this test.
   I have finished above work,and i have tested that locally,it works well.
The debpatch is in the attachment.Please let me know wheather this solution
can be accepted.

Gui-Yue
Best Regards

Attachment: fix_liboprf_build_failed.patch
Description: Binary data

Reply via email to