• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/fio/0001-Fix-compile-of-test-programs-on-archs-that-use-arch_.patch
Thomas PetazzoniThomas Petazzoni committed 8ec845693b810 Mar 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From 71471cb1d05f3877c8fb935fbf70a6bae789ac49 Mon Sep 17 00:00:00 2001
2
From: Jens Axboe <axboe@fb.com>
3
Date: Thu, 10 Mar 2016 08:09:41 -0700
4
Subject: [PATCH] Fix compile of test programs on archs that use arch_flags at
5
 runtime
6
​
7
SuperH compile currently fails with:
8
​
9
gettime.o: In function fio_gettime':
10
/home/thomas/projets/buildroot/output/build/fio-fio-2.7/gettime.c:163: undefined reference to arch_flags'
11
gettime.o: In function utime_since_now':
12
/home/thomas/projets/buildroot/output/build/fio-fio-2.7/gettime.c:164: undefined reference to arch_flags'
13
gettime.o: In function mtime_since_now':
14
/home/thomas/projets/buildroot/output/build/fio-fio-2.7/gettime.c:164: undefined reference to arch_flags'
15
gettime.o: In function time_since_now':
16
/home/thomas/projets/buildroot/output/build/fio-fio-2.7/gettime.c:164: undefined reference to arch_flags'
17
mutex.o: In function fio_mutex_up':
18
/home/thomas/projets/buildroot/output/build/fio-fio-2.7/mutex.c:189: undefined reference to arch_flags'
19
collect2: error: ld returned 1 exit status
20
Makefile:375: recipe for target 't/stest' failed
21
make[2]: *** [t/stest] Error 1
22
make[2]: *** Waiting for unfinished jobs....
23
​
24
Fix that by ensuring we have a stub arch.o with the necessary arch flags
25
for the standalone test programs.
26
​
27
Signed-off-by: Jens Axboe <axboe@fb.com>
28
---
29
 Makefile      | 6 +++---
30
 t/arch.c      | 5 +++++
31
 t/dedupe.c    | 1 +
32
 t/lfsr-test.c | 2 ++
33
 t/stest.c     | 2 ++
34
 5 files changed, 13 insertions(+), 3 deletions(-)
35
 create mode 100644 t/arch.c
36
​
37
diff --git a/Makefile b/Makefile
38
index 6b4c9db..a2502dc 100644
39
--- a/Makefile
40
+++ b/Makefile
41
@@ -191,7 +191,7 @@ endif
42
 -include $(OBJS:.o=.d)
43
 
44
 T_SMALLOC_OBJS = t/stest.o
45
-T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o t/debug.o
46
+T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o t/debug.o t/arch.o
47
 T_SMALLOC_PROGS = t/stest
48
 
49
 T_IEEE_OBJS = t/ieee754.o
50
@@ -208,7 +208,7 @@ T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
51
 T_AXMAP_PROGS = t/axmap
52
 
53
 T_LFSR_TEST_OBJS = t/lfsr-test.o
54
-T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o t/log.o t/debug.o
55
+T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o t/log.o t/debug.o t/arch.o
56
 T_LFSR_TEST_PROGS = t/lfsr-test
57
 
58
 T_GEN_RAND_OBJS = t/gen-rand.o
59
@@ -223,7 +223,7 @@ endif
60
 
61
 T_DEDUPE_OBJS = t/dedupe.o
62
 T_DEDUPE_OBJS += lib/rbtree.o t/log.o mutex.o smalloc.o gettime.o crc/md5.o \
63
-       lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o \
64
+       lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o t/arch.o \
65
        crc/murmur3.o crc/crc32c.o crc/crc32c-intel.o crc/fnv.o
66
 T_DEDUPE_PROGS = t/fio-dedupe
67
 
68
diff --git a/t/arch.c b/t/arch.c
69
new file mode 100644
70
index 0000000..befb7c7
71
--- /dev/null
72
+++ b/t/arch.c
73
@@ -0,0 +1,5 @@
74
+#include "../arch/arch.h"
75
+
76
+unsigned long arch_flags = 0;
77
+int tsc_reliable;
78
+int arch_random;
79
diff --git a/t/dedupe.c b/t/dedupe.c
80
index 3a66820..7856da1 100644
81
--- a/t/dedupe.c
82
+++ b/t/dedupe.c
83
@@ -537,6 +537,7 @@ int main(int argc, char *argv[])
84
    uint64_t nextents = 0, nchunks = 0;
85
    int c, ret;
86
 
87
+   arch_init(argv);
88
    debug_init();
89
 
90
    while ((c = getopt(argc, argv, "b:t:d:o:c:p:B:")) != -1) {
91
diff --git a/t/lfsr-test.c b/t/lfsr-test.c
92
index 4352b89..bad5097 100644
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.