Skip to content

Commit 92d094f

Browse files
committed
toolchain, options and flags cleanup
1 parent c20450f commit 92d094f

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

Diff for: .bazelrc

+20-17
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,27 @@ build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
4343

4444
build --workspace_status_command=/proc/self/cwd/tools/gen_status_stamp.sh
4545

46-
# Options for crossbuilding to armv7-a
47-
build:arm32v7 --crosstool_top=//tools/cpp/arm:toolchain
48-
build:arm32v7 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
49-
build:arm32v7 --cpu=arm
50-
build:arm32v7 --copt=-march=armv7-a
51-
build:arm32v7 --copt=-O3
52-
build:arm32v7 --copt=-DARM_NON_MOBILE
53-
build:arm32v7 --copt=-DRASPBERRY_PI
54-
build:arm32v7 --define LIBEVENT_TARGET_HOST=arm-linux-gnueabihf
55-
build:arm32v7 --define LIBEVENT_MARCH=-march=armv7-a
46+
### ARM cross-compile additions ###
47+
48+
build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
49+
build --copt=-funsafe-math-optimizations
50+
build --copt=-ftree-vectorize
51+
build --copt=-DARM_NON_MOBILE
52+
build --copt=-DRASPBERRY_PI
53+
build --linkopt=-Wl,--build-id=md5
54+
build --linkopt=-Wl,--hash-style=gnu
5655

57-
# Options for crossbuilding to armv8-a
56+
# Options for armv8-a
5857
build:arm64v8 --crosstool_top=//tools/cpp/arm:toolchain
59-
build:arm64v8 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
6058
build:arm64v8 --cpu=aarch64
61-
build:arm64v8 --copt=-march=armv8-a
62-
build:arm64v8 --copt=-O3
63-
build:arm64v8 --copt=-DARM_NON_MOBILE
64-
build:arm64v8 --copt=-DRASPBERRY_PI
59+
build:arm64v8 --copt=-march=armv8-a+crc
6560
build:arm64v8 --define LIBEVENT_TARGET_HOST=aarch64-linux-gnu
66-
build:arm64v8 --define LIBEVENT_MARCH=-march=armv8-a
61+
build:arm64v8 --define LIBEVENT_MARCH=-march=armv8-a+crc
62+
63+
# Options for armv7-a
64+
build:arm32v7 --crosstool_top=@local_config_arm_compiler//:toolchain
65+
build:arm32v7 --cpu=armeabi
66+
build:arm32v7 --copt=-march=armv7-a
67+
build:arm32v7 --define tensorflow_mkldnn_contraction_kernel=0
68+
build:arm32v7 --define LIBEVENT_TARGET_HOST=arm-linux-gnueabihf
69+
build:arm32v7 --define LIBEVENT_MARCH=-march=armv7-a

Diff for: Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
THIS_MAKE_FILE := $(lastword $(MAKEFILE_LIST))
1516
TFS_VERSION=1.14.0
1617

Diff for: tensorflow_serving/tools/docker/Dockerfile.arm

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Erik Maciejewski
1+
# Copyright 2019 Erik Maciejewski
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
ARG ARCH=arm64v8
1516
ARG TFS_VERSION=latest
1617
FROM tensorflow/serving:$TFS_VERSION-devel as devel

Diff for: tensorflow_serving/tools/docker/install_arm_toolchain.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/usr/bin/env bash
2-
# Copyright 2018 Erik Maciejewski
2+
# Copyright 2019 Erik Maciejewski
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
77
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
8+
# http://www.apache.org/licenses/LICENSE-2.0
99
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
1616
# install arm cross-compile toolchains
1717
apt-get update && \
1818
apt-get install -y \

Diff for: tools/cpp/arm/cc_toolchain_config.bzl

+2-7
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def _impl(ctx):
7171
"-Wl,-z,relro,-z,now",
7272
"-no-canonical-prefixes",
7373
"-pass-exit-codes",
74-
"-Wl,--build-id=md5",
75-
"-Wl,--hash-style=gnu"
7674
],
7775
),
7876
],
@@ -98,8 +96,6 @@ def _impl(ctx):
9896
"-Wl,-z,relro,-z,now",
9997
"-no-canonical-prefixes",
10098
"-pass-exit-codes",
101-
"-Wl,--build-id=md5",
102-
"-Wl,--hash-style=gnu"
10399
],
104100
),
105101
],
@@ -190,9 +186,9 @@ def _impl(ctx):
190186
flags = [
191187
"-g0",
192188
"-O2",
193-
"-DNDEBUG",
194189
"-ffunction-sections",
195190
"-fdata-sections",
191+
"-DNDEBUG",
196192
],
197193
),
198194
],
@@ -220,7 +216,6 @@ def _impl(ctx):
220216
"-Wall",
221217
"-Wunused-but-set-parameter",
222218
"-Wno-free-nonheap-object",
223-
"-fno-omit-frame-pointer",
224219
],
225220
),
226221
],
@@ -237,9 +232,9 @@ def _impl(ctx):
237232
flags = [
238233
"-g0",
239234
"-O2",
240-
"-DNDEBUG",
241235
"-ffunction-sections",
242236
"-fdata-sections",
237+
"-DNDEBUG",
243238
],
244239
),
245240
],

0 commit comments

Comments
 (0)