WebAssembly / lld

Staging repository for upstreaming WebAssembly support into lld
Other
10 stars 10 forks source link

Missing linker flags #1

Closed ElvishJerricco closed 7 years ago

ElvishJerricco commented 7 years ago

There are many common linker flags that aren't available in the wasm driver. I'm not sure what the right process is for these, so I thought I'd start with a blanket issue. For example, if you pass -O2 to clang, it passes --gc-sections to the linker by default.

We're currently just using a patch that emits warnings for unrecognized linker flags rather than errors, since the projects we're building have fairly established build systems and pass -O2 to clang and -Bstatic to the linker. Merely emitting warnings is obviously incorrect though.

EDIT: are -> aren't

sbc100 commented 7 years ago

My understanding is that linker flags tend to be fairly platform specific, but where it makes sense, and we can do something meaningful I agree that we should accept these common arguments. I imagine that the --gc-sections flag is being passed because that the clang wasm driver was largely copied from the linux/elf driver and we can probably remove that.

sbc100 commented 7 years ago

Fixing in clang: https://reviews.llvm.org/D36595