[llvm] r212287 - Add support for inline asm symbols in llvm-ar.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jul 3 12:40:09 PDT 2014
Author: rafael
Date: Thu Jul 3 14:40:08 2014
New Revision: 212287
URL: http://llvm.org/viewvc/llvm-project?rev=212287&view=rev
Log:
Add support for inline asm symbols in llvm-ar.
This should allow llvm-ar to be used instead of gnu ar + plugin in a LTO
build. I will add a release note about it once I finish a LTO bootstrap with it.
Added:
llvm/trunk/test/Object/X86/archive-ir-asm.ll
Modified:
llvm/trunk/tools/llvm-ar/CMakeLists.txt
llvm/trunk/tools/llvm-ar/Makefile
llvm/trunk/tools/llvm-ar/llvm-ar.cpp
Added: llvm/trunk/test/Object/X86/archive-ir-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/archive-ir-asm.ll?rev=212287&view=auto
==============================================================================
--- llvm/trunk/test/Object/X86/archive-ir-asm.ll (added)
+++ llvm/trunk/test/Object/X86/archive-ir-asm.ll Thu Jul 3 14:40:08 2014
@@ -0,0 +1,20 @@
+; RUN: llvm-as %s -o=%t1
+; RUN: rm -f %t2
+; RUN: llvm-ar rcs %t2 %t1
+; RUN: llvm-nm -s %t2 | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+module asm ".global global_asm_sym"
+module asm "global_asm_sym:"
+module asm "local_asm_sym:"
+module asm ".long undef_asm_sym"
+
+; CHECK: Archive map
+; CHECK-NEXT: global_asm_sym in archive-ir-asm.ll
+
+; CHECK: archive-ir-asm.ll
+; CHECK-NEXT: T global_asm_sym
+; CHECK-NEXT: t local_asm_sym
+; CHECK-NEXT: U undef_asm_sym
Modified: llvm/trunk/tools/llvm-ar/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/CMakeLists.txt?rev=212287&r1=212286&r2=212287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-ar/CMakeLists.txt Thu Jul 3 14:40:08 2014
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS
+ ${LLVM_TARGETS_TO_BUILD}
Object
Support
)
Modified: llvm/trunk/tools/llvm-ar/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/Makefile?rev=212287&r1=212286&r2=212287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/Makefile (original)
+++ llvm/trunk/tools/llvm-ar/Makefile Thu Jul 3 14:40:08 2014
@@ -10,7 +10,7 @@
LEVEL := ../..
TOOLNAME := llvm-ar
TOOLALIAS = llvm-ranlib
-LINK_COMPONENTS := bitreader support object
+LINK_COMPONENTS := all-targets bitreader support object
# This tool has no plugins, optimize startup time.
TOOL_NO_EXPORTS := 1
Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=212287&r1=212286&r2=212287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Thu Jul 3 14:40:08 2014
@@ -24,6 +24,7 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
@@ -903,6 +904,10 @@ int main(int argc, char **argv) {
" This program archives bitcode files into single libraries\n"
);
+ llvm::InitializeAllTargetInfos();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmParsers();
+
StringRef Stem = sys::path::stem(ToolName);
if (Stem.find("ar") != StringRef::npos)
return ar_main(argv);
More information about the llvm-commits
mailing list