~linaro-toolchain-dev/cortex-strings/trunk

53 by Michael Hope
Changed 'Linaro Inc.' for the correct 'Linaro Limited' everywhere.
1
# Copyright (c) 2011, Linaro Limited
45 by Michael Hope
Removed obsolete build files. Updated the license on more files.
2
# All rights reserved.
83 by Michael Hope
Remove trailing whitespace.
3
#
45 by Michael Hope
Removed obsolete build files. Updated the license on more files.
4
# Redistribution and use in source and binary forms, with or without
5
# modification, are permitted provided that the following conditions are met:
6
#     * Redistributions of source code must retain the above copyright
7
#       notice, this list of conditions and the following disclaimer.
8
#     * Redistributions in binary form must reproduce the above copyright
9
#       notice, this list of conditions and the following disclaimer in the
10
#       documentation and/or other materials provided with the distribution.
11
#     * Neither the name of the Linaro nor the
12
#       names of its contributors may be used to endorse or promote products
13
#       derived from this software without specific prior written permission.
83 by Michael Hope
Remove trailing whitespace.
14
#
45 by Michael Hope
Removed obsolete build files. Updated the license on more files.
15
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
53 by Michael Hope
Changed 'Linaro Inc.' for the correct 'Linaro Limited' everywhere.
18
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
45 by Michael Hope
Removed obsolete build files. Updated the license on more files.
19
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
83 by Michael Hope
Remove trailing whitespace.
24
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 by Michael Hope
Removed obsolete build files. Updated the license on more files.
25
#
26
14 by Michael Hope
Changed all occurances of cortexcpu to cortex-strings
27
# Top level Makefile for cortex-strings
9 by Michael Hope
Added comments. General tidy up.
28
29
# Used to record the compiler version in the executables
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
30
COMPILER = $(shell $(CC) --version 2>&1 | head -n1)
31
9 by Michael Hope
Added comments. General tidy up.
32
# The main library
7 by Michael Hope
Pulled in the routines and packaged them up.
33
lib_LTLIBRARIES = \
14 by Michael Hope
Changed all occurances of cortexcpu to cortex-strings
34
	libcortex-strings.la
7 by Michael Hope
Pulled in the routines and packaged them up.
35
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
36
## Test suite
9 by Michael Hope
Added comments. General tidy up.
37
check_PROGRAMS = \
22 by Michael Hope
Added tests for memchr and strchr from GLIBC. Added a note on the routines and where they come from.
38
	tests/test-memchr \
92 by Marcus Shawcroft
Add memcmp tests from glibc.
39
	tests/test-memcmp \
9 by Michael Hope
Added comments. General tidy up.
40
	tests/test-memcpy \
91 by Marcus Shawcroft
Add memmove tests from glibc.
41
	tests/test-memmove \
9 by Michael Hope
Added comments. General tidy up.
42
	tests/test-memset \
22 by Michael Hope
Added tests for memchr and strchr from GLIBC. Added a note on the routines and where they come from.
43
	tests/test-strchr \
9 by Michael Hope
Added comments. General tidy up.
44
	tests/test-strcmp \
45
	tests/test-strcpy \
93 by Marcus Shawcroft
Add strncmp tests from glibc.
46
	tests/test-strlen \
96.1.1 by Marcus Shawcroft
Add strnlen tests from glibc.
47
	tests/test-strncmp \
48
	tests/test-strnlen
9 by Michael Hope
Added comments. General tidy up.
49
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
50
# Options for the tests
51
tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS)
52
tests_ldadd = libcortex-strings.la
86 by Michael Hope
Add definitions for LDADD and CFLAGS when building strchr and memchr
53
tests_test_memchr_LDADD = $(tests_ldadd)
54
tests_test_memchr_CFLAGS = $(tests_cflags)
92 by Marcus Shawcroft
Add memcmp tests from glibc.
55
tests_test_memcmp_LDADD = $(tests_ldadd)
56
tests_test_memcmp_CFLAGS = $(tests_cflags)
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
57
tests_test_memcpy_LDADD = $(tests_ldadd)
58
tests_test_memcpy_CFLAGS = $(tests_cflags)
91 by Marcus Shawcroft
Add memmove tests from glibc.
59
tests_test_memmove_LDADD = $(tests_ldadd)
60
tests_test_memmove_CFLAGS = $(tests_cflags)
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
61
tests_test_memset_LDADD = $(tests_ldadd)
62
tests_test_memset_CFLAGS = $(tests_cflags)
86 by Michael Hope
Add definitions for LDADD and CFLAGS when building strchr and memchr
63
tests_test_strchr_LDADD = $(tests_ldadd)
64
tests_test_strchr_CFLAGS = $(tests_cflags)
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
65
tests_test_strcmp_LDADD = $(tests_ldadd)
66
tests_test_strcmp_CFLAGS = $(tests_cflags)
67
tests_test_strcpy_LDADD = $(tests_ldadd)
68
tests_test_strcpy_CFLAGS = $(tests_cflags)
69
tests_test_strlen_LDADD = $(tests_ldadd)
70
tests_test_strlen_CFLAGS = $(tests_cflags)
93 by Marcus Shawcroft
Add strncmp tests from glibc.
71
tests_test_strncmp_LDADD = $(tests_ldadd)
72
tests_test_strncmp_CFLAGS = $(tests_cflags)
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
73
74
TESTS = $(check_PROGRAMS)
75
76
## Benchmarks
9 by Michael Hope
Added comments. General tidy up.
77
noinst_PROGRAMS = \
78
	dhry \
10 by Michael Hope
Added a native version of dhry to show the difference.
79
	dhry-native \
12 by Michael Hope
Added a rule to build the GLIBC add-on.
80
	try-none \
27 by Michael Hope
Changed 'all' to 'this' in the Makefile names for the cortex-string routines. More natural...
81
	try-this \
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
82
	try-plain \
83
	try-newlib-c \
84
	try-bionic-c \
85
	try-glibc-c
86
87
# Good 'ol Dhrystone
88
dhry_SOURCES = \
89
	benchmarks/dhry/dhry_1.c \
90
	benchmarks/dhry/dhry_2.c \
91
	benchmarks/dhry/dhry.h
92
93
dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\""
94
dhry_LDADD = libcortex-strings.la
95
96
dhry_native_SOURCES = $(dhry_SOURCES)
97
dhry_native_CFLAGS = $(dhry_CFLAGS)
98
99
# Benchmark harness
100
noinst_LIBRARIES = \
101
	libmulti.a \
102
	libbionic-c.a \
103
	libglibc-c.a \
104
	libnewlib-c.a \
105
	libplain.a
106
107
libmulti_a_SOURCES = \
108
	benchmarks/multi/harness.c
109
110
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
111
112
## Other architecture independant implementaions
113
libbionic_c_a_SOURCES = \
114
	reference/bionic-c/bcopy.c \
115
	reference/bionic-c/memchr.c \
116
	reference/bionic-c/memcmp.c \
117
	reference/bionic-c/memcpy.c \
118
	reference/bionic-c/memset.c \
119
	reference/bionic-c/strchr.c \
120
	reference/bionic-c/strcmp.c \
121
	reference/bionic-c/strcpy.c \
122
	reference/bionic-c/strlen.c
123
124
libglibc_c_a_SOURCES = \
125
	reference/glibc-c/memchr.c \
126
	reference/glibc-c/memcmp.c \
127
	reference/glibc-c/memcpy.c \
128
	reference/glibc-c/memset.c \
129
	reference/glibc-c/strchr.c \
130
	reference/glibc-c/strcmp.c \
131
	reference/glibc-c/strcpy.c \
132
	reference/glibc-c/strlen.c \
133
	reference/glibc-c/wordcopy.c \
134
	reference/glibc-c/bp-checks.h \
135
	reference/glibc-c/memcopy.h \
136
	reference/glibc-c/pagecopy.h
137
138
libnewlib_c_a_SOURCES = \
139
	reference/newlib-c/memchr.c \
140
	reference/newlib-c/memcmp.c \
141
	reference/newlib-c/memcpy.c \
142
	reference/newlib-c/memset.c \
143
	reference/newlib-c/strchr.c \
144
	reference/newlib-c/strcmp.c \
145
	reference/newlib-c/strcpy.c \
146
	reference/newlib-c/strlen.c \
147
	reference/newlib-c/shim.h
148
149
libplain_a_SOURCES = \
150
	reference/plain/memset.c \
151
	reference/plain/memcpy.c \
152
	reference/plain/strcmp.c \
153
	reference/plain/strcpy.c
154
155
try_none_SOURCES =
156
try_none_LDADD = libmulti.a -lrt
157
try_this_SOURCES =
158
try_this_LDADD = libmulti.a libcortex-strings.la -lrt
159
try_bionic_c_SOURCES =
160
try_bionic_c_LDADD = libmulti.a libbionic-c.a -lrt
161
try_glibc_c_SOURCES =
162
try_glibc_c_LDADD = libmulti.a libglibc-c.a -lrt
163
try_newlib_c_SOURCES =
164
try_newlib_c_LDADD = libmulti.a libnewlib-c.a -lrt
165
try_plain_SOURCES =
166
try_plain_LDADD = libmulti.a libplain.a -lrt
167
168
# Architecture specific
169
170
if HOST_AARCH32
171
172
if WITH_NEON
173
# Pull in the NEON specific files
103 by Will Newton
Split bionic reference code into A15 and A9 versions.
174
neon_bionic_a9_sources = \
175
	reference/bionic-a9/memcpy.S \
176
	reference/bionic-a9/memset.S
177
neon_bionic_a15_sources = \
178
	reference/bionic-a15/memcpy.S \
179
	reference/bionic-a15/memset.S
100 by Will Newton
Integrate NEON/VFP/ARM optimised memcpy implementation.
180
fpu_flags = -mfpu=neon
181
else
182
if WITH_VFP
183
fpu_flags = -mfpu=vfp
184
else
185
fpu_flags = -msoft-float
186
endif
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
187
endif
188
189
# Benchmarks and example programs
190
noinst_PROGRAMS += \
103 by Will Newton
Split bionic reference code into A15 and A9 versions.
191
	try-bionic-a9 \
192
	try-bionic-a15 \
9 by Michael Hope
Added comments. General tidy up.
193
	try-csl \
194
	try-glibc \
195
	try-newlib \
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
196
	try-newlib-xscale
9 by Michael Hope
Added comments. General tidy up.
197
198
# Libraries used in the benchmarks and examples
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
199
noinst_LIBRARIES += \
103 by Will Newton
Split bionic reference code into A15 and A9 versions.
200
	libbionic-a9.a \
201
	libbionic-a15.a \
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
202
	libcsl.a \
203
	libglibc.a \
204
	libnewlib.a \
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
205
	libnewlib-xscale.a
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
206
9 by Michael Hope
Added comments. General tidy up.
207
# Main library
14 by Michael Hope
Changed all occurances of cortexcpu to cortex-strings
208
libcortex_strings_la_SOURCES = \
9 by Michael Hope
Added comments. General tidy up.
209
	src/thumb-2/strcpy.c \
81 by Michael Hope
Fixed up the assembly file extensions and added the scripts to the
210
	src/linaro-a9/memchr.S \
211
	src/linaro-a9/strchr.S \
111 by Will Newton
Switch to new implementation of strlen.
212
	src/thumb-2/strlen.S \
100 by Will Newton
Integrate NEON/VFP/ARM optimised memcpy implementation.
213
	src/linaro-a9/memset.S \
214
	src/linaro-a9/memcpy.S
9 by Michael Hope
Added comments. General tidy up.
215
216
# Libraries containing the difference reference versions
103 by Will Newton
Split bionic reference code into A15 and A9 versions.
217
libbionic_a9_a_SOURCES = \
218
	$(neon_bionic_a9_sources) \
219
	reference/bionic-a9/memcmp.S \
220
	reference/bionic-a9/strcmp.S \
221
	reference/bionic-a9/strcpy.S \
222
	reference/bionic-a9/strlen.c
223
224
libbionic_a9_a_CFLAGS = -Wa,-mimplicit-it=thumb
225
226
libbionic_a15_a_SOURCES = \
227
	$(neon_bionic_a15_sources) \
228
	reference/bionic-a15/memcmp.S \
229
	reference/bionic-a15/strcmp.S \
230
	reference/bionic-a15/strcpy.S \
231
	reference/bionic-a15/strlen.c
232
233
libbionic_a15_a_CFLAGS = -Wa,-mimplicit-it=thumb
20 by Michael Hope
Merged Dave's build issue fixes. Shifted the implicit-it to just the library that needs it.
234
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
235
libcsl_a_SOURCES = \
236
	reference/csl/memcpy.c \
14.1.1 by Michael Hope
Fixed up the Makefile so a 'make dist' includes everything required.
237
	reference/csl/memset.c \
238
	reference/csl/arm_asm.h
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
239
240
libglibc_a_SOURCES = \
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
241
	reference/glibc/memcpy.S \
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
242
	reference/glibc/memset.S \
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
243
	reference/glibc/strlen.S
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
244
245
libnewlib_a_SOURCES = \
67 by Michael Hope
Updated the newlib reference copy to 1.20+2012-06-07.
246
	reference/newlib/memcpy.S \
247
	reference/newlib/strcmp.S \
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
248
	reference/newlib/strcpy.c \
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
249
	reference/newlib/strlen.c \
40 by Michael Hope
Fixed up a few missing files found through make distcheck. Explicitly turned off the builtin functions, statck protector, and fortify.
250
	reference/newlib/arm_asm.h \
251
	reference/newlib/shim.h
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
252
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
253
libnewlib_xscale_a_SOURCES = \
254
	reference/newlib-xscale/memchr.c \
255
	reference/newlib-xscale/memcpy.c \
256
	reference/newlib-xscale/memset.c \
257
	reference/newlib-xscale/strchr.c \
258
	reference/newlib-xscale/strcmp.c \
259
	reference/newlib-xscale/strcpy.c \
40 by Michael Hope
Fixed up a few missing files found through make distcheck. Explicitly turned off the builtin functions, statck protector, and fortify.
260
	reference/newlib-xscale/strlen.c \
261
	reference/newlib-xscale/xscale.h
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
262
9 by Michael Hope
Added comments. General tidy up.
263
# Flags for the benchmark helpers
103 by Will Newton
Split bionic reference code into A15 and A9 versions.
264
try_bionic_a9_SOURCES =
265
try_bionic_a9_LDADD = libmulti.a libbionic-a9.a -lrt
266
try_bionic_a15_SOURCES =
267
try_bionic_a15_LDADD = libmulti.a libbionic-a15.a -lrt
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
268
try_csl_SOURCES =
17.1.1 by Dr. David Alan Gilbert
Fix link (-l at end of line) and assembly (implicit it in bionic code)
269
try_csl_LDADD = libmulti.a libcsl.a -lrt
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
270
try_glibc_SOURCES =
17.1.1 by Dr. David Alan Gilbert
Fix link (-l at end of line) and assembly (implicit it in bionic code)
271
try_glibc_LDADD = libmulti.a libglibc.a -lrt
8 by Michael Hope
Added a README. Re-factored the build into a top level Makefile.
272
try_newlib_SOURCES =
17.1.1 by Dr. David Alan Gilbert
Fix link (-l at end of line) and assembly (implicit it in bionic code)
273
try_newlib_LDADD = libmulti.a libnewlib.a -lrt
39 by Michael Hope
Updates after pulling in new routines to the reference. Document where the reference files come from.
274
try_newlib_xscale_SOURCES =
275
try_newlib_xscale_LDADD = libmulti.a libnewlib-xscale.a -lrt
7 by Michael Hope
Pulled in the routines and packaged them up.
276
100 by Will Newton
Integrate NEON/VFP/ARM optimised memcpy implementation.
277
AM_CPPFLAGS = $(fpu_flags)
278
AM_LDFLAGS = $(fpu_flags)
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
279
280
endif
281
89 by Michael Hope
Add aarch64 implementations of memcpy, memset and strcmp to
282
# aarch64 specific
88 by Michael Hope
Add aarch64 configury.
283
if HOST_AARCH64
89 by Michael Hope
Add aarch64 implementations of memcpy, memset and strcmp to
284
285
libcortex_strings_la_SOURCES = \
96.1.3 by Marcus Shawcroft
Add AArch64 optimised memcmp.
286
	src/aarch64/memcmp.S \
89 by Michael Hope
Add aarch64 implementations of memcpy, memset and strcmp to
287
	src/aarch64/memcpy.S \
94 by Marcus Shawcroft
Add AArch64 optimised memmove.
288
	src/aarch64/memmove.S \
89 by Michael Hope
Add aarch64 implementations of memcpy, memset and strcmp to
289
	src/aarch64/memset.S \
95 by Marcus Shawcroft
Add AArch64 optimized strncmp.
290
	src/aarch64/strcmp.S \
96 by Marcus Shawcroft
Add AArch64 optimized strlen.
291
	src/aarch64/strlen.S \
96.1.2 by Marcus Shawcroft
Add AArch64 optimised strnlen.
292
	src/aarch64/strncmp.S \
293
	src/aarch64/strnlen.S
89 by Michael Hope
Add aarch64 implementations of memcpy, memset and strcmp to
294
88 by Michael Hope
Add aarch64 configury.
295
endif
296
85 by Michael Hope
Added support to detect the host architecture based on the triplet.
297
libcortex_strings_la_LDFLAGS = -version-info 1:0:0
298
299
AM_CFLAGS = \
300
	-std=gnu99 -Wall \
40 by Michael Hope
Fixed up a few missing files found through make distcheck. Explicitly turned off the builtin functions, statck protector, and fortify.
301
	-fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE \
87 by Michael Hope
Make submachine optional. Only supply -mtune if submachine is set.
302
	$(AM_CPPFLAGS)
303
304
if WITH_SUBMACHINE
305
AM_CFLAGS += \
90 by Michael Hope
Fix the quoting on submachine.
306
	-mtune=$(submachine)
87 by Michael Hope
Make submachine optional. Only supply -mtune if submachine is set.
307
endif
11 by Michael Hope
Added GLIBC add-on support
308
14.1.1 by Michael Hope
Fixed up the Makefile so a 'make dist' includes everything required.
309
EXTRA_DIST = \
310
	tests/hp-timing.h \
311
	tests/test-string.h \
16 by Michael Hope
Added autogen.sh. Tidied up the NEON configure rules using AM_CONDITIONAL. Made make distcheck pass.
312
	tests/test-skeleton.c \
81 by Michael Hope
Fixed up the assembly file extensions and added the scripts to the
313
	scripts/add-license.sh \
314
	scripts/bench.py \
315
	scripts/fixup.py \
316
	scripts/libplot.py \
317
	scripts/plot-align.py \
318
	scripts/plot.py \
319
	scripts/plot-sizes.py \
320
	scripts/plot-top.py \
321
	scripts/trim.sh \
16 by Michael Hope
Added autogen.sh. Tidied up the NEON configure rules using AM_CONDITIONAL. Made make distcheck pass.
322
	autogen.sh