Skip to content

Commit 7cc7314

Browse files
committed
Fix creating dist for mips64el
Note that dump_syms can not parse mips64 binaries, so we don't have symbols archive for mips64 arch.
1 parent a2f95c5 commit 7cc7314

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

script/build.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import subprocess
66
import sys
77

8-
from lib.config import MIPS64EL_GCC, get_target_arch
8+
from lib.config import MIPS64EL_GCC, get_target_arch, build_env
99
from lib.util import electron_gyp, import_vs_env
1010

1111

@@ -70,20 +70,5 @@ def parse_args():
7070
return parser.parse_args()
7171

7272

73-
def build_env():
74-
env = os.environ.copy()
75-
if get_target_arch() == "mips64el":
76-
gcc_dir = os.path.join(VENDOR_DIR, MIPS64EL_GCC)
77-
ldlib_dirs = [
78-
gcc_dir + '/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib',
79-
gcc_dir + '/usr/lib64',
80-
gcc_dir + '/usr/mips64el-redhat-linux/lib64',
81-
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/lib64',
82-
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/usr/lib64',
83-
]
84-
env['LD_LIBRARY_PATH'] = os.pathsep.join(ldlib_dirs)
85-
env['PATH'] = os.pathsep.join([gcc_dir + '/usr/bin', env['PATH']])
86-
return env
87-
8873
if __name__ == '__main__':
8974
sys.exit(main())

script/create-dist.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import _winreg
1313

1414
from lib.config import BASE_URL, PLATFORM, enable_verbose_mode, \
15-
get_target_arch, get_zip_name
15+
get_target_arch, get_zip_name, build_env
1616
from lib.util import scoped_cwd, rm_rf, get_electron_version, make_zip, \
1717
execute, electron_gyp
1818

@@ -210,15 +210,15 @@ def strip_binaries():
210210

211211

212212
def strip_binary(binary_path):
213-
if get_target_arch() == 'arm':
214-
strip = 'arm-linux-gnueabihf-strip'
215-
elif get_target_arch() == 'arm64':
216-
strip = 'aarch64-linux-gnu-strip'
217-
elif get_target_arch() == 'mips64el':
218-
strip = 'mips64el-redhat-linux-strip'
219-
else:
220-
strip = 'strip'
221-
execute([strip, binary_path])
213+
if get_target_arch() == 'arm':
214+
strip = 'arm-linux-gnueabihf-strip'
215+
elif get_target_arch() == 'arm64':
216+
strip = 'aarch64-linux-gnu-strip'
217+
elif get_target_arch() == 'mips64el':
218+
strip = 'mips64el-redhat-linux-strip'
219+
else:
220+
strip = 'strip'
221+
execute([strip, binary_path], env=build_env())
222222

223223

224224
def create_version():
@@ -228,6 +228,9 @@ def create_version():
228228

229229

230230
def create_symbols():
231+
if get_target_arch() == 'mips64el':
232+
return
233+
231234
destination = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
232235
dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
233236
execute([sys.executable, dump_symbols, destination])
@@ -288,6 +291,9 @@ def create_ffmpeg_zip():
288291

289292

290293
def create_symbols_zip():
294+
if get_target_arch() == 'mips64el':
295+
return
296+
291297
dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
292298
zip_file = os.path.join(DIST_DIR, dist_name)
293299
licenses = ['LICENSE', 'LICENSES.chromium.html', 'version']

script/lib/config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,21 @@ def get_zip_name(name, version, suffix=''):
8484
if suffix:
8585
zip_name += '-' + suffix
8686
return zip_name + '.zip'
87+
88+
89+
def build_env():
90+
env = os.environ.copy()
91+
if get_target_arch() == "mips64el":
92+
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
93+
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
94+
gcc_dir = os.path.join(VENDOR_DIR, MIPS64EL_GCC)
95+
ldlib_dirs = [
96+
gcc_dir + '/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib',
97+
gcc_dir + '/usr/lib64',
98+
gcc_dir + '/usr/mips64el-redhat-linux/lib64',
99+
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/lib64',
100+
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/usr/lib64',
101+
]
102+
env['LD_LIBRARY_PATH'] = os.pathsep.join(ldlib_dirs)
103+
env['PATH'] = os.pathsep.join([gcc_dir + '/usr/bin', env['PATH']])
104+
return env

script/release.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ function assetsForVersion (version) {
100100
`electron-${version}-linux-armv7l.zip`,
101101
`electron-${version}-linux-ia32-symbols.zip`,
102102
`electron-${version}-linux-ia32.zip`,
103-
`electron-${version}-linux-mips64el-symbols.zip`,
104103
`electron-${version}-linux-mips64el.zip`,
105104
`electron-${version}-linux-x64-symbols.zip`,
106105
`electron-${version}-linux-x64.zip`,

0 commit comments

Comments
 (0)