Граф коммитов

1343 Коммитов

Автор SHA1 Сообщение Дата
David Major 18a5250f02 Bug 1425906: Rename LINK to LINKER throughout the build system. r=glandium
Windows linkers give special meaning to getenv("LINK"), which makes `export LINK=...` in mozconfigs do unexpected things.
2017-12-20 09:07:46 -05:00
Ting-Yu Chou a5fdd873e9 Bug 1360650 part 1 - Archive pdb files of the binaries for llvm-symbolizer. r=ted 2017-12-18 11:26:02 -05:00
Mike Shal 6fab321f11 Bug 1319222 - Add include flags to HOST_*; r=chmanchester
This accounts for LOCAL_INCLUDES in the moz.build files, as well as the
default INCLUDES specified in config.mk that are used for host
compilation. Since some of the HOST_CFLAGS were also used for linking,
those flags are split off into HOST_C{XX}_LDFLAGS so that
the linker-only flags can be placed in those variables.

MozReview-Commit-ID: J1LxIZVeFJ

--HG--
extra : rebase_source : ed7293604e5428e3124f1ecfb2b706e087436b72
2017-11-22 16:23:44 -05:00
Mike Shal b631c0c574 Bug 1319222 - Remove INCLUDES from HOST_SIMPLE_PROGRAMS linking; r=chmanchester
These flags were added way back in bug 59454 to both the compiling and
linking rules for HOST_SIMPLE_PROGRAMS. However, the INCLUDES aren't
actually needed when linking so we can safely remove them.

MozReview-Commit-ID: 8QywO7tGPpU

--HG--
extra : rebase_source : 34870adcf73b459771413e52bc84c6c63669d0f9
2017-12-05 10:36:15 -05:00
Mike Shal 5e5570c9ca Bug 1319222 - Add an SFLAGS ComputedFlags variable for compiling *.S; r=chmanchester
Both SFLAGS and ASFLAGS are used to compile assembly, but SFLAGS include
DEFINES and LOCAL_INCLUDES whereas ASFLAGS do not. It seems easiest to
just separate them into two different ComputedFlags values so that the
backend can distinguish between the two types.

MozReview-Commit-ID: Bkm3621ImJG

--HG--
extra : rebase_source : 420204e37d591512f700d77b780939d20c2feeb0
2017-11-22 15:27:52 -05:00
Chris Manchester a638887c37 Bug 1414064 - Remove LD_VERSION_SCRIPT from the build system. r=mshal
MozReview-Commit-ID: 6KOLZh6aQmc

--HG--
extra : rebase_source : 9a98d1703e9a3138669bc96afdff66bf235058bc
2017-11-07 14:35:05 -08:00
Chris Manchester 77480a3b4d Bug 1414064 - Move BIN_FLAGS to MOZ_PROGRAM_LDFLAGS, get rid of BIN_FLAGS. r=mshal
MozReview-Commit-ID: ELTiYvh6iuS

--HG--
extra : rebase_source : 1547fa9b247649a485c4d31f8bdb7db05a50e043
2017-11-07 14:34:44 -08:00
Chris Manchester 778f734b4f Bug 1414064 - Remove references to EXTRA_LIBS in the build system. r=mshal
MozReview-Commit-ID: AeD755whvIV

--HG--
extra : rebase_source : f59ecae4225e77cfe748e4b132206f2132247078
2017-11-07 14:34:44 -08:00
Chris Manchester b9129cf320 Bug 1414064 - Remove SHLIB_LD{START,END}FILE and SUB_SHLOBJS. r=mshal
These are only set by nss' make build system, which we no longer use.

MozReview-Commit-ID: 9XRhpDmlekK

--HG--
extra : rebase_source : 5bff741863a463eca7d72f4e23c1c78e04a848de
2017-11-07 14:34:44 -08:00
Chris Manchester 7fa9f8f217 Bug 1414064 - Remove EXE_DEF_FILE, it is never set in the build system. r=mshal
MozReview-Commit-ID: IcCg4rZjpee

--HG--
extra : rebase_source : 1100d18597709040464c0d82a8b4929cba36537a
2017-11-07 14:34:44 -08:00
Chris Manchester 732b66708f Bug 1414064 - Remove WRAP_LDFLAGS, it is never set in the build system. r=mshal
MozReview-Commit-ID: Da4a4JmaxoL

--HG--
extra : rebase_source : 837e83e6836ea25d64f013b2b16456f9f6bcb88f
2017-11-07 14:34:44 -08:00
Chris Manchester 914e5042b2 Bug 1411712 - Fixup DEFFILE to be added to EXTRA_DEPS on windows when GNU_CC is set. r=mshal 2017-11-02 23:03:01 +01:00
Chris Manchester 8bc7bdf347 Bug 1411712 - Move LDFLAGS to mozbuild. r=mshal
MozReview-Commit-ID: A8cZ2FUveAf

--HG--
extra : rebase_source : 5f0e9b55c38f3b2382b469bbc886c57696f09792
2017-11-02 11:47:48 -07:00
Gregory Szorc be9770f18d Bug 1412460 - Remove targets related to VCS operations; r=mshal
These targets no longer exist in client.mk. I'm not sure when they
were removed. But this is obviously dead code.

A target in rules.mk pointing back to this target in client.mk has
also been removed.

MozReview-Commit-ID: 5v1MOOTP3qq

--HG--
extra : rebase_source : b90f0788b074330b45005223f41c804589d13163
2017-11-01 15:05:50 -07:00
Chris Manchester 3bd4902247 Bug 1403346 - Move C{XX}FLAGS to mozbuild computed flags. r=glandium
This also introduces C{XX}_LDFLAGS variables which contain cflags that
are meant to be passed to the linker, and adds them to various linker
command lines in place of CFLAGS.

MozReview-Commit-ID: GyKlD9nMqrt
2017-10-25 15:12:09 -07:00
Chris Manchester a1d26e4177 Bug 1403346 - Make a separate variable used to append pgo flags to compile command lines. r=glandium
This commit establishes a separate variable to add PROFILE_GEN and PROFILE_USE
CFLAGS to compile and link command lines. Currently the make backend
orchestrates the pgo build steps and is the only thing aware of whether
we're in the profile generate or profile use stage. The flags are separated
here to allow other flags to be moved to mozbuild, but this will not yet
sufficient to perform a PGO build independent of the make backend.

MozReview-Commit-ID: IX30l2MvvNc
2017-10-25 15:10:04 -07:00
Gregory Szorc 6f60ff2761 Bug 1411081 - Derive Rust compiler flags in configure; r=glandium
Before this commit, RUSTFLAGS was derived in rules.mk by consulting
various variables set by configure. It isn't clear to me why things
are implemented this way. We don't appear to have moz.build level
overrides for Rust compiler flags. So there doesn't appear to be a
compelling reason why we can't derive these values in configure.

So, this commit ports the code for deriving default RUSTFLAGS from
rules.mk to toolchain.configure.

The port is pretty straightforward as far as the logic goes.

MozReview-Commit-ID: JhAE9Qlo8SK

--HG--
extra : rebase_source : 6186cb81cd37c516b3d645419b9461bf501d6ba2
2017-10-24 14:42:01 -07:00
Jan Beich 6b04a97785 Bug 1409680 - Extend --disable-debug-symbols to Rust code. r=glandium
This reduces disk I/O and memory usage during build that already lacks
debugging symbols from C++ code, allowing to use more jobs on 32bit hosts.

--disable-debug-symbols build on FreeBSD 10.3 i386 (8 cores) host:
Max RSS before:  libxul - 612 Mb, libgkrust - 1908 Mb
Max RSS after:   libxul - 444 Mb, libgkrust - 1471 Mb
Binary before:   libxul - 203 Mb, libgkrust -  732 Mb
Binary after:    libxul - 123 Mb, libgkrust -  301 Mb

MozReview-Commit-ID: 40UEYuKddZ2

--HG--
extra : rebase_source : 905c61c8f738027bb43d213c4a4e63db1b9c5008
2017-10-18 08:38:54 +00:00
Mike Hommey 59ba5a09e4 Bug 1381043 - Enable fuller debug info for rust code on OSX cross builds. r=froydnj
--HG--
extra : rebase_source : 145edf24d2ea1366fe8ee0430bb95a99b841dd83
2017-10-12 18:02:49 +09:00
Nathan Froyd f0fcd23367 Bug 1373878 - part 2 - build system support for Rust tests; r=rillian 2017-10-02 09:21:22 -04:00
Chris Manchester c6f31b26d8 Bug 1398897 - Move includes to computed flags. r=glandium
MozReview-Commit-ID: Ec0wZfoV63B

--HG--
extra : rebase_source : c004185b9a9938343efb93920f646afd30b4b01e
2017-09-20 12:43:23 -07:00
Nathan Froyd c150b738a2 Bug 1378830 - part 1 - define PROG_IS_C_ONLY variables for PROGRAM and SIMPLE_PROGRAMS; r=chmanchester
Similar to the existing LIB_IS_C_ONLY variable, these variables indicate
that the program in question has only C sources and so can be linked by
the C compiler rather than the C++ compiler.  We need to add a little
more information to BaseProgram so we can avoid emitting periods into
Makefile variables.
2017-08-17 16:21:23 -04:00
Matt Brubeck 503070ad8d Bug 1386371 - Disable LTO by default, but enable in automation. r=froydnj
MozReview-Commit-ID: 2DIY9ex3Mch

--HG--
extra : rebase_source : 61f2f073adabfa7c46c324470a308adab23e7781
2017-08-10 11:38:10 -07:00
Kartikaya Gupta 8b8a999a38 Bug 1388423 - Get full rust backtraces everywhere. r=jmaher
MozReview-Commit-ID: 2Mfrpupz7As

--HG--
extra : rebase_source : 9b612430360fe46162f433f13667664188ceac55
2017-08-08 12:34:55 -04:00
Tom Prince f5e17a64ce Bug 1381955 - Don't override RUSTFLAGS to set rust's debuginfo; r=glandium
MozReview-Commit-ID: HevATvXusvE

--HG--
extra : rebase_source : c85d378e9168ffbdd7384710055db6a1806e7a03
2017-07-17 17:13:19 -06:00
Mike Hommey ef1d3c7153 Bug 1367940 - Pass the make jobserver file descriptors down to cargo. r=gps
cargo 1.19, and later cargo 1.20/rustc 1.19 gained support for the make
jobserver. But that doesn't work unless make passes the jobserver file
descriptors down to subprocesses, which it only does when there is a +
prefixing commands.

--HG--
extra : rebase_source : a00ffb7edb358243ac7b9469941ec6fb5ad84885
2017-07-13 20:07:49 +09:00
Mike Shal 29be674102 Bug 1380381 - Set rust debuginfo=1 for cross-OSX builds; r=glandium a=kwierso to reopen this CLOSED TREE
This is similar to bug 1301751, where something in rust seems to trigger errors
running dsymutil to generate debug symbols in OSX. We can set debuginfo=1 for
these builds as a temporary workaround for now, while we work on a more
permanent solution in rust and/or dsymutil. debuginfo=1 still gives us enough
info for stack traces, although without line info. debuginfo=2 would be useful
for debugging, but is irrelevant to crash reports.

MozReview-Commit-ID: DdA00GzVfWg

--HG--
extra : amend_source : 47d3573042098194a07f9b473e4a02c86a1eba7c
2017-07-13 18:49:10 -04:00
Nathan Froyd c4db85fbe1 Bug 1378440 - part 2 - add `mach cargo check`; r=rillian
Cargo recently introduced the `cargo check` command for shortening the
edit-compile cycle when working on large programs.  Since we don't
really support invoking `cargo` directly, let's wire up this command to
`mach`.  Gecko developers can then `mach cargo check` to ensure their
changes typecheck.
2017-07-05 14:19:31 -04:00
Nathan Froyd d73da35d6b Bug 1378440 - part 1 - make Cargo invocation macro more generic; r=rillian
All the machinery we set up for `cargo build` is equally useful for
other commands, such as `cargo check`.  Let's refactor things so that
it's easy to reuse said machinery for `cargo check`.
2017-07-05 14:19:31 -04:00
Nathan Froyd 2c6c66c145 Bug 1377971 - part 3 - honor LIB_IS_C_ONLY in more cases; r=glandium
We currently only honor LIB_IS_C_ONLY for cases where we set a
LIBRARY (and, implicitly, REAL_LIBRARY) and FORCE_SHARED_LIB.  For many
libraries, such as the libraries from NSS, we never set LIBRARY, which
leads to not setting REAL_LIBRARY, which leads to not honoring
LIB_IS_C_ONLY.  This practice has not been harmful thus far (except
perhaps linking in more things than necessary to our NSS shared
libraries), but on some platforms, linking with the C++ compiler will
drag in more things than we would like.

Consulting LIBRARY first should not be necessary; checking
FORCE_SHARED_LIB should be enough to tell us if we're building a shared
library for the purposes of honoring LIB_IS_C_ONLY.
2017-07-05 14:05:10 -04:00
Nathan Froyd 87007ca0f2 Bug 1377157 - remove VCINSTALLDIR from cargo's environment when running in MozillaBuild; r=ted.mielczarek
Stable Rust currently has logic similar to the following for finding the
linker on Windows:

  if VCINSTALLDIR in os.env:
    search for things in PATH
    if found, return, otherwise fallthrough

  look for MSVC installations of various kinds

For our current MozillaBuild setup where we clear out PATH prior to
invoking Cargo, this works: even though VCINSTALLDIR is set and we
(unsuccessfully) search through an empty PATH, we'll still fallback to
looking for MSVC installations.

Beta Rust has altered this search strategy:

  if VCINSTALLDIR in os.env:
    search for things in PATH
    return the result of the search, regardless of success

  look for MSVC installations of various kinds

Note that in the above logic, if VCINSTALLDIR is set, we are only going
to try looking in PATH for an appropriate linker.  Since PATH is empty
in our current MozillaBuild setup, beta Rust will therefore fail to find
the correct linker.  This failure causes numerous problems.

Since Firefox is already trying to "clean" the environment that Cargo is
invoked in, we should work a little bit harder by unsetting VCINSTALLDIR
entirely, and simply force Rust to search for known MSVC installations.
Making this change makes stable and beta Rust behave identically.

(We don't have to worry about this distinction in automation, because
the "cleaning" code is only activated when we detect a MozillaBuild
shell.)
2017-06-29 13:41:57 -04:00
Ted Mielczarek 94c9fe93f2 bug 1357825 - use sccache for caching Rust compilation. r=froydnj
MozReview-Commit-ID: 84PCmiVBlrV

--HG--
extra : rebase_source : ae23d383a1a2057d7027a4a6ffc9cfa4e3e15fcf
extra : histedit_source : 031e0d29f15b07208a08aba477d7bc9ca5a3f196
2017-05-01 11:58:45 -04:00
Chris Manchester 479795876a Bug 1370695 - Remove build system code handling binary components. r=glandium
MozReview-Commit-ID: BKHWR34vWsu

--HG--
extra : rebase_source : d870a222d393479bb8ede2aaec571299488806c0
2017-06-13 16:01:45 -07:00
Henri Sivonen 763d66dd51 Bug 1261841 part 4 - Add a configuration option for enabling explicit SIMD in Rust. r=froydnj.
MozReview-Commit-ID: ICifcJ9499a
2017-06-13 13:24:19 +03:00
Marco Castelluccio adc55303d4 Bug 1322803 - Allow setting additional rustflags via mozconfig. r=ted
--HG--
extra : rebase_source : 996d0e0f9ac85c10ad7b188585e823da74407384
2017-06-06 01:05:10 +01:00
Nathan Froyd 0fe161627a Bug 1368177 - quote {LIB,}CLANG_PATH for cargo; r=rillian
These paths can contain spaces, particularly if they point into
${HOME}/.mozbuild on Windows.  If people are bold enough to use the
Windows packages from llvm.org, the LLVM packages are installed by
default into C:\Program Files\LLVM, so paths from there would contain
spaces as well.
2017-05-28 17:13:30 -04:00
Ralph Giles 40e81c774e Bug 1365993 - Don't pass mac frameworks to cargo linker. r=froydnj
Procedural macros for rust are compiled as dynamic libraries.
The compiler subsequently loads those libraries at runtime
when it compiles crates which make use of them.

We pass the generic LDFLAGS to our linker wrapper which ensures
cargo links static libraries with the correct flags. However
this also means that any final system dependency libraries
end up linked into the procedural macro dynamic libraries
whether they use them or not.

When building on macOS 10.7, this causes a SIGTRAP when dlopen
calls CFInitialize for system libraries like Cocoa off the main
thread. We believe this is a macOS bug, reported fixed in macOS 10.9.
https://openradar.appspot.com/7209349

Work around the issue by stripping those libraries and Frameworks
from the linker flags we pass to cargo. We could do a more careful
job of parsing and removing all -framework and -lfoo arguments
inside the linker script, but since this is a temporary issue
while we're using older build machines, I thought just stripping
them once in the build system was simpler.

MozReview-Commit-ID: CGXD8ARvojj

--HG--
extra : rebase_source : 33f28e8fbafb43dbdd257d9162a6e792fca79e51
2017-05-25 14:49:32 -07:00
Xidorn Quan fed3d8d65c Bug 1336540 - Move config info from build_gecko.rs to a toml file in gecko. r=emilio
MozReview-Commit-ID: 9w9UX38YMUt

--HG--
extra : source : 36bcb2c10614c9b9f597f13d302953f9af14f928
extra : amend_source : 8ac25556385e64fe8fae425ccc9bfdc1cbcc49ef
2017-05-19 12:51:48 +10:00
Wes Kocher 090e554ce2 Backed out 2 changesets (bug 1336540) for build bustage a=backout
Backed out changeset 1bef3928a127 (bug 1336540)
Backed out changeset 42feca9f0e17 (bug 1336540)

MozReview-Commit-ID: 8NH4gZcDy6E
2017-05-18 18:11:12 -07:00
Xidorn Quan 029693f013 Bug 1336540 part 1 - Move config info from build_gecko.rs to a toml file in gecko. r=emilio
MozReview-Commit-ID: 9w9UX38YMUt

--HG--
extra : rebase_source : 36bcb2c10614c9b9f597f13d302953f9af14f928
2017-05-19 10:25:36 +10:00
Ralph Giles f56cb16c14 Bug 1336153 - Remove MOZ_RUST. r=ted
We now have code that unconditionally requires the rust
compiler and are committed to adding more. Remove this
last vestige of conditional support.

MozReview-Commit-ID: EK6FBnAbR

--HG--
extra : rebase_source : 6efda10a74f9ca0482304c2b1ffe6941e42138f8
2017-05-09 11:36:13 -07:00
Nathan Froyd 60baca157f Bug 1362516 - disable custom Cargo linker for TSan builds; r=rillian,f=bwc
For all the same reasons as why we disable the linker for ASan builds.
2017-05-05 16:53:37 -04:00
Nathan Froyd d3325ce1a2 Bug 1329737 - part 3 - use an alternate linker for Cargo invocations; r=rillian
For linking static libraries, rustc will use whatever `cc` it finds (or
the equivalent on Windows).  For our purposes, however, `cc` is not what
we use to link and we may have additional options we would like to pass
to the linker.

To do this, we need to tell Cargo about our alternate linker (currently
only used for target compilations, on the theory that the host compiler
rustc finds is probably good enough) and we also need to pass our linker
options into the process.  We do this with environment variables, which
is not a great solution, but works surprisingly well.

This alternate linker is disabled for ASan builds due to peculiar
crashes when running Rust build scripts and for Windows, because we
don't do any interesting cross-compiling there.
2017-04-28 14:06:41 -04:00
Nathan Froyd 67c11f7395 Bug 1329737 - part 2 - turn CARGO_BUILD into a callable function; r=rillian
This change paves the way for injecting target- or host-specific
environment variables for a particular `cargo build` invocation.  Doing
this is not strictly necessary: all of our current `cargo build`
invocations use mostly target-specific environment
variables (e.g. PKG_CONFIG_ALLOW_CROSS).  But separating things out
makes the code notationally cleaner and also avoids weirdness when
target==host.
2017-04-28 14:06:42 -04:00
Robert O'Callahan 5bfc8d6e8f Bug 279212 - More robust argument detection for ELOG; r=bryner
--HG--
extra : rebase_source : 05a6ef097ceec287091dbce09da551cf0093599d
extra : amend_source : b0cc0b867e8f16bce13f0b41df40bfa48a5ef174
2005-01-21 03:56:31 +00:00
Kartikaya Gupta 0993695398 Bug 1355464 - Only clean out the environment variables that are affected by 32- vs 64-bit builds. r=ted
Instead of using the -i flag to clean out the entire set of environment
variables, we explicitly just clear out the variables that are affected by
32- vs 64-bit builds in vcvars.bat. This still allows cargo to use it's
internal autodetection to do host/target builds as it wants when cross-compiling,
but also allows other things that rely on include directories and so on to
work properly.

MozReview-Commit-ID: 99SECKv1zQa

--HG--
extra : rebase_source : 2c2a7d79201b66ac3262afcc5f060936ca2e8fa2
2017-04-11 13:35:40 -04:00
Nathan Froyd 15f364135a Bug 1358597 - always make Cargo verbose in automation; r=ted.mielczarek
This change brings Cargo closer to what our C/C++ build already does,
and some forms of Cargo failure are only diagnosed when you pass
`--verbose`, so let's eliminate that extra step for people.
2017-04-21 22:25:59 -04:00
Nathan Froyd 2989feb7d7 Bug 1353810 - add a --enable-rust-debug option; r=chmanchester
For people working on Rust code, compiling in debug mode (Cargo's "dev"
profile) is convenient: debug assertions are turned on, optimization is
turned off, and parallel compilation inside of rustc itself can be
used.  These things make the build faster and the debugging experience
more pleasant.

To obtain that currently, one needs to --enable-debug at the Gecko
toplevel, which turns on debug assertions for the entire browser, which
makes things run unreasonably slowly.  So it would be desirable to be
able to turn *off* debug mode for the entirety of the browser, but turn
on debug mode for the Rust code only.

Hence this added switch, --enable-rust-debug, which does what it
suggests and defaults to the value of --enable-debug.  For our own
sanity and because we judge it a non-existent use case, we do not
support --enable-debug --disable-rust-debug.
2017-04-12 21:49:25 -04:00
Chris Manchester 5c47bb8d2e Bug 1337986 - Dump symbols during the compile tier. r=ted
This commit moves symbol dumping to the compile tier, to be run via "syms"
targets. Tracking files are used for the sake of incremental builds, because
dump_syms may genearate multiple outputs whose paths are not known ahead of
time.

Minimal changes to symbolstore.py are made here. More extensive
simplifications will be made in a future commit on the basis of symbolstore.py
handling one file at a time.

MozReview-Commit-ID: 3mOP8A6Y7iM

--HG--
extra : rebase_source : bfe97afcdfc05b9e79f01577701c83e8b00eb4e9
2017-02-10 08:34:08 -08:00
Chris Manchester 4db8e0b54a Bug 1337986 - Generate "syms" targets for directories containing programs or shared libraries. r=glandium
This creates "syms" targets that depend on the corresponding "target" for
directories containing shared libraries or programs. These targets are added
to the main compile graph in automation, and can be invoked through a special
"symbols" target. A future commit will use these targets to dump symbols for
shared libraries and programs during the compile tier.

MozReview-Commit-ID: KLuvmqsK4Zj

--HG--
extra : rebase_source : 8d76b999cb6fac8f11168ac6ebfb58774dfc2d3c
2017-04-10 10:27:49 -07:00