summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Baladurin <k.baladurin@samsung.com>2019-04-18 12:29:56 +0300
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>2019-05-20 13:27:34 +0900
commit9f310807bd994bf4d6bdba560b43411d20e579f5 (patch)
treed37d998617fec3f1dfebf71780ad4e180ca8c05b
parentf9460326c6c112aa8a0a4c3a86f7981e5bcf5504 (diff)
downloadcoreclr-9f310807bd994bf4d6bdba560b43411d20e579f5.tar.gz
coreclr-9f310807bd994bf4d6bdba560b43411d20e579f5.tar.bz2
coreclr-9f310807bd994bf4d6bdba560b43411d20e579f5.zip
-rw-r--r--packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/clrjit.profdatabin0 -> 943216 bytes
-rw-r--r--packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/coreclr.profdatabin0 -> 40560 bytes
-rwxr-xr-xpackaging/coreclr.spec27
-rw-r--r--pgosupport.cmake4
4 files changed, 27 insertions, 4 deletions
diff --git a/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/clrjit.profdata b/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/clrjit.profdata
new file mode 100644
index 0000000000..5a56484390
--- /dev/null
+++ b/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/clrjit.profdata
Binary files differ
diff --git a/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/coreclr.profdata b/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/coreclr.profdata
new file mode 100644
index 0000000000..072b466401
--- /dev/null
+++ b/packages/optimization.linux-arm.pgo.coreclr/99.99.99-master-20190116.5/data/coreclr.profdata
Binary files differ
diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec
index 9bd45f55f6..df57d00102 100755
--- a/packaging/coreclr.spec
+++ b/packaging/coreclr.spec
@@ -2,6 +2,10 @@
%define skipnative 0
%define skipmscorlib 0
+
+%define pgo_instrument 0
+%define pgo_optimize 1
+
%ifarch %{ix86}
%define dotnet_buildtype Release
%endif
@@ -79,6 +83,11 @@ BuildRequires: libopenssl-64bit
%endif
%endif
+%if 0%{pgo_instrument} || 0%{pgo_optimize}
+BuildRequires: binutils-gold
+BuildRequires: compiler-rt
+%endif
+
%description
The CoreCLR repo contains the complete runtime implementation for .NET Core. It includes RyuJIT, the .NET GC, native interop and many other components. It is cross-platform, with multiple OS and CPU ports in progress.
@@ -180,12 +189,26 @@ export CXXFLAGS+="-fstack-protector-strong"
%endif
%endif
+%if 0%{skipnative}
+%else
+%if 0%{pgo_instrument}
+%define _pgo_flags -pgoinstrument
+%else
+%if 0%{pgo_optimize}
+# pgo optimization is enabled by default
+%define _pgo_flags ""
+%else
+%define _pgo_flags -nopgooptimize
+%endif
+%endif
+%endif
+
%if 0%{skipmscorlib}
%if 0%{skipnative}
# No build native and mscorlib.
%else
# Build native only.
-./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -clang3.8 -skipmscorlib -skipgenerateversion -skipnuget -msbuildonunsupportedplatform -cmakeargs "-DFEATURE_GDBJIT=TRUE -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro"
+./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipmscorlib -skipgenerateversion -skipnuget -msbuildonunsupportedplatform -cmakeargs "-DFEATURE_GDBJIT=TRUE -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_pgo_flags}
%endif
%else
%if 0%{skipnative}
@@ -193,7 +216,7 @@ export CXXFLAGS+="-fstack-protector-strong"
./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -skiprestore -skipnative -skipnuget -skipcrossgen -msbuildonunsupportedplatform
%else
# Build native and mscorlib.
-./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -clang3.8 -skipgenerateversion -skiprestore -skipnuget -skipcrossgen -msbuildonunsupportedplatform -cmakeargs "-DFEATURE_GDBJIT=TRUE -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro"
+./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipgenerateversion -skiprestore -skipnuget -skipcrossgen -msbuildonunsupportedplatform -cmakeargs "-DFEATURE_GDBJIT=TRUE -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_pgo_flags}
%endif
%endif
diff --git a/pgosupport.cmake b/pgosupport.cmake
index bc331be6a5..421f3d5207 100644
--- a/pgosupport.cmake
+++ b/pgosupport.cmake
@@ -22,8 +22,8 @@ function(add_pgo TargetName)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /GENPROFILE")
else(WIN32)
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
- target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate)
- set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-ld=gold -fprofile-instr-generate")
+ target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate=/tmp/${TargetName}-%p.profdata)
+ set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-ld=gold -fprofile-instr-generate=/tmp/${TargetName}-%p.profdata")
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
endif(WIN32)
elseif(CLR_CMAKE_PGO_OPTIMIZE)