Hi,
This simple patch ignores -fsemantic-interposition/-fno-semantic-interposition that may be used by some gcc users, by copy/pasting what was done for other similar -f flags.
Cheers,
Romain
Differential D65616
Ignore -fsemantic-interposition/-fno-semantic-interposition flag for gcc compatibility MaskRay on Aug 1 2019, 4:00 PM. Authored by
Details Hi, This simple patch ignores -fsemantic-interposition/-fno-semantic-interposition that may be used by some gcc users, by copy/pasting what was done for other similar -f flags. Cheers,
Diff Detail
Event TimelineComment Actions Hi, Thanks Serge. Given that I am only a very occasional contributor, I don't have any right to push this commit myself. Would you please commit it for me ? Thanks, Comment Actions Adding @hfinkel to the thread to confirm it's okay to add this behavior, as he authored an RFC on the subject (see https://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html) Comment Actions -fsemantic-interposition was added in GCC 5.1. I don't think lots of projects in the wild are using it. The important D20217 has been merged, I think we should actually implement this option instead of ignoring it (I'd be very happy to help this).
Can you just name the user groups? :) When they write -fsemantic-interposition, do they know that current clang doesn't match the GCC behavior? Comment Actions Hi, The only group I know which uses -fsemantic-interposition is the company I work for: Amadeus. Since for now the flag doesn't exist on clang, no we don't know that the future clang implementation doesn't match the gcc one ;) But then we have to wonder if clang wants to reuse the same name if that doesn't do the same thing if really the differences are big. What are the differences between the gcc and the LLVM implementation (when -fsemantic-interposition will be wired up in clang) ? For now we are not using clang/llvm tools for anything else than static analysis and the useful tools from clang-extra-tools. In other words, we don't care about code gen of LLVM, yet (that may come eventually). My immediate concern right now is that when you use clang-tidy and friends with a compilation database generated for gcc, then you we end-up with warnings for each of the non-usual flags we use in Amadeus, like for example -fsemantic-interposition, that "pollutes" the output of these tools for each translation unit and thus it brings a user unfriendly experience. I am fine with wiring up a new flag -fsemantic-interposition in clang, however I have no idea what should be done for that, I have absolutely 0 knowledge in the LLVM source code, yet. Cheers, Comment Actions (back on that one) The default in clang is implicitly -fno-semantic-interposition. I think we can safely support it, and either warn or error on -fsemantic-interposition. @hfinkel does that seem correct to you? Comment Actions Supporting -fno-semantic-interposition alone is good. Just don't silently ignore -fsemantic-interposition :) Comment Actions Obsoleted by https://reviews.llvm.org/D72724, closing. Thanks @Romain-Geissler-1A for triggering that patch! |