From 97582181926ed102e1e7080e456c2adebbf803fa Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 16 Mar 2022 00:00:55 +0000 Subject: [PATCH] Test builds with LTO enabled Signed-off-by: falkTX --- .github/workflows/build.yml | 18 +++++++++--------- source/Makefile.mk | 1 + source/utils/CarlaLv2Utils.hpp | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62b044464..3bae29729 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - name: make features run: make features - name: make - run: make -j $(sysctl -n hw.logicalcpu) + run: make WITH_LTO=true -j $(sysctl -n hw.logicalcpu) msys2-i686: runs-on: windows-latest @@ -38,7 +38,7 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) msys2-x86_64: runs-on: windows-latest @@ -54,7 +54,7 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) ubuntu-18_04: runs-on: ubuntu-18.04 @@ -73,9 +73,9 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) - name: make posix32 - run: make posix32 -j $(nproc) + run: make WITH_LTO=true posix32 -j $(nproc) ubuntu-20_04: runs-on: ubuntu-20.04 @@ -99,9 +99,9 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) - name: make posix32 - run: make posix32 -j $(nproc) + run: make WITH_LTO=true posix32 -j $(nproc) ubuntu-mingw-win32: runs-on: ubuntu-20.04 @@ -126,7 +126,7 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) ubuntu-mingw-win64: runs-on: ubuntu-20.04 @@ -150,4 +150,4 @@ jobs: - name: make features run: make features - name: make - run: make -j $(nproc) + run: make WITH_LTO=true -j $(nproc) diff --git a/source/Makefile.mk b/source/Makefile.mk index f62738ed8..9727b673c 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -92,6 +92,7 @@ endif ifeq ($(WITH_LTO),true) BASE_FLAGS += -fno-strict-aliasing -flto +LINK_OPTS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch endif 32BIT_FLAGS = -m32 diff --git a/source/utils/CarlaLv2Utils.hpp b/source/utils/CarlaLv2Utils.hpp index 72d48693d..fe6dac311 100644 --- a/source/utils/CarlaLv2Utils.hpp +++ b/source/utils/CarlaLv2Utils.hpp @@ -1861,6 +1861,8 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets) for (uint i = 0; i < numPorts; ++i) { Lilv::Port lilvPort(lilvPlugin.get_port_by_index(i)); + CARLA_SAFE_ASSERT_CONTINUE(lilvPort.me != nullptr); + LV2_RDF_Port* const rdfPort(&rdfDescriptor->Ports[i]); // --------------------------------------------------------------------------------------------------------