llvm.org GIT mirror llvm / 558aef8
On Linux, uname -m reports the kernel type. Some Linux systems are 32-bit but with a 64-bit kernel, which confuses LLVM. Make LLVM double-check this by checking which defines the system gcc actually sets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83047 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 9 years ago
2 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
283283 AC_MSG_WARN([Configuring LLVM for an unknown target archicture])
284284 fi
285285
286 dnl Handle 32-bit linux systems running a 64-bit kernel.
287 if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then
288 AC_IS_LINUX_MIXED
289 if test "$llvm_cv_linux_mixed" = "yes"; then
290 llvm_cv_target_arch="x86"
291 fi
292 fi
293
286294 # Determine the LLVM native architecture for the target
287295 case "$llvm_cv_target_arch" in
288296 x86) LLVM_NATIVE_ARCH="X86" ;;
0 #
1 # Some Linux machines run a 64-bit kernel with a 32-bit userspace. 'uname -m'
2 # shows these as x86_64. Ask the system 'gcc' what it thinks.
3 #
4 AC_DEFUN([AC_IS_LINUX_MIXED],
5 [AC_CACHE_CHECK(for 32-bit userspace on 64-bit system,llvm_cv_linux_mixed,
6 [ AC_LANG_PUSH([C])
7 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
8 [[#ifndef __x86_64__
9 error: Not x86-64 even if uname says so!
10 #endif
11 ]])],
12 [llvm_cv_linux_mixed=no],
13 [llvm_cv_linux_mixed=yes])
14 AC_LANG_POP([C])
15 ])
16 ])