Source: sysprof
Version:  48~beta-1
Severity: serious
Tags: FTBFS, patch
User: debian-ri...@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: debian-ri...@lists.debian.org

Dear sysprof maintainer,
The package sysprof build failed on most arch.The crucial buildd log below:
```

[294/504] cc -Isrc/sysprof-live-unwinder/tests/test-live-unwinder.p
-Isrc/sysprof-live-unwinder/tests -I../src/sysprof-live-unwinder/tests
-Isrc/libsysprof -I../src/libsysprof -Isrc/libsysprof-capture
-I../src/libsysprof-capture -Icontrib/eggbitset -I../contrib/eggbitset
-Icontrib/elfparser -I../contrib/elfparser -Icontrib/linereader
-I../contrib/linereader -I/usr/include/glib-2.0
-I/usr/lib/arm-linux-gnueabi/glib-2.0/include -I/usr/include/sysprof-6
-I/usr/include/libmount -I/usr/include/blkid
-I/usr/include/gio-unix-2.0 -I/usr/include/libdex-1
-I/usr/include/json-glib-1.0 -I/usr/include/polkit-1
'-I/build/reproducible-path/sysprof-48~beta/obj-arm-linux-gnueabi'
-fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=gnu17
-DSYSPROF_COMPILATION -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76
-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_76
-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_16
-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_16 -Wcast-align
-Wdeclaration-after-statement -Wformat-nonliteral -Wformat-security
-Wmissing-include-dirs -Wnested-externs
-Wno-missing-field-initializers -Wno-sign-compare
-Wno-unused-parameter -Wno-cast-function-type -Wpointer-arith
-Wredundant-decls -Wswitch-default -Wswitch-enum -Wuninitialized
-Werror=format-security -Werror=format=2 -Werror=empty-body
-Werror=implicit-function-declaration -Werror=pointer-arith
-Werror=init-self -Werror=int-conversion
-Werror=misleading-indentation -Werror=missing-include-dirs
-Werror=overflow -Werror=return-type -Werror=shadow
-Werror=strict-prototypes -Werror=undef -g -O2
-Werror=implicit-function-declaration
'-ffile-prefix-map=/build/reproducible-path/sysprof-48~beta=.'
-fstack-protector-strong -fstack-clash-protection -Wformat
-Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -pthread
-DG_ENABLE_DEBUG -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
'-DBUILDDIR="/build/reproducible-path/sysprof-48~beta/obj-arm-linux-gnueabi/src/sysprof-live-unwinder/tests"'
-MD -MQ 
src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o
-MF 
src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o.d
-o src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o
-c ../src/sysprof-live-unwinder/tests/test-live-unwinder.c
FAILED: 
src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o
cc -Isrc/sysprof-live-unwinder/tests/test-live-unwinder.p
-Isrc/sysprof-live-unwinder/tests -I../src/sysprof-live-unwinder/tests
-Isrc/libsysprof -I../src/libsysprof -Isrc/libsysprof-capture
-I../src/libsysprof-capture -Icontrib/eggbitset -I../contrib/eggbitset
-Icontrib/elfparser -I../contrib/elfparser -Icontrib/linereader
-I../contrib/linereader -I/usr/include/glib-2.0
-I/usr/lib/arm-linux-gnueabi/glib-2.0/include -I/usr/include/sysprof-6
-I/usr/include/libmount -I/usr/include/blkid
-I/usr/include/gio-unix-2.0 -I/usr/include/libdex-1
-I/usr/include/json-glib-1.0 -I/usr/include/polkit-1
'-I/build/reproducible-path/sysprof-48~beta/obj-arm-linux-gnueabi'
-fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=gnu17
-DSYSPROF_COMPILATION -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76
-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_76
-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_16
-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_16 -Wcast-align
-Wdeclaration-after-statement -Wformat-nonliteral -Wformat-security
-Wmissing-include-dirs -Wnested-externs
-Wno-missing-field-initializers -Wno-sign-compare
-Wno-unused-parameter -Wno-cast-function-type -Wpointer-arith
-Wredundant-decls -Wswitch-default -Wswitch-enum -Wuninitialized
-Werror=format-security -Werror=format=2 -Werror=empty-body
-Werror=implicit-function-declaration -Werror=pointer-arith
-Werror=init-self -Werror=int-conversion
-Werror=misleading-indentation -Werror=missing-include-dirs
-Werror=overflow -Werror=return-type -Werror=shadow
-Werror=strict-prototypes -Werror=undef -g -O2
-Werror=implicit-function-declaration
'-ffile-prefix-map=/build/reproducible-path/sysprof-48~beta=.'
-fstack-protector-strong -fstack-clash-protection -Wformat
-Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -pthread
-DG_ENABLE_DEBUG -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
'-DBUILDDIR="/build/reproducible-path/sysprof-48~beta/obj-arm-linux-gnueabi/src/sysprof-live-unwinder/tests"'
-MD -MQ 
src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o
-MF 
src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o.d
-o src/sysprof-live-unwinder/tests/test-live-unwinder.p/test-live-unwinder.c.o
-c ../src/sysprof-live-unwinder/tests/test-live-unwinder.c
../src/sysprof-live-unwinder/tests/test-live-unwinder.c: In function
‘open_perf_stream’:
../src/sysprof-live-unwinder/tests/test-live-unwinder.c:61:38: error:
‘PERF_REG_EXTENDED_MASK’ undeclared (first use in this function); did
you mean ‘PERF_BR_EXTEND_ABI’?
   61 | # define SYSPROF_ARCH_PREFERRED_REGS PERF_REG_EXTENDED_MASK
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
../src/sysprof-live-unwinder/tests/test-live-unwinder.c:126:31: note:
in expansion of macro ‘SYSPROF_ARCH_PREFERRED_REGS’
  126 |       attr.sample_regs_user = SYSPROF_ARCH_PREFERRED_REGS;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/sysprof-live-unwinder/tests/test-live-unwinder.c:61:38: note:
each undeclared identifier is reported only once for each function it
appears in
   61 | # define SYSPROF_ARCH_PREFERRED_REGS PERF_REG_EXTENDED_MASK
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
../src/sysprof-live-unwinder/tests/test-live-unwinder.c:126:31: note:
in expansion of macro ‘SYSPROF_ARCH_PREFERRED_REGS’
  126 |       attr.sample_regs_user = SYSPROF_ARCH_PREFERRED_REGS;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~

```
The full buildd los is here:
https://buildd.debian.org/status/fetch.php?pkg=sysprof&arch=riscv64&ver=48%7Ebeta-1&stamp=1738975361&raw=0
My solution to this issue:
  The cause of this error is that the code uses the macro
"PERF_REG_EXTENDED_MASK" on a non-x86 architecture, whereas this macro is
typically defined only on x86 platforms (or after including certain x86
header files).   To resolve this issue, you can adopt a conditional check
approach: if a non‑x86 platform is detected or if PERF_REG_EXTENDED_MASK is
not defined, provide an appropriate default value (for example, 0ULL).The
debpatch is in the attachment.I have tested it locally and it works
well.Please let me know whether this solution can be accepted.
Gui-Yue
Best Regards

Attachment: fix_sysprof_build_failed.patch
Description: Binary data

Reply via email to