Commit Graph

742 Commits

Author SHA1 Message Date
Mike Hommey
9f4a67977e Bug 1491140 - Count non-elfhacked relocations size when comparing to original size r=froydnj
When checking whether the new relocations sizes are going to be a win, we
need to account for the fact that there are non-elfhacked relocation
remaining.

Differential Revision: https://phabricator.services.mozilla.com/D5837

--HG--
extra : moz-landing-system : lando
2018-09-14 13:16:25 +00:00
Mike Hommey
682d2bd651 Bug 1491198 - Don't enable LTO on artifact builds r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5836

--HG--
extra : moz-landing-system : lando
2018-09-14 17:33:45 +00:00
Chris Peterson
e58c4d5a41 Bug 1490575 - Remove Mulet comments from build files. r=froydnj
Mulet was a Firefox OS simulator that is no longer supported: https://wiki.mozilla.org/Mulet

Differential Revision: https://phabricator.services.mozilla.com/D5735

--HG--
extra : rebase_source : d077c88b8446d0491b4af0dfe2198c4b980fa279
extra : source : 41301ab98bd094235b6995b18bcaa521f221c5f1
2018-09-11 23:07:32 -07:00
Mike Hommey
0a7e03bf20 Bug 1490542 - Remove the Linux LTO builds. r=froydnj
Now that Linux PGO builds also do LTO and all the Linux builds use
clang, there's not much use for separate LTO builds.

Differential Revision: https://phabricator.services.mozilla.com/D5632
2018-09-13 11:23:24 +09:00
Mike Hommey
1e441ae694 Bug 1481721 - Switch Linux nightlies and PGO builds to clang r=froydnj
And enable LTO on CI builds using clang + PGO.

Differential Revision: https://phabricator.services.mozilla.com/D4991

--HG--
extra : moz-landing-system : lando
2018-09-11 22:52:29 +00:00
Mike Hommey
cd06f032af Bug 1079662 - Always enable PIE. r=froydnj
Last attempt, a few years ago, blatantly failed because nautilus (the
GNOME file manager) can't start PIE executables, which look like shared
libraries, and that it thus considers not being executables.

Downstreams don't actually have the problem, because users won't be
launching Firefox from a file manager, but for mozilla.org builds, it is
a problem because users would download, then extract, and then likely
try to run the Firefox executable from a file manager.

So for mozilla.org builds, we still need to find a way around the
nautilus problem.

A .desktop file could be a solution, but .desktop files have not
actually been designed for this use case, which leads to:
- having to use an awful one-liner shell wrapper to derive the path
  to the executable from that of the .desktop file,
- not even being able to associate an icon,
- the .desktop file not being copiable to a location where .desktop
  files would normally go, because it would then fail to find the
  executable.

Another possibility is to go back to using a shell wrapper, but that's
not entirely appealing.

What we chose here is similar, where we have a small `firefox` wrapper
that launches the real `firefox-bin` (which is still leftover from those
old times where we had a shell wrapper, for reasons).

The small `firefox` wrapper is a minimalist C executable that just
finds the path to the `firefox-bin` executable and executes it with the
same args it was called with. The wrapper is only enabled when the
MOZ_NO_PIE_COMPAT environment variable is set, which we only take into
account on Linux. The variable is only really meant to be used for
mozilla.org builds, for the nautilus problem. Downstreams will just pick
the default, which is changed to build PIE.

On other platforms, PIE was already enabled by default, so we just
remove the --enable-pie configure flag.

Differential Revision: https://phabricator.services.mozilla.com/D5109
2018-09-08 07:41:21 +09:00
Mike Hommey
a5cbd7bc7e Bug 1489001 - Move most of mozconfig.linux to mozconfig.unix. r=froydnj
Bug 1487330 made mozconfig.asan use mozconfig.linux, but while that
worked out fine, it turns out that we do have mac builds using
e.g. mozconfig.asan, and that those can break when doing linux-specific
changes to mozconfig.linux.


--HG--
rename : build/unix/mozconfig.linux => build/unix/mozconfig.unix
2018-09-08 07:41:19 +09:00
Mike Hommey
d974ecd01d Bug 1488632 - Don't disable the clang plugin on ASAN builds. r=dmajor
Somehow, bug 1488631 "fixes" the test failure that the original landing
of bug 1487330 caused.

Differential Revision: https://phabricator.services.mozilla.com/D5001
2018-09-08 06:51:22 +09:00
Ted Mielczarek
eb72babf41 bug 1417646 - build geckodriver in cross-compile builds. r=ato
With patches from other bugs in place to use the right C compiler and cflags,
we can enable geckodriver on cross-compiles for macOS.

MozReview-Commit-ID: 5wqBiA6UCf
2018-07-05 07:19:24 -04:00
Mike Hommey
f8fa0c1926 Bug 1482268 - Upgrade binutils for clang builds to 2.31.1. r=froydnj
All the Linux builds using GCC uses the binutils bundled with GCC. This
gives us some leeway to update the binutils used for clang builds (using
the binutils toolchain as of bug 1486998) separately.

Since we only ship builds using GCC, we're more free to upgrade
binutils for clang builds, without worrying about the next merge.

This upgrades to the last released version of binutils, and applies the
patch from https://sourceware.org/bugzilla/show_bug.cgi?id=23591 on top,
so that asan fuzzing builds don't fail.

The GPG key used to sign the upstream tarball is unfortunately not
connected to the web of trust. I verified the contents matched what's in
the Debian archive (which has a different tarball, because some files
are removed/modified in Debian for license reasons ; there were no
differences besides those).

Differential Revision: https://phabricator.services.mozilla.com/D4748

--HG--
extra : moz-landing-system : lando
2018-08-31 21:49:12 +00:00
Mike Hommey
880d97b311 Bug 1487330 - Make mozconfig.{asan,lto,tsan} use mozconfig.linux. r=froydnj
Those mozconfigs do things in common that are already in
mozconfig.linux. Let's just use that.

This will make the build have the binutils toolchain in PATH rather than
passing it to CC/CXX, which is better because it also makes the build
use tools such as ar, ranlib, objcopy from the binutils toolchain,
rather than the old system ones.

Differential Revision: https://phabricator.services.mozilla.com/D4649
2018-08-31 17:25:37 +09:00
Gurzau Raul
3291b096a2 Backed out changeset e1eac066705f (bug 1487330) for permafailing with leaks at mozilla::net::nsStandardURL::TemplatedMutator on a CLOSED TREE 2018-08-31 04:39:10 +03:00
Mike Hommey
78c3a07f1f Bug 1487330 - Make mozconfig.{asan,lto,tsan} use mozconfig.linux. r=froydnj
Those mozconfigs do things in common that are already in
mozconfig.linux. Let's just use that.

This will make the build have the binutils toolchain in PATH rather than
passing it to CC/CXX, which is better because it also makes the build
use tools such as ar, ranlib, objcopy from the binutils toolchain,
rather than the old system ones.

Differential Revision: https://phabricator.services.mozilla.com/D4649
2018-08-31 07:50:56 +09:00
Sebastian Hengst
ceebee3842 Backed out 4 changesets (bug 1417646) for Webdriver missing geckodriver binary, at least on Linux x64 asan
Backed out changeset 1c7e3f8af2e3 (bug 1417646)
Backed out changeset 42ea09d91d7e (bug 1417646)
Backed out changeset 1a3c37471045 (bug 1417646)
Backed out changeset 7179a078b7b4 (bug 1417646)
2018-08-30 12:54:45 +03:00
Hiroyuki Ikezoe
84dbd47154 Bug 1417646 - Remove explicit ac_add_options --enable-geckodriver for linux32 build. r=me 2018-08-30 18:08:45 +09:00
Mike Hommey
6e78f08178 Bug 1486998 - Use the binutils toolchain instead of gcc for builds using clang. r=froydnj
This avoids downloading and unpacking a large package that we only use
for binutils when building with clang.

Differential Revision: https://phabricator.services.mozilla.com/D4516
2018-08-30 07:30:30 +09:00
Mike Hommey
f3d7015c06 Bug 1486995 - Use fetch task for binutils source for the binutils toolchain. r=dmajor
While here, use nproc instead of hardcoding a -j value.

Differential Revision: https://phabricator.services.mozilla.com/D4515
2018-08-30 07:30:13 +09:00
Mike Hommey
357a8bb20c Bug 1486654 - Enable static analysis on all Linux CI builds. r=ted
And turn off separate static analysis build tasks.
2018-08-29 13:55:24 +09:00
Mike Hommey
99d57d4dfb Bug 1486652 - Make x86 linux builds actual cross builds. r=ted
The x86 linux builds originally were performed in x86 build environment.
That was a long time ago. Since then, they moved to x86-64 hosts with
x86 headers and libraries. But for reasons that might have to do with
the build system not really supporting cross-compilation nicely back
then, the build is still explicitly passing both --host and --target,
making those builds non-cross builds.

Since the toolchains used to build are for x86-64, the fact that --host
is for x86 actually prevents enabling the clang plugin, so we need to
turn these builds in actual cross builds if we want to enable the clang
plugin.
2018-08-29 13:50:02 +09:00
Dorel Luca
544b61c613 Backed out changeset 692efe8acba9 (bug 1486654) for wd failures on /builds/worker/workspace/build/tests/bin/geckodriver 2018-08-29 05:16:55 +03:00
Dorel Luca
05fb3381f3 Backed out changeset 9da60503ea49 (bug 1486652) for wd failures on /builds/worker/workspace/build/tests/bin/geckodriver 2018-08-29 05:16:13 +03:00
Mike Hommey
2ef817ea52 Bug 1486654 - Enable static analysis on all Linux CI builds. r=ted
And turn off separate static analysis build tasks.
2018-08-29 08:02:06 +09:00
Mike Hommey
49b5785ec6 Bug 1486652 - Make x86 linux builds actual cross builds. r=ted
The x86 linux builds originally were performed in x86 build environment.
That was a long time ago. Since then, they moved to x86-64 hosts with
x86 headers and libraries. But for reasons that might have to do with
the build system not really supporting cross-compilation nicely back
then, the build is still explicitly passing both --host and --target,
making those builds non-cross builds.

Since the toolchains used to build are for x86-64, the fact that --host
is for x86 actually prevents enabling the clang plugin, so we need to
turn these builds in actual cross builds if we want to enable the clang
plugin.
2018-08-29 08:02:05 +09:00
Mike Hommey
95f25c8a5d Bug 1485610 - Avoid copy relocations in binaries we build. r=froydnj
See bug 1485562 for an example of bad things that can happen with such
relocations, and see also
c90379ddfe/ELF/Relocations.cpp (L496-L537)
2018-08-24 08:57:04 +09:00
Mike Hommey
d1714fc61d Bug 1484872 - Move LTO flags to python configure. r=froydnj 2018-08-21 08:40:26 +09:00
Mike Hommey
dc4c9b7cd4 Bug 1483937 - Still use GCC on MOZ_PGO builds that don't have FORCE_GCC. r=froydnj
Yay for inconsistencies in jobs between beta and central.
2018-08-21 06:50:30 +09:00
Mike Hommey
49dd99e3a3 Bug 1480631 - Switch Linux builds to clang. r=froydnj
This change switches most CI builds to clang, with a few exceptions:
- valgrind builds, until bug 1481670 is figured out.
- PGO and nightly builds, until that's fully tested.
- coverage builds, per bug 1471339 comment 17.
- base toolchain builds, to keep some builds on GCC even when we're
  fully switched to clang.
- any build that doesn't use build/unix/mozconfig.linux (e.g. probably
  all those driven by autospider.py, maybe others).
2018-08-16 10:32:33 +09:00
Mike Hommey
6e62bce406 Bug 1481861 - Move the eh_frame sections when they are before the first executable section. r=froydnj
In some rare cases, it is possible for one of the eh_frame sections'
original address to be larger than the address of the injected code
section, which is added before the first executable section. Namely,
this happens in the rare case where that eh_frame section is smaller
than the injected code section, and is adjacent to the first executable
section. We obviously want to move the eh_frame sections in that case,
since one of them is in the way.
2018-08-14 07:25:07 +09:00
Daniel Varga
14af3949fc Backed out 3 changesets (bug 1480631) for failure at /home/cltbld/workspace/build/tests/talos/talos/run_tests.py
Backed out changeset ed7dba433629 (bug 1480631)
Backed out changeset dd64a5e6d4df (bug 1480631)
Backed out changeset 910a805c960d (bug 1480631)
2018-08-09 01:46:40 +03:00
Mike Hommey
d99b52b6ed Fix up for bug 1481727, because operator priorities are fucked up in C/C++. r=bustage on a CLOSED TREE 2018-08-09 07:07:14 +09:00
Mike Hommey
6fe1432f2e Bug 1480631 - Switch Linux builds to clang. r=froydnj
This change switches most CI builds to clang, with a few exceptions:
- valgrind builds, until bug 1481670 is figured out.
- PGO and nightly builds, until that's fully tested.
- coverage builds, per bug 1471339 comment 17.
- base toolchain builds, to keep some builds on GCC even when we're
  fully switched to clang.
- any build that doesn't use build/unix/mozconfig.linux (e.g. probably
  all those driven by autospider.py, maybe others).
2018-08-09 06:08:19 +09:00
Mike Hommey
fe9dd50d7f Bug 1481727 - Fix an elfhack corner case after bug 1423822. r=froydnj
Bug 1423822 moved the injected code section before the .text section.
When linking with lld, the text section is usually page aligned, and
starting a PT_LOAD. We inject code at the beginning of the PT_LOAD,
which means the PT_LOAD is going to be extended at least a page
downwards. And it means the preceding PT_LOAD can't finish in that same
page, so the overhead of the injected code is needs to account for the
page alignment.
2018-08-09 06:04:30 +09:00
Mike Hommey
57cabd17f2 Bug 1480688 - Don't try to move .eh_frame in case it's not necessary. r=froydnj
If the .eh_frame_hdr and .eh_frame sections are not between the elfhack
relocation and elfhack code sections, it's not going to change anything
to try to move it, so don't even try.

While here, adjust the adjacency test to error out when the section name
doesn't match, and account for the fact that the eh_frame_hdr section
might appear after eh_frame.

--HG--
extra : rebase_source : 7d3525abe75b5a014b39ce0bd406e8f78592ec39
2018-08-03 16:39:50 +09:00
Mike Hommey
9eb572df9c Bug 1481378 - Simplify mozconfig.linux32. r=ted
All CI builds for linux32 have been running on 64-bits hosts for a long
while now, and there are no 32-bits hosts left. We can remove the
special-casing that makes the linux32 builds behave differently
depending on the bit-width of the host.

Furthermore, configure has been able to deal with adding -m32 on its
own, so we don't need to add it to $CC/$CXX manually anymore.
2018-08-07 19:40:52 +09:00
Andreea Pavel
8ac372b9b7 Backed out changeset 6bfba6f64e7b (bug 1480688) for android build bustages on a CLOSED TREE 2018-08-04 12:53:55 +03:00
Mike Hommey
51c6d96684 Bug 1480688 - Don't try to move .eh_frame in case it's not necessary. r=froydnj
If the .eh_frame_hdr and .eh_frame sections are not between the elfhack
relocation and elfhack code sections, it's not going to change anything
to try to move it, so don't even try.

While here, adjust the adjacency test to error out when the section name
doesn't match.

--HG--
extra : rebase_source : 4b31712576fd3472bb94a2b9ab9542253f04cba8
2018-08-03 16:39:50 +09:00
Mike Hommey
64ff5e5cb1 Bug 1480654 - Allow empty eh_frame entries. r=froydnj
Somehow, when building with LTO, clang can end up creating a eh_frame
section with only one, empty, entry (which just looks like a 4-bytes
long section full of 0x00).

--HG--
extra : rebase_source : 385c05c7e447fe1c4bc261b79c7d56138e268458
2018-08-03 11:33:49 +09:00
Mike Hommey
657b098b22 Bug 1480617 - Disable LTO when compiling dummy.c in elfhack. r=gps
For the same reason test-array.c and test-ctors.c need to be built
explicitly without LTO.

--HG--
extra : rebase_source : d037ef7cf1dd2d278c2918dbfee5b4f4c213e408
2018-08-03 07:45:55 +09:00
Mike Hommey
baff96f6e4 Bug 1423822 - Stop disabling elfhack on lto builds. r=froydnj
--HG--
extra : rebase_source : fbe450139109173965de4ee5a8a7f71092aa34bc
2018-08-01 15:56:43 +09:00
Mike Hommey
eb38bfa193 Bug 1423822 - Allow to relocate eh_frame. r=froydnj
--HG--
extra : rebase_source : 17991424686da13d763085985f222b2563d852ec
2018-08-01 09:29:09 +09:00
Mike Hommey
1e86b35688 Bug 1423822 - Set the address for the elfhack code section based on that of the section it is attached to. r=froydnj
When linking with ld.bfd or gold, this changes the PT_LOAD in which the
elfhack code section ends up, making it go in the same one as .init, .text,
etc. rather than .rel.*. When linking with lld, this completely
avoids doing a PT_LOAD split, because lld already splits .rel.* and
.text.

--HG--
extra : rebase_source : 1f69b8f4b48b055892ea24eaa6226859cc4ffd50
2018-08-01 07:21:36 +09:00
Mike Hommey
0824d18204 Bug 1423822 - Check segments overlapping later. r=froydnj
We treat segments overlapping as a fatal error, rather than a condition
to do nothing, because it happening is usually the result of some bad
assumptions on the input ELF, and we don't want to silently ignore
those.

However, there are cases where a setup /could/ lead to overlapping
segments, but would be skipped because elfhack wouldn't be a win
anyways. By checking segments overlap later, we allow those to not
hard fail.

--HG--
extra : rebase_source : deca2051722aeaa959c5e4dae06642908f6d843a
2018-08-01 11:17:07 +09:00
Mike Hommey
972c9b4694 Bug 1423822 - Handle more cases of pointer reuse in DT_INIT_ARRAY. r=froydnj
--HG--
extra : rebase_source : 4eeebad36a90c0a83e28fde9b42c760dde7cfa45
2018-07-31 16:13:35 +09:00
Mike Hommey
493e08eb94 Bug 1423822 - Change how elfhack determines it's not worth trying. r=froydnj
The current check makes assumption wrt what PT_LOAD the injected sections
end up in, and won't work with upcoming changes.

--HG--
extra : rebase_source : b7cfb65ea13c16f977fe523aaf9f39eafeb2cdce
2018-07-31 11:49:33 +09:00
Mike Hommey
9946b08441 Bug 1423822 - Make elfhack -f work in all cases where no gain would happen. r=froydnj
--HG--
extra : rebase_source : 6a916ad5075ce619ca16730b87ae6aa49f975151
2018-07-31 13:56:01 +09:00
Mike Hommey
b1ce4dcf63 Bug 1478923 - Remove LLVM_SYMBOLIZER from mozconfig.lto. r=froydnj
This was cargo-culted from the asan/tsan mozconfigs, but is not necessary
for builds without sanitizers.

--HG--
extra : rebase_source : 41bad4761f424410cb7a099ecaecce8a86becf59
2018-07-27 15:46:51 +09:00
Nathan Froyd
695cb9d23b Bug 1477081 - remove TARGET_CPU use from moz.build files; r=ted.mielczarek
TARGET_CPU is not canonicalized, whereas CPU_ARCH is, so we should be
using CPU_ARCH to get consistent values everywhere.
2018-07-24 16:08:55 -04:00
Cosmin Sabou
f42947acdf Backed out 6 changesets (bug 1451104) for causing build bustages on OS X Cross Compiled. CLOSED TREE
Backed out changeset 8984f6868e57 (bug 1451104)
Backed out changeset ae7ccb8c938d (bug 1451104)
Backed out changeset 52d37e70b6f1 (bug 1451104)
Backed out changeset 47405e33747c (bug 1451104)
Backed out changeset b4ebc9a500f4 (bug 1451104)
Backed out changeset b93c29157feb (bug 1451104)
2018-07-21 03:18:37 +03:00
Nathan Froyd
ace0cd0747 Bug 1451104 - part 1 - be explicit about our GCC/binutils target and build machine; r=glandium
Explicit is better than implicit, and helps ensure that GCC is always
using the binutils we built it with, rather than the system binutils.
2018-07-20 16:22:26 -04:00
Dorel Luca
f51c4fa5d9 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-27 13:26:49 +03:00