<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2019 at 9:34 AM Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">This proposal seems much better than the generic .linker-options scheme that potentially allows arbitrary linker options to be embedded to an object file. The proposed scheme is basically the same mechanism as the "comment lib" feature implemented on Microsoft linker, which I found mildly useful and at least not harmful.<div><br></div><div>As a use case, what I heard of was that in the game industry where many developers are using Visual Studio as an IDE and familiar with Windows' semantics of linking, people find it annoying that to build the same program on Unix, they had to add bunch of -lfoo to the linker command line while they are automatically handled on Windows. I can understand that -- if you have to add `-lm` 99.9% of the time when #include <math.h> for example, that's not too odd to think why this is not processed automatically.</div><div><br></div><div>But the above story was from the game industry. Just like Ben, I'd like to hear from other people if they really want this feature.</div><div><br></div></div></div></blockquote><div><br></div><div> Another situation where it is useful is when a 3rd party library supports multiple different ABI-incompatible build configurations (typically selected between via pre-processor settings).  This way, the header file can choose the right version of the library to link against.</div><div><br></div><div>This comes up often when linking against python, for example, where if you have #defined _DEBUG then you need to link against python35_d.[dll|so] versus python35.[dll|so].</div><div><br></div><div>You can certainly represent this kind of logic in a build system, but it leads to even more maintenance burden in my experience, and in general it's nice if things "just work".</div></div></div>