Skip to content

Commit 519dd9a

Browse files
author
François Févotte
committed
Merge branch 'master' into release
2 parents b17d5f3 + 9c5ad17 commit 519dd9a

File tree

6 files changed

+44
-15
lines changed

6 files changed

+44
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ This version is based on Valgrind-3.12.0.
1616
- Continuous integration using the Travis system.
1717
- Improve Delta-Debugging customization through environment variables.
1818

19+
### Changed
1920

21+
- There is no need anymore for an external, statically compiled libc/libm.
22+
23+
24+
---
2025

2126
## v0.9.0 - 2017-03-31
2227

Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CXXFLAGS = \
5151
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \
5252
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@)
5353
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \
54-
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) \
55-
-lm -lc
54+
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@)
5655
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \
5756
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
5857
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LINK = \

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ Build and install:
4545
make install
4646

4747

48+
### Load the environment
49+
50+
In order to actually use Verrou, you must load the correct environment. This can
51+
be done using:
52+
53+
source PREFIX/env.sh
54+
55+
4856
### Test (optional)
4957

5058
#### General tests

verrou_dd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def runCmd(cmd, fname, envvars=None):
2323
if envvars is None:
2424
envvars = {}
2525

26-
with open("%s.out"%fname, "w") as fout, \
27-
open("%s.err"%fname, "w") as ferr:
28-
env = copy.deepcopy(os.environ)
29-
for var in envvars:
30-
env[var] = envvars[var]
31-
return subprocess.call(cmd, env=env, stdout=fout, stderr=ferr)
26+
with open("%s.out"%fname, "w") as fout:
27+
with open("%s.err"%fname, "w") as ferr:
28+
env = copy.deepcopy(os.environ)
29+
for var in envvars:
30+
env[var] = envvars[var]
31+
return subprocess.call(cmd, env=env, stdout=fout, stderr=ferr)
3232

3333
def prepareOutput(dirname):
3434
shutil.rmtree(dirname, ignore_errors=True)

vr_fpRepr.hxx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,19 @@ inline REALTYPE nextAfter(REALTYPE a){
208208

209209
template<>
210210
inline double nextAfter<double>(double a){
211-
return nextafter(a,DBL_MAX );
211+
double res=a;
212+
__uint64_t* resU=reinterpret_cast<__uint64_t*>(&res);
213+
(*resU)+=1;
214+
return res;
212215
};
213216

214217

215218
template<>
216219
inline float nextAfter<float>(float a){
217-
return nextafterf(a,FLT_MAX );
220+
float res=a;
221+
__uint32_t* resU=reinterpret_cast<__uint32_t*>(&res);
222+
(*resU)+=1;
223+
return res;
218224
};
219225

220226

@@ -226,11 +232,17 @@ inline REALTYPE nextPrev(REALTYPE a){
226232

227233
template<>
228234
inline double nextPrev<double>(double a){
229-
return nextafter(a,-DBL_MAX );
235+
double res=a;
236+
__uint64_t* resU=reinterpret_cast<__uint64_t*>(&res);
237+
(*resU)-=1;
238+
return res;
230239
};
231240

232241

233242
template<>
234243
inline float nextPrev<float>(float a){
235-
return nextafterf(a,-FLT_MAX );
244+
float res=a;
245+
__uint32_t* resU=reinterpret_cast<__uint32_t*>(&res);
246+
(*resU)-=1;
247+
return res;
236248
};

vr_rand.hxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#pragma once
3434

35+
extern "C" {
36+
#include "pub_tool_libcproc.h"
37+
}
3538

3639
class vrRand{
3740
public:
@@ -49,7 +52,9 @@ public:
4952
};
5053

5154
inline void setTimeSeed(unsigned int pid){
52-
unsigned int seed=time(NULL) + pid;
55+
struct vki_timeval now;
56+
VG_(gettimeofday)(&now, NULL);
57+
unsigned int seed = now.tv_usec + pid;
5358
VG_(umsg)("First seed : %u\n",seed);
5459
setSeed(seed);
5560
};
@@ -90,13 +95,13 @@ private:
9095
// srand(c);
9196
vr_next_=c;
9297
}
93-
98+
9499
inline int privaterand(){
95100
// rand();
96101
vr_next_ = vr_next_ * 1103515245 + 12345;
97102
return (unsigned int)(vr_next_/65536) % 32768;
98103
}
99-
104+
100105
inline int privateRAND_MAX()const{
101106
// return RAND_MAX;
102107
return 32767;

0 commit comments

Comments
 (0)