summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
2017-04-20Add x86_64-linux-android targetMarco A L Barbosa-0/+35
2017-04-14Compile WASM as WASM instead of asm.jsChristopher Serr-1/+1
Looks like the LinkerFlavor change introduced in #40018 accidentally uses GCC for the WebAssembly target, causing Rust to never actually pass the post link args to emscripten. This then causes the code to be compiled as asm.js instead of WebAssembly, because the Binaryen tools never run due to the missing linker argument.
2017-04-07-Z linker-flavorJorge Aparicio-187/+475
This patch adds a `-Z linker-flavor` flag to rustc which can be used to invoke the linker using a different interface. For example, by default rustc assumes that all the Linux targets will be linked using GCC. This makes it impossible to use LLD as a linker using just `-C linker=ld.lld` because that will invoke LLD with invalid command line arguments. (e.g. rustc will pass -Wl,--gc-sections to LLD but LLD doesn't understand that; --gc-sections would be the right argument) With this patch one can pass `-Z linker-flavor=ld` to rustc to invoke the linker using a LD-like interface. This way, `rustc -C linker=ld.lld -Z linker-flavor=ld` will invoke LLD with the right arguments. `-Z linker-flavor` accepts 4 different arguments: `em` (emcc), `ld`, `gcc`, `msvc` (link.exe). `em`, `gnu` and `msvc` cover all the existing linker interfaces. `ld` is a new flavor for interfacing GNU's ld and LLD. This patch also changes target specifications. `linker-flavor` is now a mandatory field that specifies the *default* linker flavor that the target will use. This change also makes the linker interface *explicit*; before, it used to be derived from other fields like linker-is-gnu, is-like-msvc, is-like-emscripten, etc. Another change to target specifications is that the fields `pre-link-args`, `post-link-args` and `late-link-args` now expect a map from flavor to linker arguments. ``` diff - "pre-link-args": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "pre-link-args": { + "gcc": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "ld": ["--as-needed", "-z,-noexecstack"], + }, ``` [breaking-change] for users of custom targets specifications
2017-03-23Remove internal liblogAlex Crichton-1/+1
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-6/+6
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-02-16add solaris sparcv9 supportShawn Walker-Salas-0/+36
* Update bootstrap to recognize the cputype 'sparcv9' (used on Solaris) * Change to never use -fomit-frame-pointer on Solaris or for sparc * Adds rust target sparcv9-sun-solaris Fixes #39901
2017-02-07Rollup merge of #39426 - jakllsch:netbsd-c, r=alexcrichtonCorey Farwell-0/+31
Add i686-unknown-netbsdelf target
2017-02-06Rename i686-unknown-netbsdelf target to i686-unknown-netbsdJonathan A. Kollasch-1/+1
2017-02-05Rollup merge of #39491 - dumbbell:support-aarch64-unknown-freebsd, ↵Corey Farwell-0/+35
r=alexcrichton Support aarch64-unknown-freebsd
2017-02-05Rollup merge of #39193 - pepyakin:emcc-strip-panic-rt, r=alexcrichtonCorey Farwell-0/+9
Tell emscripten to remove exception handling code when panic=abort Fixes #36900
2017-02-03Add `aarch64-unknown-freebsd` to the supported targetsJean-Sébastien Pédron-0/+35
2017-01-31Add i686-unknown-netbsdelf targetJonathan A. Kollasch-0/+31
2017-01-29Fix backtraces on i686-pc-windows-gnu by disabling FPOSegev Finer-0/+1
This might have performance implications. But do note that MSVC disables FPO by default nowadays and it's use is limited in exception heavy languages like C++. Closes: #28218
2017-01-22travis: Enable testing i686 muslAlex Crichton-0/+14
This fixes the final issues with the target related to unwinding by disabling removal of frame pointers.
2017-01-20Json encoding/decoding for is_like_emscriptenSergey Pepyakin-0/+2
2017-01-19tell emcc stip exception handling if panic rt usedSergey Pepyakin-0/+7
2017-01-12Disable jemalloc on s390x as well (closes #38596)Ximin Luo-0/+2
See also #37320 and #37392
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2017-01-04Auto merge of #38707 - redox-os:master, r=brsonbors-9/+1
Add socket timeout and ttl support in `sys::redox` This adds support for `read_timeout`, `write_timeout`, and `ttl` on `TcpStream`, `TcpListener`, and `UdpSocket` in the `sys::redox` module. The DNS lookup has been set to use a 5 second timeout by default.
2017-01-03Remove -lc, -lm from the target spec - the cross compiler will link thoseJeremy Soller-9/+1
2017-01-01Merge branch 'master' into sparc64Seo Sanghyeon-4/+24
2016-12-30sparc64-linux supportJorge Aparicio-0/+32
2016-12-31Auto merge of #38601 - schulzch:master, r=brsonbors-4/+24
Partial fix for #38489. Fixes script name resolution for windows by invoking `emcc.bat` instead of `emcc`, etc. Remaining issue: ``` Traceback (most recent call last): File "C:\Program Files\Emscripten\emscripten\1.35.0\\emcc", line 1309, in <module> final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL) File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1471, in llvm_opt assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output AssertionError: Failed to run llvm optimizations: ```
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-29Add sparc64-unknown-netbsd targetJonathan A. Kollasch-0/+31
2016-12-28Auto merge of #38579 - whitequark:min_atomic_width, r=alexcrichtonbors-0/+12
Add a min_atomic_width target option, like max_atomic_width Rationale: some ISAs, e.g. OR1K, do not have atomic instructions for byte and halfword access, and at the same time do not have a fixed endianness, which makes it unreasonable to implement these through word-sized atomic accesses.
2016-12-26Use cfg!() to get type checking everywhere.Christoph Schulz-7/+5
2016-12-25Move target_family to TargetOptions, not TargetAlex Crichton-2/+2
Just fixing a compile error
2016-12-25Emscripten targets are Unix targetsBrian Anderson-0/+2
2016-12-24Add a min_atomic_width target option, like max_atomic_width.whitequark-0/+12
Rationale: some ISAs, e.g. OR1K, do not have atomic instructions for byte and halfword access, and at the same time do not have a fixed endianness, which makes it unreasonable to implement these through word-sized atomic accesses.
2016-12-23Auto merge of #38401 - redox-os:redox_cross, r=brsonbors-0/+95
Redox Cross Compilation I will admit - there are things here that I wish I did not have to do. This completes the ability to create a cross compiler from the rust repository for `x86_64-unknown-redox`. I will document this PR with inline comments explaining some things. [View this gist to see how a cross compiler is built](https://gist.github.com/jackpot51/6680ad973986e84d69c79854249f2b7e) Prior discussion of a smaller change is here: https://github.com/rust-lang/rust/pull/38366
2016-12-22Correct target_family messJeremy Soller-1/+13
2016-12-22Remove start functions, use newlib instead of openlibm + rallocJeremy Soller-5/+6
2016-12-22Partial fix for #38489.Christoph Schulz-4/+26
2016-12-21In order to successfully build, go back to rallocJeremy Soller-2/+2
2016-12-20Switch back to alloc_systemJeremy Soller-2/+2
2016-12-20Link openlibm only in libstdJeremy Soller-4/+0
2016-12-20Rollup merge of #38463 - japaric:asm-args, r=alexcrichtonAlex Crichton-0/+6
target spec: add an asm-args field to pass arguments to the external .. assembler The main use case is the (still out of tree) msp430 target. For that target we use an external assembler, `mps430-elf-gcc`, to produce object files from the assembly rustc/llvm outputs. The problem is that by default `msp430-elf-gcc` produces object files for the MSP430**X** ABI but we want to use produce objects using the MSP430 (note: no X) ABI. To do that we have to pass `-mcpu=msp430` to the assembler and that's what this flag is for. r? @alexcrichton cc @pftbest
2016-12-18target spec: add an asm-args field to pass arguments to the external ..Jorge Aparicio-0/+6
assembler
2016-12-16rustc: Link to Android ABI requirements.Ralph Giles-0/+9
Hopefully these references will be stable and provide guidance when requirements change in the future.
2016-12-16rustc: Disable NEON on armv7 android.Ralph Giles-2/+2
We thought Google's ABI for arvm7 required neon, but it is currently optional, perhaps because there is a significant population of Tegra 2 devices still in use. This turns off neon code generation outside #[target-feature] blocks just like we do on armv7-unknown-linux-gnu, but unlike most other armv7 targets. LLVM defaults to +neon for this target, so an explicit disable is necessary. See https://developer.android.com/ndk/guides/abis.html#v7a for instruction set extension requirements. Closes #38402.
2016-12-15Add openlibm to redoxJeremy Soller-0/+4
2016-12-15Add start functions, switch allocation crate to rallocJeremy Soller-2/+2
2016-12-15Use alloc_system as default allocation crateJeremy Soller-0/+2
2016-12-15Use panic abort by defaultJeremy Soller-0/+2
2016-12-15Fix issue with setting cfg(unix)Jeremy Soller-0/+1
2016-12-15Fix typoJeremy Soller-2/+1
2016-12-15Add redox targetJeremy Soller-0/+78
2016-12-04Auto merge of #38086 - semarie:openbsd-i686, r=alexcrichtonbors-0/+40
Add i686-unknown-openbsd target. It is a preliminary work. I still have some tests failing, but I have a working rustc binary which is able to rebuild itself. an update of libc should be required too, but I dunno how to do it with vendor/ layout. r? @alexcrichton
2016-12-04OpenBSD under x86 has particular ABI for returning a struct.Sébastien Marie-0/+7
It is like OSX or Windows: small structs are returned as integers.