From 1d5c6958aa83e83f4ad4bfa22ed8a58be69900c8 Mon Sep 17 00:00:00 2001 From: MengxinLiu Date: Tue, 19 May 2020 14:31:46 +0800 Subject: [PATCH] perf: add amd64 compile flags back --- dist/images/Dockerfile | 4 +++- dist/images/build.sh | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dist/images/Dockerfile b/dist/images/Dockerfile index e4fa6c9cf44..173ea07929e 100644 --- a/dist/images/Dockerfile +++ b/dist/images/Dockerfile @@ -1,6 +1,9 @@ # syntax = docker/dockerfile:experimental FROM centos:8 as ovs-rpm +ARG RPM_ARCH +ARG ARCH + RUN yum install dnf-plugins-core -y && \ yum config-manager --set-enabled PowerTools && \ yum install python36 git wget openssl-devel gcc \ @@ -10,7 +13,6 @@ RUN yum install dnf-plugins-core -y && \ desktop-file-utils graphviz groff python3-sphinx -y COPY build.sh /root/build.sh RUN bash /root/build.sh -ARG RPM_ARCH RUN mkdir /rpms/ && \ cp /ovs/rpm/rpmbuild/RPMS/${RPM_ARCH}/* /ovn/rpm/rpmbuild/RPMS/${RPM_ARCH}/* /rpms && \ cd /rpms && rm -f *debug* *docker* *vtep* *ipsec* diff --git a/dist/images/build.sh b/dist/images/build.sh index 48993ab094e..f73d212a43a 100644 --- a/dist/images/build.sh +++ b/dist/images/build.sh @@ -17,7 +17,11 @@ curl https://github.com/alauda/ovs/commit/238003290766808ba310e1875157b3d4142456 sed -i 's/2.13.1/2.13.0/g' configure.ac sed -i 's/sphinx-build-3/sphinx-build/g' rhel/openvswitch-fedora.spec.in ./boot.sh -./configure LIBS=-ljemalloc +if [ "$ARCH" = "amd64" ]; then + ./configure LIBS=-ljemalloc CFLAGS="-O2 -g -msse4.2 -mpopcnt" +else + ./configure LIBS=-ljemalloc +fi make rpm-fedora cd .. @@ -28,5 +32,9 @@ curl https://github.com/oilbeater/ovn/commit/7e49a662d9a9d23d673958564048eee71dc curl https://github.com/oilbeater/ovn/commit/1e0d051acb355ca835e07f87be402cfb5d68f5b2.patch | git apply sed -i 's/20.03.1/20.03.0/g' configure.ac ./boot.sh -./configure LIBS=-ljemalloc --with-ovs-source=/ovs +if [ "$ARCH" = "amd64" ]; then + ./configure LIBS=-ljemalloc --with-ovs-source=/ovs CFLAGS="-O2 -g -msse4.2 -mpopcnt" +else + ./configure LIBS=-ljemalloc --with-ovs-source=/ovs +fi make rpm-fedora