From 5d1b3ba687690bbb37f911f66a2c2c5f19d60032 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 14 Jan 2020 10:46:33 -0800 Subject: [PATCH] [Driver] Ignore -fno-semantic-interposition Fedora wants to build projects with -fno-semantic-interposition (e.g. https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup), which is supported by GCC>=5. Clang's current behavior is similar to -fno-semantic-interposition and the end goal is to make it more so (https://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html). Ignore this option. We should let users know -fsemantic-interposition is not currently supported, so it should remain a hard error. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D72724 --- clang/include/clang/Driver/Options.td | 1 + clang/test/Driver/clang_f_opts.c | 1 + 2 files changed, 2 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 71b257094a983..385ddbf5e40d7 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3258,6 +3258,7 @@ defm inline_small_functions : BooleanFFlag<"inline-small-functions">, defm ipa_cp : BooleanFFlag<"ipa-cp">, Group; defm ivopts : BooleanFFlag<"ivopts">, Group; +def : Flag<["-"], "fno-semantic-interposition">, Group; defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group; defm peel_loops : BooleanFFlag<"peel-loops">, Group; defm permissive : BooleanFFlag<"permissive">, Group; diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index 970b4e934e78e..7038a2b52f66e 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -251,6 +251,7 @@ // RUN: -fexec-charset=UTF-8 \ // RUN: -fivopts -fno-ivopts \ // RUN: -fnon-call-exceptions -fno-non-call-exceptions \ +// RUN: -fno-semantic-interposition \ // RUN: -fpermissive -fno-permissive \ // RUN: -fdefer-pop -fno-defer-pop \ // RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \