llvm.org GIT mirror llvm / 6e9b5eb
revert r147542 after comments from Joerg Sonnenberger git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147608 91177308-0d34-0410-b5e6-96231b3b80d8 Sebastian Pop 7 years ago
14 changed file(s) with 11 addition(s) and 59 deletion(s). Raw diff Collapse all Expand all
14831483 [Installation directory for man pages])
14841484 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
14851485 [Time at which LLVM was configured])
1486 AC_DEFINE_UNQUOTED(LLVM_HOST_TRIPLE, "$host",
1487 [Host triple LLVM will run on])
14881486 AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
14891487 [Target triple LLVM will generate code for by default])
14901488
287287 check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
288288
289289 include(GetTargetTriple)
290 get_target_triple(LLVM_HOST_TRIPLE)
291290 get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE)
292291
293 set(HOST_TRIPLE "${LLVM_HOST_TRIPLE}")
294292 set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
295293
296294 # Determine the native architecture.
297295 string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
298296 if( LLVM_NATIVE_ARCH STREQUAL "host" )
299 string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
300297 string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
301298 endif ()
302299
2091220912
2091320913
2091420914 cat >>confdefs.h <<_ACEOF
20915 #define LLVM_HOST_TRIPLE "$host"
20916 _ACEOF
20917
20918
20919 cat >>confdefs.h <<_ACEOF
2092020915 #define LLVM_DEFAULT_TARGET_TRIPLE "$target"
2092120916 _ACEOF
2092220917
559559 /* Has gcc/MSVC atomic intrinsics */
560560 #cmakedefine01 LLVM_HAS_ATOMICS
561561
562 /* Host triple LLVM will run on */
563 #cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
564
565562 /* Installation directory for include files */
566563 #cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"
567564
557557 /* Has gcc/MSVC atomic intrinsics */
558558 #undef LLVM_HAS_ATOMICS
559559
560 /* Host triple LLVM will run on */
561 #undef LLVM_HOST_TRIPLE
562
563560 /* Installation directory for include files */
564561 #undef LLVM_INCLUDEDIR
565562
3838
3939 /* Has gcc/MSVC atomic intrinsics */
4040 #cmakedefine01 LLVM_HAS_ATOMICS
41
42 /* Host triple LLVM will run on */
43 #cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
4441
4542 /* Installation directory for include files */
4643 #cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"
3838
3939 /* Has gcc/MSVC atomic intrinsics */
4040 #undef LLVM_HAS_ATOMICS
41
42 /* Host triple LLVM will run on */
43 #undef LLVM_HOST_TRIPLE
4441
4542 /* Installation directory for include files */
4643 #undef LLVM_INCLUDEDIR
3232 return !isLittleEndianHost();
3333 }
3434
35 /// getHostTriple() - Return the host where the compiler will be running.
36 ///
37 /// The host triple is a string in the format of:
38 /// CPU_TYPE-VENDOR-OPERATING_SYSTEM
39 /// or
40 /// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
41 std::string getHostTriple();
42
4335 /// getDefaultTargetTriple() - Return the default target triple the compiler
4436 /// has been configured to produce code for.
4537 ///
13721372 << " Built " << __DATE__ << " (" << __TIME__ << ").\n"
13731373 #endif
13741374 << " Default target: " << sys::getDefaultTargetTriple() << '\n'
1375 << " Host: " << sys::getHostTriple() << '\n'
13761375 << " Host CPU: " << CPU << '\n';
13771376 }
13781377 void operator=(bool OptionWasSpecified) {
8383 }
8484
8585 const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error) {
86 const Target *TheTarget = lookupTarget(sys::getHostTriple(), Error);
86 const Target *TheTarget = lookupTarget(sys::getDefaultTargetTriple(), Error);
8787
8888 if (TheTarget && !TheTarget->hasJIT()) {
8989 Error = "No JIT compatible target available for this host";
3434 return info.release;
3535 }
3636
37 std::string getTriple(StringRef &TripleString) {
38 std::pair ArchSplit = TripleString.split('-');
37 std::string sys::getDefaultTargetTriple() {
38 StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
39 std::pair ArchSplit = TargetTripleString.split('-');
40
41 // Normalize the arch, since the target triple may not actually match the target.
3942 std::string Arch = ArchSplit.first;
43
4044 std::string Triple(Arch);
4145 Triple += '-';
4246 Triple += ArchSplit.second;
5660
5761 return Triple;
5862 }
59
60 std::string sys::getDefaultTargetTriple() {
61 StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
62 return getTriple(TargetTripleString);
63 }
64
65 std::string sys::getHostTriple() {
66 StringRef HostTripleString(LLVM_HOST_TRIPLE);
67 return getTriple(HostTripleString);
68 }
1919 std::string sys::getDefaultTargetTriple() {
2020 return LLVM_DEFAULT_TARGET_TRIPLE;
2121 }
22
23 std::string sys::getHostTriple() {
24 return LLVM_HOST_TRIPLE;
25 }
13891389 [Installation directory for man pages])
13901390 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
13911391 [Time at which LLVM was configured])
1392 AC_DEFINE_UNQUOTED(LLVM_HOST_TRIPLE, "$host",
1393 [Host triple LLVM will run on])
13941392 AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
13951393 [Target triple LLVM will generate code for by default])
13961394
88538853 shlibpath_var=LD_LIBRARY_PATH
88548854 ;;
88558855
8856 freebsd1.*)
8856 freebsd1*)
88578857 dynamic_linker=no
88588858 ;;
88598859
88768876 objformat=`/usr/bin/objformat`
88778877 else
88788878 case $host_os in
8879 freebsd[123].*) objformat=aout ;;
8879 freebsd[123]*) objformat=aout ;;
88808880 *) objformat=elf ;;
88818881 esac
88828882 fi
88948894 esac
88958895 shlibpath_var=LD_LIBRARY_PATH
88968896 case $host_os in
8897 freebsd2.*)
8897 freebsd2*)
88988898 shlibpath_overrides_runpath=yes
88998899 ;;
89008900 freebsd3.[01]* | freebsdelf3.[01]*)
1040810408 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1040910409 lt_status=$lt_dlunknown
1041010410 cat > conftest.$ac_ext <
10411 #line 10412 "configure"
10411 #line 10423 "configure"
1041210412 #include "confdefs.h"
1041310413
1041410414 #if HAVE_DLFCN_H
2081420814
2081520815 cat >>confdefs.h <<_ACEOF
2081620816 #define LLVM_CONFIGTIME "$LLVM_CONFIGTIME"
20817 _ACEOF
20818
20819
20820 cat >>confdefs.h <<_ACEOF
20821 #define LLVM_HOST_TRIPLE "$host"
2082220817 _ACEOF
2082320818
2082420819