1 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2019-2021 Xilinx, Inc.
4 # Copyright(c) 2016-2019 Solarflare Communications Inc.
6 # This software was jointly developed between OKTET Labs (under contract
7 # for Solarflare) and Solarflare Communications, Inc.
11 reason = 'not supported on Windows'
15 if (arch_subdir != 'x86' and arch_subdir != 'arm') or (not dpdk_conf.get('RTE_ARCH_64'))
17 reason = 'only supported on x86_64 and aarch64'
23 # Strict-aliasing rules are violated by rte_eth_link to uint64_t casts
24 extra_flags += '-Wno-strict-aliasing'
26 # Enable more warnings
28 '-Wdisabled-optimization',
31 # Compiler and version dependent flags
34 '-Wbad-function-cast',
37 foreach flag: extra_flags
38 if cc.has_argument(flag)
43 # for gcc and old Clang compiles we need -latomic for 128-bit atomic ops
44 atomic_check_code = '''
50 b = __atomic_load_n(&a, __ATOMIC_RELAXED);
51 __atomic_store(&b, &a, __ATOMIC_RELAXED);
52 __atomic_store_n(&b, a, __ATOMIC_RELAXED);
56 if not cc.links(atomic_check_code)
57 libatomic_dep = cc.find_library('atomic', required: false)
58 if not libatomic_dep.found()
60 reason = 'missing dependency, "libatomic"'
64 # libatomic could be half-installed when above check finds it but
66 if not cc.links(atomic_check_code, dependencies: libatomic_dep)
68 reason = 'broken dependency, "libatomic"'
71 ext_deps += libatomic_dep
74 deps += ['common_sfc_efx', 'bus_pci']