PSA: Passing linker flags on the command line

已查看 28 次
跳至第一个未读帖子

Sam Clegg

未读,
2020年3月25日 21:45:522020/3/25
收件人 emscripte...@googlegroups.com
After going back and forth on this issue I'm hoping to once again allow arbitrary flags to be passed to the linker (wasm-ld) via the command line (-Wl,xxx):  https://github.com/emscripten-core/emscripten/pull/10747.

This means that some people will see linker errors because they (or thier build systems) pass flags via `-Wl,xxx` that wasm-ld doesn't handle.  If you encounter such errors you have we have two possible solutions for you:

1. Remove the offending flag from the linker command.
2. Add it to the list of flags that emscripten will ignore not not pass onto the linker (`UNSUPPORTED_LLD_FLAGS`).

Hopefully with a combination of these two solutions the fallout of this change should be minimal.

cheers,
sam

Floh

未读,
2020年3月27日 10:05:062020/3/27
收件人 emscripten-discuss
Apologies if this has already been discussed or asking an obviously dumb question, but shouldn't emcc be able to remove any unsupported options before passing them to wasm-ld without having to manually maintain a list of unsupported options, since emcc and wasm-ld are essentially "version-locked"?

Sam Clegg

未读,
2020年3月27日 12:56:252020/3/27
收件人 emscripte...@googlegroups.com
On Fri, Mar 27, 2020 at 7:05 AM Floh <flo...@gmail.com> wrote:
Apologies if this has already been discussed or asking an obviously dumb question, but shouldn't emcc be able to remove any unsupported options before passing them to wasm-ld without having to manually maintain a list of unsupported options, since emcc and wasm-ld are essentially "version-locked"?


That is the alternative approach and, as I say, we have gone back and forth on this a couple of times now.    The current approach has been frustrating for me over time because the full whitelist of supported flags isn't maintained correctly.  As wasm-ld evolves new flags get added but emscripten's list is out-of-date.  So we get bug reports where a new flag might be useful for debugging but the advice of adding `-Wl,-some-flag` to aid debugging doesn't work because `some-flag` gets filtered out. 

Secondly, in most cases, the correct solution is to stop passing bad linker flags.  I'd prefer to only ignore flags which are impossible/hard to remove from a given build system, or that we want to pretend to support.  I'd rather not pretend to support arbitrary flags that we don't even know about.   

Finally I believe the blacklist, of flags we what "fake" support for should not evolve over time and should be fixed (after an initial period I don't expect it to change).

Do you have projects that rely on faking support for certain flags?  i.e. are you directly affected by this change?

cheers,
sam

 
On Thursday, 26 March 2020 02:45:52 UTC+1, Sam Clegg wrote:
After going back and forth on this issue I'm hoping to once again allow arbitrary flags to be passed to the linker (wasm-ld) via the command line (-Wl,xxx):  https://github.com/emscripten-core/emscripten/pull/10747.

This means that some people will see linker errors because they (or thier build systems) pass flags via `-Wl,xxx` that wasm-ld doesn't handle.  If you encounter such errors you have we have two possible solutions for you:

1. Remove the offending flag from the linker command.
2. Add it to the list of flags that emscripten will ignore not not pass onto the linker (`UNSUPPORTED_LLD_FLAGS`).

Hopefully with a combination of these two solutions the fallout of this change should be minimal.

cheers,
sam

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/0fcaf075-541b-48e5-9163-2c3b0ab33261%40googlegroups.com.

Floh

未读,
2020年3月28日 07:11:242020/3/28
收件人 emscripten-discuss
Thanks for the explanation, I wasn't aware that wasm-ld flags change so frequently.

> Do you have projects that rely on faking support for certain flags?  i.e. are you directly affected by this change

From what I'm seeing in my own build scripts, no. But I maintain a build system wrapper (https://floooh.github.io/fips/) which also has helper commands for setting up a project-local emscripten SDK, so it might be that users of this build system wrapper are affected in their projects if they use -Wl for some reason, I think it's unlikely though.

Cheers!
回复全部
回复作者
转发
0 个新帖子