Source: papi
Version: 7.1.0-5
Severity: serious
Tags: FTBFS, patch
User: debian-ri...@lists.debian.org
Usertags: riscv64

Dear papi maintainer,
The package papi build failed on riscv64.The crucial buildd log below:
```



cc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE
-DUSE_PERFEVENT_RDPMC=1
-DPEINCLUDE=\"/usr/include/perfmon/perf_event.h\" -D_REENTRANT
-D_GNU_SOURCE -DUSE_COMPILER_TLS -fvisibility=hidden -I. -g -O2
-Werror=implicit-function-declaration
-ffile-prefix-map=/build/reproducible-path/papi-7.1.0=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2  -DHAVE_ROCM_SMI -DPAPI_NUM_COMP=5
-I/usr/../include/rocm_smi -I/usr/../include -I/usr/include/rocm_smi
-g -I/usr/include -I/usr/include/hsa -I/usr/hsa/include
-I/usr/hsa/include/hsa -I/usr/include/rocm_smi -I/usr/rocm_smi/include
-I/usr/rocm_smi/include/rocm_smi -DOSLOCK=\"linux-lock.h\"
-DOSCONTEXT=\"linux-context.h\" -O2 -Wl,-z,relro -Wl,-z,now
-Wl,--enable-new-dtags  -ldl -pthread  -g -Icomponents/sde -g -ldl
-pthread -c components/sde/sde.c -o sde.o
In file included from ./papi_internal.h:119,
                 from components/perf_event/pe_libpfm4_events.c:19:
./linux-context.h:45:2: error: #error "OVERFLOW_ADDRESS() undefined!"
   45 | #error "OVERFLOW_ADDRESS() undefined!"
      |  ^~~~~
In file included from ./linux-lock.h:4,
                 from ./papi_lock.h:20,
                 from ./papi_internal.h:437:
./mb.h:70:2: error: #error Need to define rmb for this architecture!
   70 | #error Need to define rmb for this architecture!
      |  ^~~~~
./mb.h:71:2: error: #error See the kernel source directory:
tools/perf/perf.h file
   71 | #error See the kernel source directory: tools/perf/perf.h file
      |  ^~~~~
In file included from ./papi_internal.h:119,
                 from components/sde/sde_internal.h:14,
                 from components/sde/sde.c:14:
./linux-context.h:45:2: error: #error "OVERFLOW_ADDRESS() undefined!"
   45 | #error "OVERFLOW_ADDRESS() undefined!"
      |  ^~~~~
In file included from ./linux-lock.h:4,
                 from ./papi_lock.h:20,
                 from ./papi_internal.h:437:
./mb.h:70:2: error: #error Need to define rmb for this architecture!
   70 | #error Need to define rmb for this architecture!
      |  ^~~~~
./mb.h:71:2: error: #error See the kernel source directory:
tools/perf/perf.h file
   71 | #error See the kernel source directory: tools/perf/perf.h file
      |  ^~~~~
In file included from ./papi_internal.h:119,
                 from components/perf_event/perf_event.c:38:
./linux-context.h:45:2: error: #error "OVERFLOW_ADDRESS() undefined!"
   45 | #error "OVERFLOW_ADDRESS() undefined!"
      |  ^~~~~
In file included from ./linux-lock.h:4,
                 from ./papi_lock.h:20,
                 from ./papi_internal.h:437:
./mb.h:70:2: error: #error Need to define rmb for this architecture!
   70 | #error Need to define rmb for this architecture!
      |  ^~~~~
./mb.h:71:2: error: #error See the kernel source directory:
tools/perf/perf.h file
   71 | #error See the kernel source directory: tools/perf/perf.h file
      |  ^~~~~
In file included from ./papi_internal.h:119,
                 from components/perf_event_uncore/perf_event_uncore.c:29:
./linux-context.h:45:2: error: #error "OVERFLOW_ADDRESS() undefined!"
   45 | #error "OVERFLOW_ADDRESS() undefined!"
      |  ^~~~~
In file included from ./linux-lock.h:4,
                 from ./papi_lock.h:20,
                 from ./papi_internal.h:437:
./mb.h:70:2: error: #error Need to define rmb for this architecture!
   70 | #error Need to define rmb for this architecture!
      |  ^~~~~
./mb.h:71:2: error: #error See the kernel source directory:
tools/perf/perf.h file
   71 | #error See the kernel source directory: tools/perf/perf.h file
      |  ^~~~~
In file included from components/perf_event/perf_event.c:56:
components/perf_event/perf_helpers.h: In function ‘mmap_read_head’:
components/perf_event/perf_helpers.h:432:9: error: implicit
declaration of function ‘rmb’ [-Wimplicit-function-declaration]
  432 |         rmb();
      |         ^~~
components/sde/sde.c: In function ‘_sde_dispatch_timer’:
make[1]: *** [components/perf_event/Rules.perf_event:9:
pe_libpfm4_events.o] Error 1
make[1]: *** Waiting for unfinished jobs....
./linux-context.h:48:44: error: implicit declaration of function
‘OVERFLOW_ADDRESS’; did you mean ‘GET_OVERFLOW_ADDRESS’?
[-Wimplicit-function-declaration]
   48 | #define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
      |                                            ^~~~~~~~~~~~~~~~
components/sde/sde.c:875:15: note: in expansion of macro ‘GET_OVERFLOW_ADDRESS’
  875 |     address = GET_OVERFLOW_ADDRESS( hw_context );
      |               ^~~~~~~~~~~~~~~~~~~~
./linux-context.h:48:35: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
   48 | #define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
      |                                   ^
components/sde/sde.c:875:15: note: in expansion of macro ‘GET_OVERFLOW_ADDRESS’
  875 |     address = GET_OVERFLOW_ADDRESS( hw_context );
      |               ^~~~~~~~~~~~~~~~~~~~
components/sde/sde.c: In function ‘invoke_user_handler’:
./linux-context.h:48:35: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
   48 | #define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
      |                                   ^
components/sde/sde.c:927:15: note: in expansion of macro ‘GET_OVERFLOW_ADDRESS’
  927 |     address = GET_OVERFLOW_ADDRESS( hw_context );
      |               ^~~~~~~~~~~~~~~~~~~~
components/perf_event/perf_event.c: In function ‘_pe_dispatch_timer’:
make[1]: *** [components/perf_event_uncore/Rules.perf_event_uncore:8:
perf_event_uncore.o] Error 1
./linux-context.h:48:44: error: implicit declaration of function
‘OVERFLOW_ADDRESS’; did you mean ‘GET_OVERFLOW_ADDRESS’?
[-Wimplicit-function-declaration]
   48 | #define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
      |                                            ^~~~~~~~~~~~~~~~
components/perf_event/perf_event.c:2002:27: note: in expansion of
macro ‘GET_OVERFLOW_ADDRESS’
 2002 |                 address = GET_OVERFLOW_ADDRESS( hw_context );
      |                           ^~~~~~~~~~~~~~~~~~~~
make[1]: *** [components/sde/Rules.sde:11: sde.o] Error 1
./linux-context.h:48:35: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
   48 | #define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
      |                                   ^
components/perf_event/perf_event.c:2002:27: note: in expansion of
macro ‘GET_OVERFLOW_ADDRESS’
 2002 |                 address = GET_OVERFLOW_ADDRESS( hw_context );
      |                           ^~~~~~~~~~~~~~~~~~~~
make[1]: *** [components/perf_event/Rules.perf_event:6: perf_event.o] Error 1
make[1]: Leaving directory '/build/reproducible-path/papi-7.1.0/src'
dh_auto_build: error: cd src && make -j4 returned exit code 2
make: *** [debian/rules:35: binary-arch] Error 25
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned
exit status 2
--------------------------------------------------------------------------------
Build finished at 2025-04-16T12:50:13Z

```
The full buildd log is here:
https://buildd.debian.org/status/fetch.php?pkg=papi&arch=riscv64&ver=7.1.0-5&stamp=1744807822&raw=0

My solution to this issue:
The issue is caused by the lack of RISC-V support in papi. Therefore, it
can be resolved by adding support for RISC-V. I referred to an upstream PR
and added support for RISC-V accordingly(
https://github.com/icl-utk-edu/papi/pull/149).The debdiff patch is in the
attachment.I have tested that locally, and it works well. Please let me
know whether this solution can be accepted.

Gui-Yue
Best Regards

Attachment: support_riscv_for_papi.patch
Description: Binary data

Reply via email to