Add -fno-plt,-fplt to ignored flags

In GCC there is a -fno-plt [1] flag not implemented in Clang which results in compilation failure:

clang-4.0: error: unknown argument: ‘-fno-plt’

I created patch that adds -fno-plt and -fplt to existing ignored flags list making it compatible with gcc for package building. I tested it and it works as expected. I sent this patch already to cfe-commits [2] list as advised [3]. I would be grateful if anyone could review it and merge when it’s acceptable.

Thank you for your attention. Jordan Glover




Index: include/clang/Driver/

Can you please slap whoever decided to use a random new GCC flag without
checking for its existance first?

I have seen no evidence of this flag used in the wild so far, so I'm
quite reluctant to accept this change.


Thanks for the reply.

-fno-plt flag is going to be used as default build flag for every package available in Archlinux [1]. There were concerns about that change breaking clang but it was decided to add patch similar as mine [2]. Also some developers advised to submit such patch upstream [3][4].

Jordan Glover

[1] Groups · Explore · GitLab

[2] Groups · Explore · GitLab

[3] [arch-dev-public] Changing compilation flags

[4] [arch-dev-public] Changing compilation flags

So clang should this flag because Archlinux can't do compiler-specific
flag definitions and want to push a questionable flag everywhere? Sorry
if I'm a bit sarcastic, but that doesn't sound like a very good reason.


It’s also for convenience those users which want to use clang instead gcc which is the default compiler. This way they could change it easily without breakage. The list of ignored flags for gcc compatibility already exist with many entries so why don’t use it in that case? There are no security consequences when this flag is silently ignored. On the other hand clang already added fstack-check flag to ignore list which could mislead users as it have security implications as shoved in " stack-clash".

I reverse your question - what’s the reason to not add it to the list? It doesn’t interfere with anything. Some users will benefit and others wouldn’t care. I understand that you personally aren’t interested but please think about others who are.

Jordan Glover

The list of ignored flags is a result of evaluation wide spread historic
(ab)use. It is not meant as compensation because someone decides to use
*new* GCC flags without checking if it is actually supported by the


I think we actually want to implement this flag in the near future. Maybe Sri can say more.