DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH 1/5] eal: fix build with -O1
Date: Fri, 16 Nov 2018 17:58:50 +0100	[thread overview]
Message-ID: <20181116165854.24017-2-thomas@monjalon.net> (raw)
In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net>

In case of optimized compilation, RTE_BUILD_BUG_ON use an external
variable which is neither defined, nor used.
It seems not optimized out in case of OPDL compiled with clang -O1:
	opdl_ring.c: undefined reference to `RTE_BUILD_BUG_ON_detected_error'
	clang-6.0: fatal error: linker command failed with exit code 1

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/include/rte_common.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 87f0f6302..57acb8485 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -270,16 +270,7 @@ rte_is_aligned(void *ptr, unsigned align)
 /**
  * Triggers an error at compilation time if the condition is true.
  */
-#ifndef __OPTIMIZE__
 #define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-#else
-extern int RTE_BUILD_BUG_ON_detected_error;
-#define RTE_BUILD_BUG_ON(condition) do {             \
-	((void)sizeof(char[1 - 2*!!(condition)]));   \
-	if (condition)                               \
-		RTE_BUILD_BUG_ON_detected_error = 1; \
-} while(0)
-#endif
 
 /**
  * Combines 32b inputs most significant set bits into the least
-- 
2.19.0

  reply	other threads:[~2018-11-16 16:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 16:58 [dpdk-dev] [PATCH 0/5] fix build with option -O1 Thomas Monjalon
2018-11-16 16:58 ` Thomas Monjalon [this message]
2018-11-16 16:58 ` [dpdk-dev] [PATCH 2/5] kni: fix possible uninitialized variable Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 3/5] net/mlx4: " Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 4/5] eventdev: " Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 5/5] app/eventdev: " Thomas Monjalon
2018-11-23  0:26 ` [dpdk-dev] [PATCH 0/5] fix build with option -O1 Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181116165854.24017-2-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).