[cfe-commits] r110886 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Driver.cpp
Daniel Dunbar
daniel at zuster.org
Wed Aug 11 17:05:12 PDT 2010
Author: ddunbar
Date: Wed Aug 11 19:05:12 2010
New Revision: 110886
URL: http://llvm.org/viewvc/llvm-project?rev=110886&view=rev
Log:
Driver: Use the compile time linker version as the default for -mlinker-version,
if detected.
- This is a hack, we really want the linker version at execution time, but we
don't have any infrastructure for getting that. Yet.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=110886&r1=110885&r2=110886&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Wed Aug 11 19:05:12 2010
@@ -442,7 +442,7 @@
def miphoneos_version_min_EQ : Joined<"-miphoneos-version-min=">, Group<m_Group>;
def mios_version_min_EQ : Joined<"-mios-version-min=">, Alias<miphoneos_version_min_EQ>;
def mkernel : Flag<"-mkernel">, Group<m_Group>;
-def mlinker_version_EQ : Joined<"-mlinker-version=">, Group<m_Group>;
+def mlinker_version_EQ : Joined<"-mlinker-version=">;
def mllvm : Separate<"-mllvm">;
def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>;
def mmmx : Flag<"-mmmx">, Group<m_x86_Features_Group>;
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=110886&r1=110885&r2=110886&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Aug 11 19:05:12 2010
@@ -25,6 +25,7 @@
#include "clang/Basic/Version.h"
+#include "llvm/Config/config.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/PrettyStackTrace.h"
@@ -159,6 +160,15 @@
DAL->append(*it);
}
+ // Add a default value of -mlinker-version=, if one was given and the user
+ // didn't specify one.
+#if defined(HOST_LINK_VERSION)
+ if (!Args.hasArg(options::OPT_mlinker_version_EQ)) {
+ DAL->AddJoinedArg(0, Opts->getOption(options::OPT_mlinker_version_EQ),
+ HOST_LINK_VERSION);
+ }
+#endif
+
return DAL;
}
More information about the cfe-commits
mailing list