From 8af669f2f1d92436fe6dc43144bb084a620e7516 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 19 Jun 2012 01:26:10 +0000 Subject: Add a -fuse-init-array option to cc1 and map to the UseInitArray target option. On the driver, check if we are using libraries from gcc 4.7 or newer and if so pass -fuse-init-array to the frontend. The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in .ctors, so we have to use .init_array. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158694 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/Frontend/CompilerInvocation.cpp') diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index fcc260f013..674299223f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1229,6 +1229,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.TrapFuncName = Args.getLastArgValue(OPT_ftrap_function_EQ); Opts.BoundsChecking = Args.getLastArgIntValue(OPT_fbounds_checking_EQ, 0, Diags); + Opts.UseInitArray = Args.hasArg(OPT_fuse_init_array); Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections); Opts.DataSections = Args.hasArg(OPT_fdata_sections); -- cgit v1.2.3-18-g5258