DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] build: remove obsolete compiler checks
@ 2025-07-18 12:14 Bruce Richardson
  2025-07-18 12:21 ` David Marchand
  2025-07-18 12:45 ` David Marchand
  0 siblings, 2 replies; 6+ messages in thread
From: Bruce Richardson @ 2025-07-18 12:14 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
checks and workarounds for versions old than these.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build                  |  5 ----
 drivers/event/meson.build           |  5 +---
 drivers/meson.build                 |  2 +-
 drivers/net/virtio/meson.build      |  2 +-
 lib/eal/arm/include/rte_memcpy_64.h |  8 -------
 lib/eal/arm/include/rte_vect.h      | 37 ++---------------------------
 lib/eal/ppc/include/rte_altivec.h   |  1 -
 lib/meson.build                     |  2 +-
 lib/vhost/meson.build               |  4 ++--
 lib/vhost/vhost.c                   | 16 -------------
 10 files changed, 8 insertions(+), 74 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index f31fef216c..c7a780dcc8 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -492,11 +492,6 @@ if get_option('b_lto')
     else
         error('compiler does not support fat LTO objects - please turn LTO off')
     endif
-    # workaround for gcc bug 81440
-    if cc.get_id() == 'gcc' and cc.version().version_compare('<8.0')
-        add_project_arguments('-Wno-lto-type-mismatch', language: 'c')
-        add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
-    endif
 endif
 
 if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined'
diff --git a/drivers/event/meson.build b/drivers/event/meson.build
index d6706b57f7..b0bc3f40f1 100644
--- a/drivers/event/meson.build
+++ b/drivers/event/meson.build
@@ -14,9 +14,6 @@ drivers = [
         'opdl',
         'skeleton',
         'sw',
+        'octeontx',
 ]
-if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
-        dpdk_conf.has('RTE_ARCH_ARM64'))
-    drivers += 'octeontx'
-endif
 std_deps = ['eventdev', 'kvargs']
diff --git a/drivers/meson.build b/drivers/meson.build
index b62880db02..2760f4d593 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -237,7 +237,7 @@ foreach subpath:subdirs
         enabled_drivers += name
         lib_name = '_'.join(['rte', class, name])
         cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name])
-        if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+        if annotate_locks and cc.get_id() == 'clang'
             cflags += '-DRTE_ANNOTATE_LOCKS'
             cflags += '-Wthread-safety'
         endif
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index d3caa3a3b4..a9ff87e863 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -31,7 +31,7 @@ if arch_subdir == 'x86'
         sources_avx512 += files('virtio_rxtx_packed.c')
         if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
             cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
-        elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+        elif (toolchain == 'clang')
             cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
         endif
     endif
diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h
index 90039039be..57fe24eb10 100644
--- a/lib/eal/arm/include/rte_memcpy_64.h
+++ b/lib/eal/arm/include/rte_memcpy_64.h
@@ -89,14 +89,6 @@ n <= (size_t)RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)
  **************************************/
 
 
-#if RTE_CC_IS_GNU && !defined RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK
-#if (GCC_VERSION < 50400)
-#warning "The GCC version is quite old, which may result in sub-optimal \
-performance of the compiled code. It is suggested that at least GCC 5.4.0 \
-be used."
-#endif
-#endif
-
 static __rte_always_inline
 void rte_mov16(uint8_t *dst, const uint8_t *src)
 {
diff --git a/lib/eal/arm/include/rte_vect.h b/lib/eal/arm/include/rte_vect.h
index c97d299a3e..149458288e 100644
--- a/lib/eal/arm/include/rte_vect.h
+++ b/lib/eal/arm/include/rte_vect.h
@@ -67,11 +67,8 @@ vaddvq_u16(uint16x8_t a)
 
 #endif
 
-#if (defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)) || \
-(defined(RTE_ARCH_ARM64) && RTE_CC_IS_GNU && (GCC_VERSION < 70000))
-/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32)
- * On AArch64, this intrinsic is supported since GCC version 7.
- */
+#if defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)
+/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32) */
 static inline uint32x4_t
 vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
 		 uint32x4_t b, const int lane_b)
@@ -80,36 +77,6 @@ vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
 }
 #endif
 
-#if defined(RTE_ARCH_ARM64)
-#if RTE_CC_IS_GNU && (GCC_VERSION < 70000)
-
-/* NEON intrinsic vreinterpretq_u64_p128() is supported since GCC version 7 */
-static inline uint64x2_t
-vreinterpretq_u64_p128(poly128_t x)
-{
-	return (uint64x2_t)x;
-}
-
-/* NEON intrinsic vreinterpretq_p64_u64() is supported since GCC version 7 */
-static inline poly64x2_t
-vreinterpretq_p64_u64(uint64x2_t x)
-{
-	return (poly64x2_t)x;
-}
-
-/* NEON intrinsic vgetq_lane_p64() is supported since GCC version 7 */
-static inline poly64_t
-vgetq_lane_p64(poly64x2_t x, const int lane)
-{
-	RTE_ASSERT(lane >= 0 && lane <= 1);
-
-	poly64_t *p = (poly64_t *)&x;
-
-	return p[lane];
-}
-#endif
-#endif
-
 /*
  * If (0 <= index <= 15), then call the ASIMD ext instruction on the
  * 128 bit regs v0 and v1 with the appropriate index.
diff --git a/lib/eal/ppc/include/rte_altivec.h b/lib/eal/ppc/include/rte_altivec.h
index 7c088d2d16..bc8548f11e 100644
--- a/lib/eal/ppc/include/rte_altivec.h
+++ b/lib/eal/ppc/include/rte_altivec.h
@@ -6,7 +6,6 @@
 #ifndef _RTE_ALTIVEC_H_
 #define _RTE_ALTIVEC_H_
 
-/* To include altivec.h, GCC version must be >= 4.8 */
 #include <altivec.h>
 
 /*
diff --git a/lib/meson.build b/lib/meson.build
index 0d56b2083b..a67efaf718 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -244,7 +244,7 @@ foreach l:libraries
         cflags += '-DRTE_USE_FUNCTION_VERSIONING'
     endif
     cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l
-    if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+    if annotate_locks and cc.get_id() == 'clang'
         cflags += '-DRTE_ANNOTATE_LOCKS'
         cflags += '-Wthread-safety'
     endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 9c6325aa0e..a74d0cff7c 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -8,9 +8,9 @@ endif
 if has_libnuma
     dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
-if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
+if (toolchain == 'gcc')
     cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
-elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+elif (toolchain == 'clang')
     cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
 endif
 dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index a2e3e2635d..416f082dca 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -128,16 +128,8 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,
 static __rte_always_inline void
 vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
 {
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
-	/*
-	 * __sync_ built-ins are deprecated, but rte_atomic_ ones
-	 * are sub-optimized in older GCC versions.
-	 */
-	__sync_fetch_and_or_1(addr, (1U << nr));
-#else
 	rte_atomic_fetch_or_explicit((volatile uint8_t __rte_atomic *)addr, (1U << nr),
 		rte_memory_order_relaxed);
-#endif
 }
 
 static __rte_always_inline void
@@ -207,17 +199,9 @@ __vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq)
 	for (i = 0; i < vq->log_cache_nb_elem; i++) {
 		struct log_cache_entry *elem = vq->log_cache + i;
 
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
-		/*
-		 * '__sync' builtins are deprecated, but 'rte_atomic' ones
-		 * are sub-optimized in older GCC versions.
-		 */
-		__sync_fetch_and_or(log_base + elem->offset, elem->val);
-#else
 		rte_atomic_fetch_or_explicit(
 			(unsigned long __rte_atomic *)(log_base + elem->offset),
 			elem->val, rte_memory_order_relaxed);
-#endif
 	}
 
 	rte_atomic_thread_fence(rte_memory_order_release);
-- 
2.48.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-18 13:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-18 12:14 [PATCH] build: remove obsolete compiler checks Bruce Richardson
2025-07-18 12:21 ` David Marchand
2025-07-18 12:34   ` Bruce Richardson
2025-07-18 12:45 ` David Marchand
2025-07-18 13:05   ` Bruce Richardson
2025-07-18 13:36     ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).