meson: Make mremap() detecting works correctly

Without this (at least in Fedora 35) it don't detect mremap()
correctly.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20220502131119.2345-1-quintela@redhat.com>
[Also switch the LEGACY_RDMA_REG_MR test to cc.links, otherwise
 Debian fails to build. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Juan Quintela 2022-05-02 15:11:19 +02:00 committed by Paolo Bonzini
parent dfdb4f3c28
commit 354d2d9b87

View File

@ -2179,7 +2179,8 @@ config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
have_pvrdma = get_option('pvrdma') \ have_pvrdma = get_option('pvrdma') \
.require(rdma.found(), error_message: 'PVRDMA requires OpenFabrics libraries') \ .require(rdma.found(), error_message: 'PVRDMA requires OpenFabrics libraries') \
.require(cc.compiles(''' .require(cc.compiles(gnu_source_prefix + '''
#include <sys/mman.h>
int main(void) int main(void)
{ {
char buf = 0; char buf = 0;
@ -2190,7 +2191,7 @@ have_pvrdma = get_option('pvrdma') \
}'''), error_message: 'PVRDMA requires mremap').allowed() }'''), error_message: 'PVRDMA requires mremap').allowed()
if have_pvrdma if have_pvrdma
config_host_data.set('LEGACY_RDMA_REG_MR', not cc.compiles(''' config_host_data.set('LEGACY_RDMA_REG_MR', not cc.links('''
#include <infiniband/verbs.h> #include <infiniband/verbs.h>
int main(void) int main(void)
{ {