13
0

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)
```
This commit is contained in:
Robin Gareus 2023-04-22 01:49:25 +02:00
parent 8629aea237
commit 4dc4d53004
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 21 additions and 12 deletions

View File

@ -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 = []

View File

@ -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 \