Various fixes for x86_64 on linux

Configure LLVM correctly, use the right data layout, add the readlink
function back, fix C constants, etc.
This commit is contained in:
Brian Anderson 2011-11-15 14:27:55 -08:00 committed by Niko Matsakis
parent 319f3b02f3
commit d2199e8716
5 changed files with 31 additions and 11 deletions

28
configure vendored
View File

@ -339,7 +339,7 @@ if [ -z "$CFG_TARGET_TRIPLES" ]
then
CFG_TARGET_TRIPLES="${CFG_HOST_TRIPLE}"
else
CFG_TARGET_TRIPLES="${CFG_TARGET_TRIPLES/,/ }"
CFG_TARGET_TRIPLES="$(echo $CFG_TARGET_TRIPLES | tr ',' ' ')"
fi
@ -459,12 +459,26 @@ do
LLVM_CXXFLAGS_32="-m32"
LLVM_LDFLAGS_32="-m32"
# FIXME: Need to change flags for x64
LLVM_CXX=$LLVM_CXX_32
LLVM_CC=$LLVM_CC_32
LLVM_CFLAGS=$LLVM_CFLAGS_32
LLVM_CXXFLAGS=$LLVM_CXXFLAGS_32
LLVM_LDFLAGS=$LLVM_LDFLAGS_32
LLVM_CXX_64="g++"
LLVM_CC_64="gcc"
LLVM_CFLAGS_64=""
LLVM_CXXFLAGS_64=""
LLVM_LDFLAGS_64=""
if echo $t | grep x86_64
then
LLVM_CXX=$LLVM_CXX_64
LLVM_CC=$LLVM_CC_64
LLVM_CFLAGS=$LLVM_CFLAGS_64
LLVM_CXXFLAGS=$LLVM_CXXFLAGS_64
LLVM_LDFLAGS=$LLVM_LDFLAGS_64
else
LLVM_CXX=$LLVM_CXX_32
LLVM_CC=$LLVM_CC_32
LLVM_CFLAGS=$LLVM_CFLAGS_32
LLVM_CXXFLAGS=$LLVM_CXXFLAGS_32
LLVM_LDFLAGS=$LLVM_LDFLAGS_32
fi
CXX=$LLVM_CXX
CC=$LLVM_CC

View File

@ -18,11 +18,16 @@ fn get_target_strs(target_os: session::os) -> target_strs::t {
}
session::os_win32. {
"e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32" //NDM i386
// FIXME: Test this. Copied from linux
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
"s0:64:64-f80:128:128-n8:16:32:64-S128"
}
session::os_linux. {
"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" //NDM i386
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
"s0:64:64-f80:128:128-n8:16:32:64-S128"
}
},

View File

@ -50,6 +50,7 @@ native mod libc {
fn unsetenv(n: str::sbuf) -> c_int;
fn pipe(buf: *mutable fd_t) -> c_int;
fn waitpid(pid: pid_t, &status: c_int, options: c_int) -> pid_t;
fn readlink(path: str::sbuf, buf: str::sbuf, bufsize: size_t) -> ssize_t;
}
mod libc_constants {

View File

@ -278,7 +278,7 @@ fn waitpid(pid: pid_t) -> int {
#[cfg(target_os = "linux")]
fn WEXITSTATUS(status: i32) -> i32 {
(status >> 8) & 0xff
(status >> 8i32) & 0xffi32
}
#[cfg(target_os = "macos")]

View File

@ -61,7 +61,7 @@ upcall_call_c_stack_float:
_upcall_call_c_stack_shim:
#else
.globl upcall_call_c_stack_shim
upcall_call_c_stack_shim
upcall_call_c_stack_shim:
#endif
push %rbp
mov %rsp,%rbp // save rsp