Remove stripping of binaries and factor out GO_FLAGS

parent ec8995eb
Pipeline #2551 passed with stages
in 5 minutes and 25 seconds
......@@ -10,6 +10,7 @@ from utils import get_build_versions, ex, get_sha256, fail, zip_files, get_final
NDK_DIR = 'android-ndk'
REPO_DIR = 'obfs4'
SOURCE = 'obfs4/obfs4proxy/*'
GO_FLAGS = ['-asmflags', '-trimpath', '-o', 'obfs4proxy']
def main():
......@@ -131,10 +132,8 @@ def build_android_arch(env, tool, ndk_arch, pie):
build_mode = "pie" if pie else "exe"
extldflags = " -extldflags=-pie" if pie else ""
ex(['go', 'build', '-x', '-asmflags', '-trimpath', '-buildmode=%s' % build_mode, '-ldflags',
'-w -s' + extldflags, '-o', 'obfs4proxy'] + get_sources(), env=env)
ex(['%s/bin/%s-strip' % (toolchain, tool), '-D', 'obfs4proxy'])
ex(['go', 'build', '-buildmode=%s' % build_mode, '-ldflags',
'-w -s' + extldflags] + GO_FLAGS + get_sources(), env=env)
pie_suffix = '_pie' if pie else ''
zip_files(['obfs4proxy'], 'obfs4proxy_%s%s.zip' % (ndk_arch, pie_suffix))
......@@ -142,8 +141,7 @@ def build_android_arch(env, tool, ndk_arch, pie):
def build_linux():
ex(['go', 'build', '-x', '-asmflags', '-trimpath', '-o', 'obfs4proxy'] + get_sources())
ex(['strip', '-D', 'obfs4proxy'])
ex(['go', 'build', '-ldflags', '-w -s'] + GO_FLAGS + get_sources())
zip_files(['obfs4proxy'], 'obfs4proxy_linux-x86_64.zip')
os.remove('obfs4proxy')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment