Page MenuHomePhabricator

Ignore -fsemantic-interposition/-fno-semantic-interposition flag for gcc compatibility
Needs RevisionPublic

Authored by Romain-Geissler-1A on Aug 1 2019, 4:00 PM.

Details

Summary

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

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2019, 4:00 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Aug 2 2019, 10:45 PM

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,
Romain

serge-sans-paille added a subscriber: hfinkel.

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)

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)

-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).

that may be used by some gcc users

Can you just name the user groups? :) When they write -fsemantic-interposition, do they know that current clang doesn't match the GCC behavior?

MaskRay requested changes to this revision.Aug 19 2019, 7:45 AM
This revision now requires changes to proceed.Aug 19 2019, 7:45 AM

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,
Romain