llvm.org GIT mirror llvm / 96052a8
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212287 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
4 changed file(s) with 27 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as %s -o=%t1
1 ; RUN: rm -f %t2
2 ; RUN: llvm-ar rcs %t2 %t1
3 ; RUN: llvm-nm -s %t2 | FileCheck %s
4
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
7
8 module asm ".global global_asm_sym"
9 module asm "global_asm_sym:"
10 module asm "local_asm_sym:"
11 module asm ".long undef_asm_sym"
12
13 ; CHECK: Archive map
14 ; CHECK-NEXT: global_asm_sym in archive-ir-asm.ll
15
16 ; CHECK: archive-ir-asm.ll
17 ; CHECK-NEXT: T global_asm_sym
18 ; CHECK-NEXT: t local_asm_sym
19 ; CHECK-NEXT: U undef_asm_sym
0 set(LLVM_LINK_COMPONENTS
1 ${LLVM_TARGETS_TO_BUILD}
12 Object
23 Support
34 )
99 LEVEL := ../..
1010 TOOLNAME := llvm-ar
1111 TOOLALIAS = llvm-ranlib
12 LINK_COMPONENTS := bitreader support object
12 LINK_COMPONENTS := all-targets bitreader support object
1313
1414 # This tool has no plugins, optimize startup time.
1515 TOOL_NO_EXPORTS := 1
2323 #include "llvm/Support/MemoryBuffer.h"
2424 #include "llvm/Support/PrettyStackTrace.h"
2525 #include "llvm/Support/Signals.h"
26 #include "llvm/Support/TargetSelect.h"
2627 #include "llvm/Support/ToolOutputFile.h"
2728 #include "llvm/Support/raw_ostream.h"
2829 #include
902903 " This program archives bitcode files into single libraries\n"
903904 );
904905
906 llvm::InitializeAllTargetInfos();
907 llvm::InitializeAllTargetMCs();
908 llvm::InitializeAllAsmParsers();
909
905910 StringRef Stem = sys::path::stem(ToolName);
906911 if (Stem.find("ar") != StringRef::npos)
907912 return ar_main(argv);