Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libfabric 2.0.0 fails to build with gcc 15 #10796

Open
opoplawski opened this issue Feb 19, 2025 · 2 comments · May be fixed by #10857
Open

libfabric 2.0.0 fails to build with gcc 15 #10796

opoplawski opened this issue Feb 19, 2025 · 2 comments · May be fixed by #10857

Comments

@opoplawski
Copy link
Contributor

Describe the bug
Fedora has updated gcc to 15. libfabric fails to build with:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -D_GNU_SOURCE -D__USE_XOPEN2K8 -DSYSCONFDIR=\"/etc\" -DRDMADIR=\"@rdmadir@\" -DPROVDLDIR=\"/usr/lib64/libfabric\" -I./prov/sockets/include -I./prov/sockets -I./prov/lpp/include -I./prov/lpp -I./prov/verbs/include -I./prov/verbs/include/linux -I./prov/verbs/src/ep_rdm -I./prov/verbs/src/ep_dgram -I./prov/efa/src/ -I./prov/efa/src/dgram/ -I./prov/efa/src/rdm/ -D__LIBUSNIC__ -DWANT_DEBUG_MSGS=0 -DHAVE_LIBNL3=1 -I/usr/include/libnl3 -I./prov/usnic/src/usnic_direct -I./prov/opx/include -I./prov/opx/include -I./prov/opx/include/linux-i386 -I./include -I./include -D_GNU_SOURCE -D__USE_XOPEN2K8 -DSYSCONFDIR=\"/etc\" -DRDMADIR=\"@rdmadir@\" -DPROVDLDIR=\"/usr/lib64/libfabric\" -I./prov/sockets/include -I./prov/sockets -I./prov/lpp/include -I./prov/lpp -D__HIP_PLATFORM_HCC__=0 -D__HIP_PLATFORM_AMD__=0 -D__HIP_DEVICE_COMPILE__=0 -DUSE_PROF_API=0 -I./prov/lnx/include -I./prov/hook/include -I./prov/hook/perf/include -I./prov/hook/hook_debug/include -I./prov/hook/hook_hmem/include -I./prov/hook/dmabuf_peer_mem/include -Wall -O2 -DNDEBUG -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -c prov/opx/src/fi_opx_cq_ops_table_non_locking_8192.c  -fPIC -DPIC -o prov/opx/src/.libs/src_libfabric_la-fi_opx_cq_ops_table_non_locking_8192.o
In file included from ./prov/opx/include/rdma/opx/fi_opx_reliability.h:36,
                 from ./prov/opx/include/rdma/opx/fi_opx_domain.h:44,
                 from ./prov/opx/include/rdma/opx/fi_opx_endpoint.h:40,
                 from ./prov/opx/include/rdma/opx/fi_opx_eq.h:41,
                 from ./prov/opx/include/rdma/opx/fi_opx_cq_ops_table.h:38,
                 from prov/opx/src/fi_opx_cq_ops_table_non_locking_8192.c:33:
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:131:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  131 | OPX_COMPILE_TIME_ASSERT((FI_OPX_HFI_BTH_OPCODE_MP_EAGER_NTH == (FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ - sizeof(FI_OPX_HFI_BTH_HIGH_OPCODE_STRINGS)/sizeof(char*) + 2)), "FI_OPX_HFI_BTH_OPCODE_MP_EAGER_NTH must be first in the high opcode array, or dependent code conditionals need updated");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:132:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  132 | OPX_COMPILE_TIME_ASSERT((FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ == 0xFF), "FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ must be last in the high opcode array, or dependent code conditionals need updated");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:134:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  134 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_INJECT ^ FI_OPX_HFI_BTH_OPCODE_MSG_INJECT_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_INJECT and FI_OPX_HFI_BTH_OPCODE_MSG_INJECT_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:135:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  135 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_EAGER ^ FI_OPX_HFI_BTH_OPCODE_MSG_EAGER_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_EAGER and FI_OPX_HFI_BTH_OPCODE_MSG_EAGER_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:136:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  136 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST ^ FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST and FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:137:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  137 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS ^ FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS and FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:138:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  138 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_TAG_INJECT ^ FI_OPX_HFI_BTH_OPCODE_TAG_INJECT_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_TAG_INJECT and FI_OPX_HFI_BTH_OPCODE_TAG_INJECT_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:139:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  139 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_TAG_EAGER ^ FI_OPX_HFI_BTH_OPCODE_TAG_EAGER_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_TAG_EAGER and FI_OPX_HFI_BTH_OPCODE_TAG_EAGER_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:140:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  140 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST ^ FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST and FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:141:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  141 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS ^ FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ) == FI_OPX_HFI_BTH_OPCODE_CQ_BIT), "FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS and FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_CQ_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:143:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  143 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_INJECT ^ FI_OPX_HFI_BTH_OPCODE_TAG_INJECT) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_INJECT and FI_OPX_HFI_BTH_OPCODE_TAG_INJECT must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:144:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  144 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_INJECT_CQ ^ FI_OPX_HFI_BTH_OPCODE_TAG_INJECT_CQ) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_INJECT_CQ and FI_OPX_HFI_BTH_OPCODE_TAG_INJECT_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:145:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  145 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_EAGER ^ FI_OPX_HFI_BTH_OPCODE_TAG_EAGER) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_EAGER and FI_OPX_HFI_BTH_OPCODE_TAG_EAGER must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:146:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  146 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_EAGER_CQ ^ FI_OPX_HFI_BTH_OPCODE_TAG_EAGER_CQ) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_EAGER_CQ and FI_OPX_HFI_BTH_OPCODE_TAG_EAGER_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:147:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  147 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST ^ FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST and FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:148:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  148 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST_CQ ^ FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST_CQ) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_MP_EAGER_FIRST_CQ and FI_OPX_HFI_BTH_OPCODE_TAG_MP_EAGER_FIRST_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:149:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  149 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS ^ FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS and FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_packet.h:150:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  150 | OPX_COMPILE_TIME_ASSERT(((FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS_CQ ^ FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ) == FI_OPX_HFI_BTH_OPCODE_TAG_BIT), "FI_OPX_HFI_BTH_OPCODE_MSG_RZV_RTS_CQ and FI_OPX_HFI_BTH_OPCODE_TAG_RZV_RTS_CQ must only differ by FI_OPX_HFI_BTH_OPCODE_TAG_BIT");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_reliability.h:297:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  297 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_reliability_tx_replay, sdma_we) == FI_OPX_CACHE_LINE_SIZE,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_reliability.h:299:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  299 | OPX_COMPILE_TIME_ASSERT((offsetof(struct fi_opx_reliability_tx_replay, scb) & (FI_OPX_CACHE_LINE_SIZE - 1)) == 0,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_match.h:62:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
   62 | OPX_COMPILE_TIME_ASSERT((FI_OPX_MATCH_UE_HT_SIZE & FI_OPX_MATCH_UE_HT_MASK) == 0,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:203:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  203 | OPX_COMPILE_TIME_ASSERT(OPX_WORK_TYPE_SDMA == 0,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:340:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  340 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, inject_9B) == (FI_OPX_CACHE_LINE_SIZE * 1),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:342:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  342 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, send_9B) == (FI_OPX_CACHE_LINE_SIZE * 3),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:344:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  344 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, rzv_9B) == (FI_OPX_CACHE_LINE_SIZE * 5),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:346:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  346 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, inject_16B) == (FI_OPX_CACHE_LINE_SIZE * 7),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:348:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  348 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, send_16B) == (FI_OPX_CACHE_LINE_SIZE * 9),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:350:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  350 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, rzv_16B) == (FI_OPX_CACHE_LINE_SIZE * 11),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:352:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  352 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, av_addr) == (FI_OPX_CACHE_LINE_SIZE * 13),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:354:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  354 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, work_pending) == (FI_OPX_CACHE_LINE_SIZE * 14),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:356:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  356 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, work_pending_completion) == (FI_OPX_CACHE_LINE_SIZE * 15),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:358:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  358 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, sdma_request_queue) == (FI_OPX_CACHE_LINE_SIZE * 16),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:360:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  360 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_tx, ref_cnt) == (FI_OPX_CACHE_LINE_SIZE * 17),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:461:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  461 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_rx, queue) == FI_OPX_CACHE_LINE_SIZE,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:463:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  463 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_rx, cq_pending_ptr) == (FI_OPX_CACHE_LINE_SIZE * 3),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:465:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  465 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_rx, state) == (FI_OPX_CACHE_LINE_SIZE * 4),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:467:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  467 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep_rx, tx) == (FI_OPX_CACHE_LINE_SIZE * 5),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:586:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  586 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep, recv_cntr) == (FI_OPX_CACHE_LINE_SIZE * 2),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:588:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  588 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep, hfi) == (FI_OPX_CACHE_LINE_SIZE * 3),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:590:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  590 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep, common_info) == (FI_OPX_CACHE_LINE_SIZE * 4),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:592:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  592 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep, init_send_cntr) == (FI_OPX_CACHE_LINE_SIZE * 5),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_endpoint.h:594:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  594 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_ep, lock) == ((FI_OPX_CACHE_LINE_SIZE * 5)+52),
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hmem.h:60:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
   60 | OPX_COMPILE_TIME_ASSERT((sizeof(struct fi_opx_hmem_info) & 0x7) == 0,
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_transport.h:766:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  766 | OPX_COMPILE_TIME_ASSERT((offsetof(struct fi_opx_hfi1_dput_params, compare_iov) & 7) == 0, "compare_iov not 8-byte aligned!");
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_transport.h:815:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  815 | OPX_COMPILE_TIME_ASSERT(offsetof(struct fi_opx_hfi1_rx_rzv_rts_params, tid_info)
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_transport.h:819:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  819 | OPX_COMPILE_TIME_ASSERT(sizeof(((struct fi_opx_hfi1_rx_rzv_rts_params *)0)->dput_iov)
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_transport.h:822:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
  822 | OPX_COMPILE_TIME_ASSERT(sizeof(((struct fi_opx_hfi1_rx_rzv_rts_params *)0)->tidpairs)
      | ^~~~~~~~~~~~~~~~~~~~~~~
./prov/opx/include/rdma/opx/fi_opx.h:300:44: error: expected identifier or ‘(’ before ‘if’
  300 | #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}
      |                                            ^~
./prov/opx/include/rdma/opx/fi_opx_hfi1_progress.h:80:1: note: in expansion of macro ‘OPX_COMPILE_TIME_ASSERT’
   80 | OPX_COMPILE_TIME_ASSERT((FI_OPX_HFI1_HDRQ_UPDATE_MASK == FI_OPX_HFI1_HDRQ_UPDATE_MASK_32) ||
      | ^~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:27844: prov/opx/src/src_libfabric_la-fi_opx_cq_ops_table_non_locking_8192.lo] Error 1

To Reproduce
Build on Fedora 42+ with gcc 15.

@opoplawski
Copy link
Contributor Author

This can be worked around by setting -std=gnu17 but you may want to review https://gcc.gnu.org/gcc-15/porting_to.html#c23 to bring the code up to date.

@yselkowitz
Copy link

It's not mentioned there, but static_assert is also a new keyword in C23, and I think that's throwing off the check of static_assert for OPX_COMPILE_TIME_ASSERT in prov/opx/include/rdma/opx/fi_opx.h. glibc's <assert.h> defines static_assert in C11/C17 but not for C23 where it is a keyword (at least, in the glibc version in Fedora 41). Therefore, this fixes those particular errors:

--- a/prov/opx/include/rdma/opx/fi_opx.h
+++ b/prov/opx/include/rdma/opx/fi_opx.h
@@ -271,7 +271,7 @@ static inline void always_assert (bool val, char *msg)
 // Useful for checking that structures are the correct size and other
 // compile-time tests. static_assert has existed since C11 so this
 // should be safe, but we have an else clause just in case.
-#if defined(static_assert)
+#if __STDC_VERSION__ >= 201112L
 #define OPX_COMPILE_TIME_ASSERT(cond, msg) static_assert(cond,msg)
 #else
 #define OPX_COMPILE_TIME_ASSERT(cond, msg) if(0){switch(0){case 0:case cond:;}}

Once you get past that, there is more though:

prov/opx/src/fi_opx_tid_cache.c: In function ‘opx_tid_cache_setup’:
prov/opx/src/fi_opx_tid_cache.c:1415:30: error: assignment to ‘int (*)(struct ofi_mr_cache *, struct ofi_mr_entry *)’ from incompatible pointer type ‘int (*)(void)’ [-Wincompatible-pointer-types]
 1415 |         (*cache)->add_region = opx_tid_cache_add_abort;
      |                              ^
In file included from ./prov/opx/include/rdma/opx/fi_opx_endpoint.h:53,
                 from prov/opx/src/fi_opx_tid_cache.c:54:
./prov/opx/include/fi_opx_tid_cache.h:52:5: note: ‘opx_tid_cache_add_abort’ declared here
   52 | int opx_tid_cache_add_abort();
      |     ^~~~~~~~~~~~~~~~~~~~~~~
prov/opx/src/fi_opx_tid_cache.c:1416:33: error: assignment to ‘void (*)(struct ofi_mr_cache *, struct ofi_mr_entry *)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
 1416 |         (*cache)->delete_region = opx_tid_cache_delete_abort;
      |                                 ^
./prov/opx/include/fi_opx_tid_cache.h:53:6: note: ‘opx_tid_cache_delete_abort’ declared here
   53 | void opx_tid_cache_delete_abort();
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~

This is explained in the GCC 15 doc; in C23, the interpretation of function declarations without parameters changed from unspecified (as in K&R) to void. The fix being to specify the expected parameters despite being unused:

--- a/prov/opx/include/fi_opx_tid_cache.h
+++ b/prov/opx/include/fi_opx_tid_cache.h
@@ -49,8 +49,8 @@
 int opx_tid_cache_setup(struct ofi_mr_cache **cache,
 			struct opx_tid_domain *domain);
 
-int opx_tid_cache_add_abort();
-void opx_tid_cache_delete_abort();
+int opx_tid_cache_add_abort(struct ofi_mr_cache *, struct ofi_mr_entry *);
+void opx_tid_cache_delete_abort(struct ofi_mr_cache *, struct ofi_mr_entry *);
 
 enum opx_tid_cache_entry_status {
 	OPX_TID_CACHE_ENTRY_NOT_FOUND = 0,
--- a/prov/opx/src/fi_opx_tid_cache.c
+++ b/prov/opx/src/fi_opx_tid_cache.c
@@ -2059,13 +2059,13 @@ void opx_tid_cache_cleanup(struct ofi_mr_cache *cache)
 	assert(cache->uncached_size == 0);
 }
 
-int opx_tid_cache_add_abort(){
+int opx_tid_cache_add_abort(struct ofi_mr_cache *, struct ofi_mr_entry *){
 	fprintf(stderr, "%s unexpected function call\n", __func__);
 	abort();
 	return 0;
 }
 
-void opx_tid_cache_delete_abort(){
+void opx_tid_cache_delete_abort(struct ofi_mr_cache *, struct ofi_mr_entry *){
 	fprintf(stderr, "%s unexpected function call\n", __func__);
 	abort();
 }

@yselkowitz yselkowitz linked a pull request Mar 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants