This is an archive of the discontinued LLVM Phabricator instance.

Ignore -fsemantic-interposition/-fno-semantic-interposition flag for gcc compatibility
ClosedPublic

Authored by MaskRay 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

(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?

MaskRay added a comment.EditedJan 14 2020, 10:42 AM

(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?

Supporting -fno-semantic-interposition alone is good. Just don't silently ignore -fsemantic-interposition :)

@serge-sans-paille @Romain-Geissler-1A D72724

Obsoleted by https://reviews.llvm.org/D72724, closing. Thanks @Romain-Geissler-1A for triggering that patch!

MaskRay commandeered this revision.Feb 22 2021, 10:39 PM
MaskRay edited reviewers, added: Romain-Geissler-1A; removed: MaskRay.
This revision is now accepted and ready to land.Feb 22 2021, 10:39 PM
MaskRay closed this revision.Feb 22 2021, 10:39 PM