-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
add support for mips(el)-unknown-linux-musl #31298
Changes from 1 commit
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,24 @@ | ||
# mips-unknown-linux-musl configuration | ||
CC_mips-unknown-linux-musl=mips-openwrt-linux-gcc | ||
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. TODO change the prefixes to something vendor neutral. Probably |
||
CXX_mips-unknown-linux-musl=mips-openwrt-linux-g++ | ||
CPP_mips-unknown-linux-musl=mips-openwrt-linux-gcc -E | ||
AR_mips-unknown-linux-musl=mips-openwrt-linux-ar | ||
CFG_LIB_NAME_mips-unknown-linux-musl=lib$(1).so | ||
CFG_STATIC_LIB_NAME_mips-unknown-linux-musl=lib$(1).a | ||
CFG_LIB_GLOB_mips-unknown-linux-musl=lib$(1)-*.so | ||
CFG_LIB_DSYM_GLOB_mips-unknown-linux-musl=lib$(1)-*.dylib.dSYM | ||
CFG_JEMALLOC_CFLAGS_mips-unknown-linux-musl := -mips32r2 -msoft-float -mabi=32 $(CFLAGS) | ||
CFG_GCCISH_CFLAGS_mips-unknown-linux-musl := -Wall -g -fPIC -mips32r2 -msoft-float -mabi=32 $(CFLAGS) | ||
CFG_GCCISH_CXXFLAGS_mips-unknown-linux-musl := -fno-rtti $(CXXFLAGS) | ||
CFG_GCCISH_LINK_FLAGS_mips-unknown-linux-musl := -shared -fPIC -g -mips32r2 -msoft-float -mabi=32 | ||
CFG_GCCISH_DEF_FLAG_mips-unknown-linux-musl := -Wl,--export-dynamic,--dynamic-list= | ||
CFG_LLC_FLAGS_mips-unknown-linux-musl := | ||
CFG_INSTALL_NAME_mips-unknown-linux-musl = | ||
CFG_EXE_SUFFIX_mips-unknown-linux-musl = | ||
CFG_WINDOWSY_mips-unknown-linux-musl := | ||
CFG_UNIXY_mips-unknown-linux-musl := 1 | ||
CFG_LDPATH_mips-unknown-linux-musl := | ||
CFG_RUN_mips-unknown-linux-musl= | ||
CFG_RUN_TARG_mips-unknown-linux-musl= | ||
RUSTC_FLAGS_mips-unknown-linux-musl := -C target-cpu=mips32r2 -C target-feature="+mips32r2" -C soft-float | ||
CFG_GNU_TRIPLE_mips-unknown-linux-musl := mips-unknown-linux-musl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# mipsel-unknown-linux-musl configuration | ||
CC_mipsel-unknown-linux-musl=mipsel-openwrt-linux-gcc | ||
CXX_mipsel-unknown-linux-musl=mipsel-openwrt-linux-g++ | ||
CPP_mipsel-unknown-linux-musl=mipsel-openwrt-linux-gcc | ||
AR_mipsel-unknown-linux-musl=mipsel-openwrt-linux-ar | ||
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. This should also work with a standard 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. Oh, I see your TODO above |
||
CFG_LIB_NAME_mipsel-unknown-linux-musl=lib$(1).so | ||
CFG_STATIC_LIB_NAME_mipsel-unknown-linux-musl=lib$(1).a | ||
CFG_LIB_GLOB_mipsel-unknown-linux-musl=lib$(1)-*.so | ||
CFG_LIB_DSYM_GLOB_mipsel-unknown-linux-musl=lib$(1)-*.dylib.dSYM | ||
CFG_JEMALLOC_CFLAGS_mipsel-unknown-linux-musl := -mips32 -mabi=32 $(CFLAGS) | ||
CFG_GCCISH_CFLAGS_mipsel-unknown-linux-musl := -Wall -g -fPIC -mips32 -mabi=32 $(CFLAGS) | ||
CFG_GCCISH_CXXFLAGS_mipsel-unknown-linux-musl := -fno-rtti $(CXXFLAGS) | ||
CFG_GCCISH_LINK_FLAGS_mipsel-unknown-linux-musl := -shared -fPIC -g -mips32 | ||
CFG_GCCISH_DEF_FLAG_mipsel-unknown-linux-musl := -Wl,--export-dynamic,--dynamic-list= | ||
CFG_LLC_FLAGS_mipsel-unknown-linux-musl := | ||
CFG_INSTALL_NAME_mipsel-unknown-linux-musl = | ||
CFG_EXE_SUFFIX_mipsel-unknown-linux-musl := | ||
CFG_WINDOWSY_mipsel-unknown-linux-musl := | ||
CFG_UNIXY_mipsel-unknown-linux-musl := 1 | ||
CFG_LDPATH_mipsel-unknown-linux-musl := | ||
CFG_RUN_mipsel-unknown-linux-musl= | ||
CFG_RUN_TARG_mipsel-unknown-linux-musl= | ||
RUSTC_FLAGS_mipsel-unknown-linux-musl := -C target-cpu=mips32 -C target-feature="+mips32" | ||
CFG_GNU_TRIPLE_mipsel-unknown-linux-musl := mipsel-unknown-linux-musl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2014 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 { | ||
Target { | ||
llvm_target: "mips-unknown-linux-musl".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
arch: "mips".to_string(), | ||
target_os: "linux".to_string(), | ||
target_env: "musl".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
options: super::linux_base::opts() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2014 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 { | ||
Target { | ||
llvm_target: "mipsel-unknown-linux-musl".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
arch: "mips".to_string(), | ||
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. Should this be mipsel? 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.
Not sure! The existing AIUI, this arch field is used for 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. Oh interesting! That may be a bug in the target triple, however, depending on how you look at it. Either that or we may just want to make sure that we're consistent. Some data points:
I think that I'd prefer to lean towards leaving this as 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.
👍 from me |
||
target_os: "linux".to_string(), | ||
target_env: "musl".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
|
||
options: super::linux_base::opts() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,11 +93,20 @@ mod arch { | |
use os::raw::{c_long, c_ulong}; | ||
use os::unix::raw::{gid_t, uid_t}; | ||
|
||
#[cfg(target_env = "musl")] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64; | ||
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. I'm not sure what stability level this should have. AFAIK, these types are going to be deprecated in the future. 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. Ah yeah these are fine to stay as-is |
||
#[cfg(not(target_env = "musl"))] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i32; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32; | ||
#[cfg(target_env = "musl")] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64; | ||
#[cfg(not(target_env = "musl"))] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32; | ||
#[cfg(target_env = "musl")] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i32; | ||
#[cfg(not(target_env = "musl"))] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i64; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32; | ||
|
||
#[repr(C)] | ||
|
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.
TODO revert this change