about summary refs log tree commit diff
path: root/src/librustc_back/target
AgeCommit message (Collapse)AuthorLines
2017-05-30ARMv5 needs +strict-alignJan Niehusmann-1/+1
Without that flag, LLVM generates unaligned memory access instructions, which are not allowed on ARMv5. For example, the 'hello world' example from `cargo --new` failed with: ``` $ ./hello Hello, world! thread 'main' panicked at 'assertion failed: end <= len', src/libcollections/vec.rs:1113 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` I traced this error back to the following assembler code in `BufWriter::flush_buf`: ``` 6f44: e28d0018 add r0, sp, #24 [...] 6f54: e280b005 add fp, r0, #5 [...] 7018: e5cd001c strb r0, [sp, #28] 701c: e1a0082a lsr r0, sl, #16 7020: 03a01001 moveq r1, #1 7024: e5cb0002 strb r0, [fp, #2] 7028: e1cba0b0 strh sl, [fp] ``` Note that `fp` points to `sp + 29`, so the three `str*`-instructions should fill up a 32bit - value at `sp + 28`, which is later used as the value `n` in `Ok(n) => written += n`. This doesn't work on ARMv5 as the `strh` can't write to the unaligned contents of `fp`, so the upper bits of `n` won't get cleared, leading to the assertion failure in Vec::drain. With `+strict-align`, the code works as expected.
2017-05-24add thiscall calling convention supportNathan Froyd-1/+1
This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-02Rollup merge of #41657 - malbarbo:android-armv7-linker, r=alexcrichtonCorey Farwell-0/+2
Add -march=armv7-a parameter to armv7 android linker Without this option, the linker fails to link any library that uses `std::future`. The error points some undefined references, like `std::__future_base::_Result_base`. For example, it fails to link rustc because llvm 4.0 uses `std::future`. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
2017-04-30Add -march=armv7-a parameter to armv7 android linkerMarco A L Barbosa-0/+2
2017-04-30Change arm-linux-androideabi to correspond to the armeabi official ABIMarco A L Barbosa-1/+2
Fixes #40941.
2017-04-26Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichtonAriel Ben-Yehuda-1/+2
Haiku: fix initial platform support
2017-04-22Haiku: fix initial platform supportJessica Hamilton-1/+2
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/+433
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-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-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-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