Skip to content

Commit

Permalink
Disable bundled_binutils and bundled_gold on Linux
Browse files Browse the repository at this point in the history
Keep bundled binutil scripts but not downloading actual binaries by default.

Automatic downloading of binutils has been causing problems for some users:
see #164, #412, #440.

Using bundled binutils helps reduce linking time, but packager codebase is
relatively small, so the gain is not significant.

Local testing shows that the full build time increases from 1m42s to 1m50s, i.e.
an increase of about 8s, or ~8%.

User can still enable the usage of bundled binutils by running
'python src/packager/third_party/binutils/download.py' and set
'linux_use_bundled_binutils' and 'linux_use_bundled_gold' to 1 in GYP_DEFINES.

Change-Id: I7ecae2333861f41054f957d0a6081dae948167bd
  • Loading branch information
kqyang committed Aug 24, 2018
1 parent e5b8b3e commit 9b65518
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [2.3.0] - To be released
### Changed
- Disable bundled binutil and gold on Linux by default. There may be a slight
increase in binary link time.

## [2.2.0] - 2018-08-16
### Added
- EditList support in ISO-BMFF in both input and output (#112).
Expand Down
16 changes: 7 additions & 9 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ deps = {
"src/packager/testing/gtest":
Var("chromium_git") + "/external/github.com/google/googletest@6f8a66431cb592dad629028a50b3dd418a408c87",

# Keep bundled binutil scripts but not downloading actual binaries by default.
# Automatic downloading of binutils has been causing problems for some users:
# #164, #412, #440. Using bundled binutils helps reduce linking time, but
# packager codebase is relatively small, so the gain is not significant.
# User can still enable the usage of bundled binutils by running
# 'python src/packager/third_party/binutils/download.py' and set
# 'linux_use_bundled_binutils' and 'linux_use_bundled_gold' to 1 in GYP_DEFINES.
"src/packager/third_party/binutils":
Var("chromium_git") + "/chromium/src/third_party/binutils@8d77853bc9415bcb7bb4206fa2901de7603387db",

Expand Down Expand Up @@ -98,15 +105,6 @@ hooks = [
'pattern': '.',
'action': ['python', 'src/packager/build/mac_toolchain.py'],
},
# Pull binutils for linux.
{
'name': 'binutils',
'pattern': 'src/packager/third_party/binutils',
'action': [
'python',
'src/packager/third_party/binutils/download.py',
],
},
{
# Pull clang if needed or requested via GYP_DEFINES (GYP_DEFINES="clang=1").
"name": "clang",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/build_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ $ sed -i \
We also need to disable clang and some other features to make it work with musl:
```shell
export GYP_DEFINES='linux_use_bundled_binutils=0 linux_use_bundled_gold=0 clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1'
export GYP_DEFINES='clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1'
```
### Arch Linux
Expand Down
3 changes: 2 additions & 1 deletion gyp_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
'use_glib': 0,
'use_openssl': 1,
'use_x11': 0,
'linux_use_gold_binary': 0,
'linux_use_bundled_binutils': 0,
'linux_use_bundled_gold': 0,
'linux_use_gold_flags': 0,
'clang_use_chrome_plugins': 0}

Expand Down
2 changes: 1 addition & 1 deletion packager/testing/dockers/Alpine_Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN sed -i \
'/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \
/usr/include/malloc.h

ENV GYP_DEFINES='linux_use_bundled_binutils=0 linux_use_bundled_gold=0 clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1'
ENV GYP_DEFINES='clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1'

# Build and run this docker by mapping shaka-packager with
# -v "shaka-packager:/shaka-packager".

0 comments on commit 9b65518

Please sign in to comment.