News for hackers. Stuff that matters.
Re:Turns out GCC has imperative argument handling by woodruffw on Saturday July 02, 2022 @03:02AM (#31956865)
These kinds of complexities make accurately modeling (and instrumenting) build systems incredibly annoying.

To make things even worse: linker groups can include source inputs, not just arguments passed to the linker. Both clang and GCC seem to be aware of this and will compile the inputs, treating them as if they aren't inside the linker group[1]. Real build systems rely on this!

[1]: https://github.com/SRI-CSL/gllvm/issues/48

Re:Turns out GCC has imperative argument handling by xg15 on Saturday July 02, 2022 @07:40AM (#31958190)
I think this comment puts it nicely: https://github.com/SRI-CSL/gllvm/issues/48#issuecomment-8444...

But hang on, this is Linux where file extensions are basically just decoration. So if GCC now has special behaviour (and a different linker invocation) depending if the file is a source or an object file, does that mean GCC has to do content sniffing to figure out what the command is supposed to do?

Re:Turns out GCC has imperative argument handling by woodruffw on Saturday July 02, 2022 @06:16PM (#31962933)
I don't think it's content sniffing per se -- GCC is aware of the "standard" extensions for C and C++ sources, and will complain if an input doesn't match one of them (absent other flags to override the behavior, like `-x c++`.