From c558d40f083dc4d8c66050868e51ec720a94ea36 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Fri, 17 Sep 2021 12:20:33 -0400 Subject: [PATCH 1/4] Enable LTO on Unix --- recipe/build.sh | 1 + recipe/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index fea58388..9221e4f8 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -34,6 +34,7 @@ cmake \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ + -DLLVM_ENABLE_LTO=ON \ -DCMAKE_AR=$AR \ -DPython3_EXECUTABLE=${BUILD_PREFIX}/bin/python \ $CMAKE_ARGS \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e356f188..8697273a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,6 @@ {% set version = "12.0.1" %} {% set major_version = version.split(".")[0] %} -{% set build_number = 4 %} +{% set build_number = 5 %} {% set minor_aware_ext = major_version %} {% set minor_int = version.split(".")[1] | int %} From 8b7f86e6511077cf5a2d3c3e524c25fb11adaddf Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Fri, 17 Sep 2021 16:27:14 -0400 Subject: [PATCH 2/4] Just ThinLTO for OSX then --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 9221e4f8..52dba775 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -19,6 +19,7 @@ fi if [[ "$target_platform" == osx* ]]; then export CXXFLAGS="$CXXFLAGS -DTARGET_OS_OSX=1" + CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=THIN" fi mkdir build @@ -34,7 +35,6 @@ cmake \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ - -DLLVM_ENABLE_LTO=ON \ -DCMAKE_AR=$AR \ -DPython3_EXECUTABLE=${BUILD_PREFIX}/bin/python \ $CMAKE_ARGS \ From 9a4c3c6691c4c229ed6656b3c49c82cbdbf202c0 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Fri, 17 Sep 2021 16:40:35 -0400 Subject: [PATCH 3/4] Try to re-enable with old GCC --- recipe/build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipe/build.sh b/recipe/build.sh index 52dba775..be2d70c0 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -20,6 +20,11 @@ fi if [[ "$target_platform" == osx* ]]; then export CXXFLAGS="$CXXFLAGS -DTARGET_OS_OSX=1" CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=THIN" +else + export CFLAGS="$CFLAGS -flto -fuse-linker-plugin" + export CXXFLAGS="$CXXFLAGS -flto -fuse-linker-plugin" + export LDFLAGS="LDFLAGS -flto -fuse-linker-plugin" + CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=FULL" fi mkdir build From 04a2886fe778c2c908fd13bcd8cc01ea479eddaf Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Sat, 18 Sep 2021 11:25:01 -0400 Subject: [PATCH 4/4] Only enable LTO for OSX --- recipe/build.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index be2d70c0..ef495805 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -19,12 +19,7 @@ fi if [[ "$target_platform" == osx* ]]; then export CXXFLAGS="$CXXFLAGS -DTARGET_OS_OSX=1" - CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=THIN" -else - export CFLAGS="$CFLAGS -flto -fuse-linker-plugin" - export CXXFLAGS="$CXXFLAGS -flto -fuse-linker-plugin" - export LDFLAGS="LDFLAGS -flto -fuse-linker-plugin" - CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=FULL" + CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_LTO=Thin" fi mkdir build