Hi!
> > Does the trick suggested by Mike (vapier) works for you?
> > 
> > I.e. changing the input of the exp10() function to (float)argc so that
> > the compiler cannot assume that the vhole expression is a constant?
> 
> I would try it, but I have issues using autoreconf -vif in the top
> level sourcedir to recreate configure and co. after I made the
> change in the exp10 m4 file. I see no bootstrap script either.
> What is the correct command to regenerate configure in LTP?

Argh, you are right, using autoreconf the macros from m4 directory are
not used for the realtime testsuite. I will have a look at that later.

For now try doing 'make distclean' and 'make autotools' which seems to
work fine for me.


Also I've found that changing the exp10() parameter not to be constant
breaks the check on systems that does have it, we have to add -lm to
LIBS too. Can you try attached patch to see if it works correctly for
you?

-- 
Cyril Hrubis
chru...@suse.cz
>From 03bf456cb5b65ff7cfabfab3758ca8f3c6816556 Mon Sep 17 00:00:00 2001
From: Cyril Hrubis <chru...@suse.cz>
Date: Thu, 4 Sep 2014 11:28:55 +0200
Subject: [PATCH] realtime: Fix exp10 check.

The parameter to exp10() function was constant and because of that it
was substituted by a constant at the compile time.

This patch passes volatile float as the parameter and also adds -lm to
the LIBS which is needed to link the test.

Reported-by: Waldemar Brodkorb <w...@openadk.org>
Signed-off-by: Cyril Hrubis <chru...@suse.cz>
---
 testcases/realtime/m4/ltp-exp10.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testcases/realtime/m4/ltp-exp10.m4 b/testcases/realtime/m4/ltp-exp10.m4
index 4fe7091..84a3d9b 100644
--- a/testcases/realtime/m4/ltp-exp10.m4
+++ b/testcases/realtime/m4/ltp-exp10.m4
@@ -24,10 +24,14 @@ AC_DEFUN([LTP_CHECK_EXP10],[
 AH_TEMPLATE(HAVE_EXP10,
 [Define to 1 if you have 'exp10' function.])
 AC_MSG_CHECKING([for exp10])
+backup_ldlibs="$LIBS"
+LIBS+=" -lm"
 AC_TRY_LINK([#define _GNU_SOURCE
              #include <math.h>],
             [
-             exp10(0.00);
+	     volatile float val;
+             exp10(val);
             ],
              AC_DEFINE(HAVE_EXP10) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+LIBS="$backup_ldlibs"
 ])
-- 
1.8.5.5

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to