Skip to content

Commit

Permalink
build: auto-detect g++ -gz support
Browse files Browse the repository at this point in the history
Older combinations of g++/binutils don't support -gz, so auto-detect its
presence.

Fixes #3697.
Message-Id: <20180817161113.2287-1-avi@scylladb.com>
  • Loading branch information
avikivity authored and tgrabiec committed Aug 20, 2018
1 parent c31dff8 commit 231174c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion configure.py
Expand Up @@ -126,6 +126,12 @@ def debug_flag(compiler):
print('Note: debug information disabled; upgrade your compiler')
return ''

def debug_compress_flag(compiler):
if try_compile(compiler=compiler, flags=['-gz']):
return '-gz'
else:
return ''

def gold_supported(compiler):
src_main = 'int main(int argc, char **argv) { return 0; }'
if try_compile_and_link(source = src_main, flags = ['-fuse-ld=gold'], compiler = compiler):
Expand Down Expand Up @@ -947,7 +953,7 @@ def setup_first_pkg_of_list(pkglist):
seastar_flags += ['--enable-alloc-failure-injector']

seastar_cflags = args.user_cflags
seastar_cflags += ' -gz'
seastar_cflags += ' ' + debug_compress_flag(compiler=args.cxx)
if args.target != '':
seastar_cflags += ' -march=' + args.target
seastar_ldflags = args.user_ldflags
Expand Down

0 comments on commit 231174c

Please sign in to comment.