Repository: rust
Issue: Nightly not honoring -z stack-size
Labels: A-LLVM,T-compiler

Hi there! I'm noticing that on nightly using `-z stack-size` doesn't seem to affect the stack size, or at least not in the way I've been using it. Below are some example commands from my project.

Using stable:

```sh
$ cargo +stable --version
cargo 1.30.0 (a1a4ad372 2018-11-02)
$ RUSTFLAGS="-C link-args=-zstack-size=48000" cargo +stable build --release --target=wasm32-unknown-unknown -vv -p hello_bare
   Compiling hello_bare v0.1.0 (C:\Users\sagan\Documents\sagan-software\rust-eos\examples\hello_bare)
     Running `rustc --crate-name hello_bare 'examples\hello_bare\src\lib.rs' --color always --crate-type cdylib --emit=dep-info,link -C opt-level=s -C panic=abort -C lto -C metadata=673de3ef755438ae --out-dir 'C:\Users\sagan\Documents\sagan-software\rust-eos\target\wasm32-unknown-unknown\release\deps' --target wasm32-unknown-unknown -L 'dependency=C:\Users\sagan\Documents\sagan-software\rust-eos\target\wasm32-unknown-unknown\release\deps' -L 'dependency=C:\Users\sagan\Documents\sagan-software\rust-eos\target\release\deps' -C link-args=-zstack-size=48000`
    Finished release [optimized] target(s) in 0.67s
$ wasm2wat target/wasm32-unknown-unknown/release/hello_bare.wasm -o target/wasm32-unknown-unknown/release/hello_bare.wat --generate-names
$ tail target/wasm32-unknown-unknown/release/hello_bare.wat
  (global $g0 (mut i32) (i32.const 48000))
  (global $__heap_base i32 (i32.const 48004))
  (global $__data_end i32 (i32.const 48004))
  (export "memory" (memory 0))
  (export "__indirect_function_table" (table 0))
  (export "__heap_base" (global 1))
  (export "__data_end" (global 2))
  (export "apply" (func $apply))
  (export "rust_eh_personality" (func $rust_eh_personality))
  (data (i32.const 48000) "Hi, "))
```

Using nightly:

```sh
$ cargo +nightly --version
cargo 1.32.0-nightly (b3d0b2e54 2018-11-15)
$ RUSTFLAGS="-C link-args=-zstack-size=48000" cargo +nightly build --release --target=wasm32-unknown-unknown -vv -p hello_bare
   Compiling hello_bare v0.1.0 (C:\Users\sagan\Documents\sagan-software\rust-eos\examples\hello_bare)
     Running `rustc --crate-name hello_bare 'examples\hello_bare\src\lib.rs' --color always --crate-type cdylib --emit=dep-info,link -C opt-level=s -C panic=abort -C lto -C metadata=673de3ef755438ae --out-dir 'C:\Users\sagan\Documents\sagan-software\rust-eos\target\wasm32-unknown-unknown\release\deps' --target wasm32-unknown-unknown -L 'dependency=C:\Users\sagan\Documents\sagan-software\rust-eos\target\wasm32-unknown-unknown\release\deps' -L 'dependency=C:\Users\sagan\Documents\sagan-software\rust-eos\target\release\deps' -C link-args=-zstack-size=48000`
    Finished release [optimized] target(s) in 0.59s
$ wasm2wat target/wasm32-unknown-unknown/release/hello_bare.wasm -o target/wasm32-unknown-unknown/release/hello_bare.wat --generate-names
$ tail target/wasm32-unknown-unknown/release/hello_bare.wat
  (memory $memory 17)
  (global $g0 (mut i32) (i32.const 1048576))
  (global $__heap_base i32 (i32.const 1048580))
  (global $__data_end i32 (i32.const 1048580))
  (export "memory" (memory 0))
  (export "__indirect_function_table" (table 0))
  (export "__heap_base" (global 1))
  (export "__data_end" (global 2))
  (export "apply" (func $apply))
  (data (i32.const 1048576) "Hi, "))
```

For my application it's crucial that data segments are included within the first 64KiB which is why I've reduced the stack size to 48. Is there a workaround or am I missing something? Thanks.