From 4dc4d53004c72759c9ba896ec912f270cd9a79e9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 22 Apr 2023 01:49:25 +0200 Subject: [PATCH] Fix windows debug builds (obj file too large) This fixes a "too many sections" issue ``` Fatal error: can't write 159 bytes to section .text of build/libs/ardour/luabindings.cc.1.o: 'file too big' x86_64-w64-mingw32-as: build/libs/ardour/luabindings.cc.1.o: too many sections (36781) ``` --- libs/ardour/wscript | 20 +++++++++++++++++++- tools/x-win/compile.sh | 13 ++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libs/ardour/wscript b/libs/ardour/wscript index d25014e79e..d63a6bde82 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -129,7 +129,6 @@ libardour_sources = [ 'ltc_file_reader.cc', 'ltc_slave.cc', 'lua_api.cc', - 'luabindings.cc', 'luaproc.cc', 'luascripting.cc', 'meter.cc', @@ -461,6 +460,25 @@ def build(bld): if bld.is_defined('AUDIOUNIT_SUPPORT'): obj.source += [ 'audio_unit.cc', 'auv2_scan.cc' ] + lua_cxxflags = bld.env['compiler_flags_dict']['pic'] + if bld.env['build_target'] == 'mingw' and bld.env['DEBUG']: + lua_cxxflags += " -Og -Wa,-mbig-obj" + + bld(features = 'cxx cxxstlib asm', + source = "luabindings.cc" , + cxxflags = lua_cxxflags, + includes = obj.includes, + use = ['libpbd','libmidipp','libevoral', + 'libtemporal', + 'liblua', + 'zita-resampler', + 'zita-convolver', + ], + uselib = obj.uselib, + target = 'luabindings') + + obj.use += ['luabindings' ] + avx_sources = [] fma_sources = [] avx512f_sources = [] diff --git a/tools/x-win/compile.sh b/tools/x-win/compile.sh index 57baaefefc..c7ea76d8fd 100755 --- a/tools/x-win/compile.sh +++ b/tools/x-win/compile.sh @@ -63,17 +63,8 @@ export WINRC=${XPREFIX}-windres export RANLIB=${XPREFIX}-ranlib export DLLTOOL=${XPREFIX}-dlltool -if grep -q optimize <<<"$ARDOURCFG"; then - OPT="" -else - #debug-build luabindings.cc, has > 60k symbols. - # -Wa,-mbig-obj has an unreasonable long build-time - # -Og to the rescue. - OPT=" -Og" -fi - -CFLAGS="-mstackrealign$OPT" \ -CXXFLAGS="-mstackrealign$OPT" \ +CFLAGS="-mstackrealign" \ +CXXFLAGS="-mstackrealign" \ LDFLAGS="-L${PREFIX}/lib" \ DEPSTACK_ROOT="$PREFIX" \ ./waf configure \