Skip to content
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

Fix redox-os/newlib#78 #51

Merged
merged 2 commits into from Apr 24, 2018
Merged

Fix redox-os/newlib#78 #51

merged 2 commits into from Apr 24, 2018

Conversation

Stephen-Seo
Copy link
Contributor

The previous PKGBUILD fails for me, but successfully builds with this commit.

@Stephen-Seo
Copy link
Contributor Author

Oh boy. Check failed due to Travis-Ci's attempt to solve the halting problem (timeout in 10 minutes trying to check-out git repo). I'm not familiar with Travis-Ci but perhaps there's a way to increase the timeout?

@Stephen-Seo
Copy link
Contributor Author

Stephen-Seo commented Mar 25, 2018

After building the Redox toolchain, it appears that I am having problems compiling Redox (errors on binary operation '>' not supported for type 'u32' and similar). Is it because newlib should be built using redox-os:rust instead of rust-src provided by cargo?

EDIT: I checked to see if the toolchain would be any different if built with the setup.sh script, but it also suffers from the same bug with binary operations not supported by integer types. I'm not quite sure what I'm doing wrong here..

@Stephen-Seo
Copy link
Contributor Author

After jackpot51's suggestion to use the specified nightly version for Redox (nightly-2018-03-04), I tried compiling Redox, fails about a missing bin directory in the installed nightly-2018-03-04 toolchain. Same error trying to compile newlib with the PKGBUILD here. Not quite sure where to go from here.

PKGBUILD works with latest nightly, but not nightly-2018-03-04.

@Stephen-Seo
Copy link
Contributor Author

Stephen-Seo commented Mar 28, 2018

I was able to successfully build Redox on ArchLinux with the toolchain (newlib part) built with this PKGBUILD (toolchain part has to be built with latest nightly).

@barskern
Copy link

Im currently having the same problem, however your solution is still giving me the same error:

cp: cannot stat 'sys/crt0.o': No such file or directory
make[5]: *** [Makefile:1043: crt0.o] Error 1
make[5]: *** Waiting for unfinished jobs....
x86_64-unknown-redox-ar: ../sys/lib.a: No such file or directory

I am using nightly 1.27.0.

Are you able to compile with this version of nightly?

@Stephen-Seo
Copy link
Contributor Author

@barskern
It looks like this problem occurs when attempting to build newlib, and I got the same build error.
Several blocks of log before what you posted, this occured:

   Compiling newlib_redox v0.1.0 (file:///home/stephen/Git/redox-os_libc/packages/arch/newlib/src/newlib/newlib/libc/sys/redox)
error[E0259]: the name `compiler_builtins` is defined multiple times
  --> src/lib.rs:21:1
   |
21 | extern crate compiler_builtins;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `compiler_builtins` reimported here
   |
   = note: `compiler_builtins` must be defined only once in the type namespace of this module
help: You can use `as` to change the binding name of the import
   |
21 | extern crate compiler_builtins as other_compiler_builtins;
   |

I'm currently investigating this issue but it might be that the nightly changed since I last built newlib and caused this error...

@barskern
Copy link

@Stephen-Seo
Yeah that's probably a part of the problem!

I also noticed that there has been written a version of newlib in Rust; relibc. Might the problems be related to the apperant transfer from newlib til relibc?

Do you remember which version of nightly you used when you were able to compile it?

Building newlib failed with latest nightly (1.27.0 as of this commit),
and using previous nightly (1.26.0, or 2018-03-26) works.
@Stephen-Seo
Copy link
Contributor Author

@barskern I got it working on my end, as we suspected it was a nightly version issue. I pushed the change to my fork, try to see if it works for you as well.

@barskern
Copy link

@Stephen-Seo nice work! Thank you for the help, I will try it out when I get home 🏡

@jackpot51
Copy link
Member

This looks good, are you ready for me to merge it?

@Stephen-Seo
Copy link
Contributor Author

@jackpot51 I'd like to be safe and wait for @barskern to check it works on their machine, but you can merge it.

@barskern
Copy link

@Stephen-Seo This works for me :)

@jackpot51 This is probably ready to be merged.

@jackpot51 jackpot51 merged commit 5d21d02 into redox-os:master Apr 24, 2018
@@ -27,7 +24,7 @@ prepare() {
build() {
cd "$srcdir/newlib-build"
$srcdir/newlib/configure --target=$_target --prefix=/usr --enable-newlib-iconv
PATH=$srcdir/xargo/bin:$PATH XARGO_RUST_SRC="$srcdir/rust/src" make all
PATH=$srcdir/xargo/bin:$PATH make -j $(nproc) all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think -j should be included. The convention on Arch seems to be to set this in MAKEFAGS in /etc/makepkg.conf: https://wiki.archlinux.org/index.php/Makepkg#Parallel_compilation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, perhaps the correct make command can be PR'd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, I wasn't aware of this, should I make the PR or would you like to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead and make the PR #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants