-
Notifications
You must be signed in to change notification settings - Fork 13k
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 tested uclibc target #35242
Add tested uclibc target #35242
Changes from all commits
d133519
64a1a13
3b001ee
577a30b
67e7e44
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,29 @@ | ||
# x86_64-unknown-linux-uclibc configuration | ||
CC_x86_64-unknown-linux-uclibc=$(CFG_UCLIBC_ROOT)/bin/uclibc-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. I think CFG_UCLIBC_ROOT is not defined anywhere? 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. Is there a way that I can error the build out if the variable 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. Probably. FWIW, the convention is to set these variables to 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. Ok, I'll fix it. |
||
CXX_x86_64-unknown-linux-uclibc=notaprogram | ||
CPP_x86_64-unknown-linux-uclibc=$(CFG_UCLIBC_ROOT)/bin/uclibc-gcc -E | ||
AR_x86_64-unknown-linux-uclibc=$(AR) | ||
CFG_INSTALL_ONLY_RLIB_x86_64-unknown-linux-uclibc = 1 | ||
CFG_LIB_NAME_x86_64-unknown-linux-uclibc=lib$(1).so | ||
CFG_STATIC_LIB_NAME_x86_64-unknown-linux-uclibc=lib$(1).a | ||
CFG_LIB_GLOB_x86_64-unknown-linux-uclibc=lib$(1)-*.so | ||
CFG_JEMALLOC_CFLAGS_x86_64-unknown-linux-uclibc := -m64 | ||
CFG_GCCISH_CFLAGS_x86_64-unknown-linux-uclibc := -Wall -Werror -g -fPIC -m64 | ||
CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-uclibc := | ||
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-uclibc := | ||
CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-uclibc := | ||
CFG_LLC_FLAGS_x86_64-unknown-linux-uclibc := | ||
CFG_INSTALL_NAME_x86_64-unknown-linux-uclibc = | ||
CFG_EXE_SUFFIX_x86_64-unknown-linux-uclibc = | ||
CFG_WINDOWSY_x86_64-unknown-linux-uclibc := | ||
CFG_UNIXY_x86_64-unknown-linux-uclibc := 1 | ||
CFG_LDPATH_x86_64-unknown-linux-uclibc := | ||
CFG_RUN_x86_64-unknown-linux-uclibc=$(2) | ||
CFG_RUN_TARG_x86_64-unknown-linux-uclibc=$(call CFG_RUN_x86_64-unknown-linux-uclibc,,$(2)) | ||
CFG_GNU_TRIPLE_x86_64-unknown-linux-uclibc := x86_64-unknown-linux-uclibc | ||
#CFG_THIRD_PARTY_OBJECTS_x86_64-unknown-linux-uclibc := crt1.o crti.o crtn.o | ||
CFG_INSTALLED_OBJECTS_x86_64-unknown-linux-uclibc := crt1.o crti.o crtn.o | ||
|
||
#NATIVE_DEPS_libc_T_x86_64-unknown-linux-uclibc += libc.a | ||
NATIVE_DEPS_std_T_x86_64-unknown-linux-uclibc += crt1.o crti.o crtn.o | ||
#NATIVE_DEPS_unwind_T_x86_64-unknown-linux-uclibc += libunwind.a |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::linux_base::opts(); | ||
base.cpu = "x86-64".to_string(); | ||
base.max_atomic_width = 64; | ||
base.pre_link_args.push("-m64".to_string()); | ||
Ok(Target { | ||
llvm_target: "x86_64-unknown-linux-uclibc".to_string(), | ||
data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
arch: "x86_64".to_string(), | ||
target_os: "linux".to_string(), | ||
target_env: "uclibc".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. The 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 believe I will need to add that to the libc crate. |
||
target_vendor: "unknown".to_string(), | ||
options: base, | ||
}) | ||
} |
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.
If we exclusively use rustbuild (which is how I've tested this before), then this file is not needed at all.
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.
So, is your decision to preference using rustbuild only? Because I need support for using rust with buildroot, and I think the way the buildroot feature/rust-v5 branch has it is bootstrapping from the bottom up.
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.
The Makefiles are going to be deprecated at some point (hopefully soon! I'm tired of having to test my PRs on and adapt them to work with two build systems -- it's time consuming), and supporting one build system means less testing on our part.
But if you need it then I'm not going to oppose. By the way, could you point me to this "rust with buildroot" project/repository? It seems that they are building on top of the old Makefile-based build system, but they should move to rustbuild at some point.
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.
I believe it is https://github.com/elebihan/buildroot/tree/feature/rust-v5.
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.
@sanxiyn Thank you. I would have provided it, but I have been having some debilitating internet problems.
I'm working on a fork of that with changes to update the rust buildroot feature branch to be more flexible in allowing uclibc toolchains as well as some documentation on how to configure a rust toolchain for buildroot. It doesn't exactly have a checkbox you know.
@japaric So, I would be delighted to reduce the dependency on make as much as possible, and I totally understand you frustrations around time consumption. I've been writing some buildroot packages for a while, so I wouldn't have a problem altering their setup to build using the cargo build system. There's no way they'll give up using Makefiles; buildroot builds gigabytes worth of software for embedded environments, and there's too much momentum there. But I can't see them objecting to a buildroot package that calls cargo; we'd just be wrapping the rust build script with make, which sounds perfectly fine to me.
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.
Yes, this is what I meant.
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.
How do I run the exact tests you're referring to?
On Aug 4, 2016 3:52 PM, "Jorge Aparicio" [email protected] wrote:
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.
I think I should go inside liblibc, and use the run.sh but I'm sure it may
be different. I think it's in the Travis files.
On Aug 4, 2016 3:52 PM, "Jorge Aparicio" [email protected] wrote: