[PATCH rdma-core] Fix cmake detection of ifunc on gcc-8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



gcc-8 now checks that the return result of the resolver function
is a function pointer matching the signature of the resolved function,
which causes cmake's test to fail. The actual implementation already did
this right.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

This is needed for FC28, Leon can you add it to your existing PR on
this same topic?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a5fe5ae3b240d..a69d64c584c6b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,7 +208,8 @@ CHECK_C_SOURCE_COMPILES("
 
  static void do_entry(void) {}
  void entry(void) __attribute__((ifunc(\"resolve_entry\")));
- static void *resolve_entry(void) {return &do_entry;}
+ typedef void (*fn_t)(void);
+ static fn_t resolve_entry(void) {return &do_entry;}
 
  int main(int argc,const char *argv[]) { entry(); }"
   HAVE_FUNC_ATTRIBUTE_IFUNC
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux