-
Notifications
You must be signed in to change notification settings - Fork 13.6k
powerpc support #20980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powerpc support #20980
Changes from 19 commits
31d232e
f512dce
a36a892
0e0af8e
194ed4f
e5bbe82
c8442af
33cd9cf
c055d99
a2e3993
f0d6eee
1649810
d48fa78
e9908da
7a05dc2
8341ee4
7776820
7340936
043a4b3
c513793
4ab2c47
78278d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# powerpc-unknown-linux-gnu configuration | ||
CROSS_PREFIX_powerpc-unknown-linux-gnu=powerpc-linux-gnu- | ||
CC_powerpc-unknown-linux-gnu=$(CC) | ||
CXX_powerpc-unknown-linux-gnu=$(CXX) | ||
CPP_powerpc-unknown-linux-gnu=$(CPP) | ||
AR_powerpc-unknown-linux-gnu=$(AR) | ||
CFG_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).so | ||
CFG_STATIC_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).a | ||
CFG_LIB_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.so | ||
CFG_LIB_DSYM_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.dylib.dSYM | ||
CFG_CFLAGS_powerpc-unknown-linux-gnu := -m32 $(CFLAGS) | ||
CFG_GCCISH_CFLAGS_powerpc-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS) | ||
CFG_GCCISH_CXXFLAGS_powerpc-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) | ||
CFG_GCCISH_LINK_FLAGS_powerpc-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32 | ||
CFG_GCCISH_DEF_FLAG_powerpc-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= | ||
CFG_GCCISH_PRE_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-whole-archive | ||
CFG_GCCISH_POST_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-no-whole-archive | ||
CFG_DEF_SUFFIX_powerpc-unknown-linux-gnu := .linux.def | ||
CFG_LLC_FLAGS_powerpc-unknown-linux-gnu := | ||
CFG_INSTALL_NAME_powerpc-unknown-linux-gnu = | ||
CFG_EXE_SUFFIX_powerpc-unknown-linux-gnu = | ||
CFG_WINDOWSY_powerpc-unknown-linux-gnu := | ||
CFG_UNIXY_powerpc-unknown-linux-gnu := 1 | ||
CFG_PATH_MUNGE_powerpc-unknown-linux-gnu := true | ||
CFG_LDPATH_powerpc-unknown-linux-gnu := | ||
CFG_RUN_powerpc-unknown-linux-gnu=$(2) | ||
CFG_RUN_TARG_powerpc-unknown-linux-gnu=$(call CFG_RUN_powerpc-unknown-linux-gnu,,$(2)) | ||
CFG_GNU_TRIPLE_powerpc-unknown-linux-gnu := powerpc-unknown-linux-gnu |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ fn size_of_basic() { | |
#[cfg(any(target_arch = "x86", | ||
target_arch = "arm", | ||
target_arch = "mips", | ||
target_arch = "mipsel"))] | ||
target_arch = "mipsel", | ||
target_arch = "powerpc"))] | ||
fn size_of_32() { | ||
assert_eq!(size_of::<uint>(), 4u); | ||
assert_eq!(size_of::<*const uint>(), 4u); | ||
|
@@ -55,7 +56,8 @@ fn align_of_basic() { | |
#[cfg(any(target_arch = "x86", | ||
target_arch = "arm", | ||
target_arch = "mips", | ||
target_arch = "mipsel"))] | ||
target_arch = "mipsel", | ||
target_arch = "powerpc"))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, to stem the flow of these additional There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. Ignore that other comment if it got emailed. Willfix. |
||
fn align_of_32() { | ||
assert_eq!(align_of::<uint>(), 4u); | ||
assert_eq!(align_of::<*const uint>(), 4u); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use target::Target; | ||
|
||
pub fn target() -> Target { | ||
let mut base = super::linux_base::opts(); | ||
base.pre_link_args.push("-m32".to_string()); | ||
|
||
Target { | ||
data_layout: "E-S8-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string(), | ||
llvm_target: "powerpc-unknown-linux-gnu".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
arch: "powerpc".to_string(), | ||
target_os: "linux".to_string(), | ||
options: base, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,8 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm) | |
#[cfg(any(target_arch = "arm", | ||
target_arch = "aarch64", | ||
target_arch = "mips", | ||
target_arch = "mipsel"))] | ||
target_arch = "mipsel", | ||
target_arch = "powerpc"))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you rewrite this to |
||
fn get_clobbers() -> String { | ||
"".to_string() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to this I think you'll also want to touch the llvm-auto-clean-trigger to ensure LLVM is rebuilt.