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

clang-4.0: error: unknown argument: '-fno-plt'

Proposed patch adds -fno-plt and -fplt to existing ignored flags list making it 
compatible with gcc for package building. You can see more info about those 
flags in gcc manual:
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Code-Gen-Options.html#Code-Gen-Options
Thank you for your attention.
Jordan Glover
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td	(revision 307280)
+++ include/clang/Driver/Options.td	(working copy)
@@ -2497,6 +2497,7 @@
 defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group<clang_ignored_f_Group>;
 defm peel_loops : BooleanFFlag<"peel-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm permissive : BooleanFFlag<"permissive">, Group<clang_ignored_f_Group>;
+defm plt : BooleanFFlag<"plt">, Group<clang_ignored_f_Group>;
 defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm printf : BooleanFFlag<"printf">, Group<clang_ignored_f_Group>;
 defm profile : BooleanFFlag<"profile">, Group<clang_ignored_f_Group>;
Index: test/Driver/clang_f_opts.c
===================================================================
--- test/Driver/clang_f_opts.c	(revision 307280)
+++ test/Driver/clang_f_opts.c	(working copy)
@@ -275,6 +275,7 @@
 // RUN:     -fno-fat-lto-objects -ffat-lto-objects                            \
 // RUN:     -fno-merge-constants -fmerge-constants                            \
 // RUN:     -fno-caller-saves -fcaller-saves                                  \
+// RUN:     -fno-plt                                                          \
 // RUN:     -fno-reorder-blocks -freorder-blocks                              \
 // RUN:     -fno-schedule-insns2 -fschedule-insns2                            \
 // RUN:     -fno-stack-check                                                  \
@@ -281,6 +282,7 @@
 // RUN:     -fno-check-new -fcheck-new                                        \
 // RUN:     -ffriend-injection                                                \
 // RUN:     -fno-implement-inlines -fimplement-inlines                        \
+// RUN:     -fplt                                                             \
 // RUN:     -fstack-check                                                     \
 // RUN:     -fforce-addr                                                      \
 // RUN:     -malign-functions=100                                             \
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to