Hello community, here is the log from the commit of package rust for openSUSE:Factory checked in at 2017-10-25 17:44:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rust (Old) and /work/SRC/openSUSE:Factory/.rust.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rust" Wed Oct 25 17:44:04 2017 rev:18 rq:535331 version:1.21.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rust/rust.changes 2017-09-21 12:36:52.906069207 +0200 +++ /work/SRC/openSUSE:Factory/.rust.new/rust.changes 2017-10-25 17:44:10.932818098 +0200 @@ -1,0 +2,40 @@ +Thu Oct 19 05:46:50 UTC 2017 - [email protected] + +- Large cleanup of both the spec and config.toml to correct many + build issues for the new version + +------------------------------------------------------------------- +Wed Oct 18 03:43:11 UTC 2017 - [email protected] + +- Add rust-1.21.0-44203-exclude-compiler-rt-test.patch +- Add rust-1.21.0-44066-ppc64-struct-abi.patch +- Add rust-1.21.0-44440-s390x-global-align.patch +- Remove add-soname.patch + +------------------------------------------------------------------- +Tue Oct 17 22:53:28 UTC 2017 - [email protected] + +- Update to 1.21.0 +- Language changes: + + You can now use static references for literals. + + Relaxed path syntax. Optional `::` before `<` is now allowed in all contexts. +- Compiler changes: + + Upgraded jemalloc to 4.5.0[43911] + + Enabled unwinding panics on Redox[43917] + + Now runs LLVM in parallel during translation phase.[43506] +- Librarie changes: + + Generate builtin impls for `Clone` for all arrays and tuples that + are `T: Clone`[43690] + +`Stdin`, `Stdout`, and `Stderr` now implement `AsRawFd`.[43459] + + `Rc` and `Arc` now implement `From<&[T]> where T: Clone`, `From<str>`, + `From<String>`, `From<Box<T>> where T: ?Sized`, and `From<Vec<T>>`.[42565] +- Stabilized APIs + +`std::mem::discriminant` +- Update add-soname.patch to apply cleanly + +------------------------------------------------------------------- +Sat Sep 23 00:29:39 UTC 2017 - [email protected] + +- Force enable rust bootstrap so that missing architectures build + +------------------------------------------------------------------- Old: ---- add-soname.patch cargo-0.21.0-aarch64-unknown-linux-gnu.tar.gz cargo-0.21.0-armv7-unknown-linux-gnueabihf.tar.gz cargo-0.21.0-i686-unknown-linux-gnu.tar.gz cargo-0.21.0-powerpc64-unknown-linux-gnu.tar.gz cargo-0.21.0-powerpc64le-unknown-linux-gnu.tar.gz cargo-0.21.0-s390x-unknown-linux-gnu.tar.gz cargo-0.21.0-x86_64-unknown-linux-gnu.tar.gz rustc-1.20.0-src.tar.gz New: ---- cargo-0.22.0-aarch64-unknown-linux-gnu.tar.gz cargo-0.22.0-armv7-unknown-linux-gnueabihf.tar.gz cargo-0.22.0-i686-unknown-linux-gnu.tar.gz cargo-0.22.0-powerpc64-unknown-linux-gnu.tar.gz cargo-0.22.0-powerpc64le-unknown-linux-gnu.tar.gz cargo-0.22.0-s390x-unknown-linux-gnu.tar.gz cargo-0.22.0-x86_64-unknown-linux-gnu.tar.gz rust-1.21.0-44066-ppc64-struct-abi.patch rust-1.21.0-44203-exclude-compiler-rt-test.patch rust-1.21.0-44440-s390x-global-align.patch rustc-1.21.0-src.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rust.spec ++++++ --- /var/tmp/diff_new_pack.oqvr0H/_old 2017-10-25 17:44:20.872351608 +0200 +++ /var/tmp/diff_new_pack.oqvr0H/_new 2017-10-25 17:44:20.872351608 +0200 @@ -17,8 +17,9 @@ # -%global prev_rust 1.19.0 -%global cargo_version 0.21.0 +%global prev_rust 1.20.0 +%global cargo_version 0.22.0 +%bcond_with rust_bootstrap %global rust_arch %{_arch} %global abi gnu @@ -32,14 +33,18 @@ %ifarch ppc64le %global rust_arch powerpc64le %endif +# Must restrict the x86 build to i686 since i586 is currently unsupported +%ifarch %ix86 +%global rust_arch i686 +%endif %global rust_triple %{rust_arch}-unknown-linux-%{abi} %global dl_url https://static.rust-lang.org/dist %global common_libdir %{_prefix}/lib %global rustlibdir %{common_libdir}/rustlib -%bcond_with bootstrap + Name: rust -Version: 1.20.0 +Version: 1.21.0 Release: 0 Summary: A systems programming language License: MIT or Apache-2.0 @@ -56,9 +61,10 @@ Source105: cargo-%{cargo_version}-powerpc64le-unknown-linux-gnu.tar.gz Source106: cargo-%{cargo_version}-s390x-unknown-linux-gnu.tar.gz # PATCH-FIX-OPENSUSE: Set DT_SONAME when building dylibs -Patch1: add-soname.patch +Patch1: rust-1.21.0-44203-exclude-compiler-rt-test.patch +Patch2: rust-1.21.0-44066-ppc64-struct-abi.patch +Patch3: rust-1.21.0-44440-s390x-global-align.patch BuildRequires: ccache -BuildRequires: chrpath BuildRequires: cmake >= 3.4.3 BuildRequires: curl BuildRequires: gcc-c++ @@ -70,7 +76,6 @@ Recommends: %{name}-doc Recommends: %{name}-std -Provides: rust = %{version} Conflicts: otherproviders(rust) Conflicts: rustc-bootstrap @@ -78,18 +83,19 @@ # Restrict the architectures as building rust relies on being initially # bootstrapped before we can build the n+1 release ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x +%ifarch %ix86 +ExclusiveArch: i586 i686 +BuildArch: i686 +%endif %if 0%{?suse_version} BuildRequires: fdupes %endif -# There are no successful builds for less than TW or Leap 42.2, so bootstrap -# until such time that there is. -%if %{with rust_bootstrap} || (0%{?suse_version} < 1330 && 0%{?sle_version} <= 120100) +%if %{with rust_bootstrap} BuildRequires: rust-std-bootstrap = %{prev_rust} BuildRequires: rustc-bootstrap = %{prev_rust} %else -# if there is a package choice, use prefer version in prjconfig BuildRequires: rust <= %{version} BuildRequires: rust >= %{prev_rust} BuildRequires: rust-std <= %{version} @@ -173,18 +179,16 @@ %endif # The cargo binary is only used to build rust and is not shipped -# Using i686 for i586 seems to be okay for now but may cause issues in future -%ifarch %ix86 -%global cargo_bin %{_builddir}/cargo-%{cargo_version}-i686-unknown-linux-%{abi}/cargo/bin/cargo -%else %global cargo_bin %{_builddir}/cargo-%{cargo_version}-%{rust_triple}/cargo/bin/cargo -%endif %setup -q -n rustc-%{version}-src %patch1 -p1 +%patch2 -p1 +%patch3 -p1 sed -e 's:<cargo-bin>:%{cargo_bin}:g' \ -e 's:<rust-triple>:%{rust_triple}:g' \ -e 's:<prefix>:%{_prefix}:g' \ + -e 's:<bindir>:%{_prefix}/bin:g' \ -e 's:<libdir>:%{common_libdir}:g' \ -e 's:<mandir>:%{_mandir}:g' \ -e 's:<docdir>:%{_docdir}/%{name}:g' \ @@ -196,41 +200,39 @@ ./x.py doc --config config.toml %install -sed -e 's:<cargo-bin>:%{cargo_bin}:g' \ - -e 's:<rust-triple>:%{rust_triple}:g' \ - -e 's:<prefix>:%{buildroot}%{_prefix}:g' \ - -e 's:<libdir>:%{buildroot}%{common_libdir}:g' \ - -e 's:<mandir>:%{buildroot}%{_mandir}:g' \ - -e 's:<docdir>:%{buildroot}%{_docdir}/%{name}:g' \ - %{SOURCE1} > config.toml -./x.py install -./x.py install src -# Fix any rpaths if needed -chrpath -d %{buildroot}%{_prefix}/lib/lib*.so +DESTDIR=%{buildroot} ./x.py install +DESTDIR=%{buildroot} ./x.py install src # Remove executable permission from HTML documentation # to prevent RPMLINT errors. chmod -R -x+X %{buildroot}%{_docdir}/%{name}/html +# Remove lockfile to avoid errors. +rm %{buildroot}%{_docdir}/%{name}/html/.lock + +# Sanitize the HTML documentation +find %{buildroot}%{_docdir}/%{name}/html -empty -delete +find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' + # Remove surplus files rm %{buildroot}%{rustlibdir}/components rm %{buildroot}%{rustlibdir}/manifest-rust* rm %{buildroot}%{rustlibdir}/install.log rm %{buildroot}%{rustlibdir}/uninstall.sh rm %{buildroot}%{rustlibdir}/rust-installer-version -# Remove lockfile to avoid errors. -rm %{buildroot}%{_docdir}/%{name}/html/.lock -# The remaining shared libraries should be executable for debuginfo extraction. -find %{buildroot}/%{_prefix}/lib/ -type f -name '*.so' -exec chmod -v +x '{}' '+' +# Remove installer artifacts (manifests, uninstall scripts, etc.) +find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' + +# The shared libraries should be executable for debuginfo extraction. +find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -name '*.so' -exec chmod -v +x '{}' '+' # extract bundled licenses for packaging - From fedora spec cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown -sed -e '/*\//q' src/libbacktrace/backtrace.h \ - >src/libbacktrace/LICENSE-libbacktrace +sed -e '/*\//q' src/libbacktrace/backtrace.h > src/libbacktrace/LICENSE-libbacktrace -# Remvove the license files from _docdir: make install put duplicates there -rm %{buildroot}%{_defaultdocdir}/%{name}/{COPYRIGHT,LICENSE-APACHE,LICENSE-MIT} +# Remove the license files from _docdir: make install put duplicates there +rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MIT} %if 0%{?suse_version} %fdupes %{buildroot}%{_prefix} @@ -241,9 +243,15 @@ %files %defattr(-,root,root,-) +%if 0%{?suse_version} == 1315 +%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT +%doc src/libbacktrace/LICENSE-libbacktrace +%doc src/rt/hoedown/LICENSE-hoedown +%else %license COPYRIGHT LICENSE-APACHE LICENSE-MIT %license src/libbacktrace/LICENSE-libbacktrace %license src/rt/hoedown/LICENSE-hoedown +%endif %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc ++++++ cargo-0.21.0-aarch64-unknown-linux-gnu.tar.gz -> cargo-0.22.0-aarch64-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-aarch64-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-aarch64-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-aarch64-unknown-linux-gnu/LICENSE-MIT 2017-08-27 22:01:02.000000000 +0200 +++ new/cargo-0.22.0-aarch64-unknown-linux-gnu/LICENSE-MIT 2017-10-10 00:11:08.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-aarch64-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-aarch64-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-aarch64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-aarch64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-aarch64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 22:01:02.000000000 +0200 +++ new/cargo-0.22.0-aarch64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-10 00:11:08.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-aarch64-unknown-linux-gnu/version new/cargo-0.22.0-aarch64-unknown-linux-gnu/version --- old/cargo-0.21.0-aarch64-unknown-linux-gnu/version 2017-08-27 22:01:02.000000000 +0200 +++ new/cargo-0.22.0-aarch64-unknown-linux-gnu/version 2017-10-10 00:11:08.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-armv7-unknown-linux-gnueabihf.tar.gz -> cargo-0.22.0-armv7-unknown-linux-gnueabihf.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/LICENSE-MIT new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/LICENSE-MIT --- old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/LICENSE-MIT 2017-08-27 22:07:53.000000000 +0200 +++ new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/LICENSE-MIT 2017-10-09 23:41:13.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/cargo/bin/cargo and new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 22:07:53.000000000 +0200 +++ new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/cargo/share/doc/cargo/LICENSE-MIT 2017-10-09 23:41:13.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/version new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/version --- old/cargo-0.21.0-armv7-unknown-linux-gnueabihf/version 2017-08-27 22:07:53.000000000 +0200 +++ new/cargo-0.22.0-armv7-unknown-linux-gnueabihf/version 2017-10-09 23:41:13.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-i686-unknown-linux-gnu.tar.gz -> cargo-0.22.0-i686-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-i686-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-i686-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-i686-unknown-linux-gnu/LICENSE-MIT 2017-08-27 21:43:59.000000000 +0200 +++ new/cargo-0.22.0-i686-unknown-linux-gnu/LICENSE-MIT 2017-10-10 00:04:10.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-i686-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-i686-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-i686-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-i686-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-i686-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 21:43:59.000000000 +0200 +++ new/cargo-0.22.0-i686-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-10 00:04:10.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-i686-unknown-linux-gnu/version new/cargo-0.22.0-i686-unknown-linux-gnu/version --- old/cargo-0.21.0-i686-unknown-linux-gnu/version 2017-08-27 21:43:59.000000000 +0200 +++ new/cargo-0.22.0-i686-unknown-linux-gnu/version 2017-10-10 00:04:10.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-powerpc64-unknown-linux-gnu.tar.gz -> cargo-0.22.0-powerpc64-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-powerpc64-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-powerpc64-unknown-linux-gnu/LICENSE-MIT 2017-08-27 22:03:38.000000000 +0200 +++ new/cargo-0.22.0-powerpc64-unknown-linux-gnu/LICENSE-MIT 2017-10-10 00:15:22.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-powerpc64-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-powerpc64-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-powerpc64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-powerpc64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 22:03:38.000000000 +0200 +++ new/cargo-0.22.0-powerpc64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-10 00:15:22.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64-unknown-linux-gnu/version new/cargo-0.22.0-powerpc64-unknown-linux-gnu/version --- old/cargo-0.21.0-powerpc64-unknown-linux-gnu/version 2017-08-27 22:03:38.000000000 +0200 +++ new/cargo-0.22.0-powerpc64-unknown-linux-gnu/version 2017-10-10 00:15:22.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-powerpc64le-unknown-linux-gnu.tar.gz -> cargo-0.22.0-powerpc64le-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/LICENSE-MIT 2017-08-27 21:48:58.000000000 +0200 +++ new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/LICENSE-MIT 2017-10-09 23:53:47.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 21:48:58.000000000 +0200 +++ new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-09 23:53:47.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/version new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/version --- old/cargo-0.21.0-powerpc64le-unknown-linux-gnu/version 2017-08-27 21:48:58.000000000 +0200 +++ new/cargo-0.22.0-powerpc64le-unknown-linux-gnu/version 2017-10-09 23:53:47.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-s390x-unknown-linux-gnu.tar.gz -> cargo-0.22.0-s390x-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-s390x-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-s390x-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-s390x-unknown-linux-gnu/LICENSE-MIT 2017-08-27 22:00:26.000000000 +0200 +++ new/cargo-0.22.0-s390x-unknown-linux-gnu/LICENSE-MIT 2017-10-09 23:49:45.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-s390x-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-s390x-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-s390x-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-s390x-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-s390x-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 22:00:26.000000000 +0200 +++ new/cargo-0.22.0-s390x-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-09 23:49:45.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-s390x-unknown-linux-gnu/version new/cargo-0.22.0-s390x-unknown-linux-gnu/version --- old/cargo-0.21.0-s390x-unknown-linux-gnu/version 2017-08-27 22:00:26.000000000 +0200 +++ new/cargo-0.22.0-s390x-unknown-linux-gnu/version 2017-10-09 23:49:45.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ cargo-0.21.0-x86_64-unknown-linux-gnu.tar.gz -> cargo-0.22.0-x86_64-unknown-linux-gnu.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-x86_64-unknown-linux-gnu/LICENSE-MIT new/cargo-0.22.0-x86_64-unknown-linux-gnu/LICENSE-MIT --- old/cargo-0.21.0-x86_64-unknown-linux-gnu/LICENSE-MIT 2017-08-27 21:25:26.000000000 +0200 +++ new/cargo-0.22.0-x86_64-unknown-linux-gnu/LICENSE-MIT 2017-10-09 23:09:06.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Binary files old/cargo-0.21.0-x86_64-unknown-linux-gnu/cargo/bin/cargo and new/cargo-0.22.0-x86_64-unknown-linux-gnu/cargo/bin/cargo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT new/cargo-0.22.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT --- old/cargo-0.21.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-08-27 21:25:26.000000000 +0200 +++ new/cargo-0.22.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo/LICENSE-MIT 2017-10-09 23:09:06.000000000 +0200 @@ -1,5 +1,3 @@ -Copyright (c) 2014 The Rust Project Developers - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cargo-0.21.0-x86_64-unknown-linux-gnu/version new/cargo-0.22.0-x86_64-unknown-linux-gnu/version --- old/cargo-0.21.0-x86_64-unknown-linux-gnu/version 2017-08-27 21:25:26.000000000 +0200 +++ new/cargo-0.22.0-x86_64-unknown-linux-gnu/version 2017-10-09 23:09:06.000000000 +0200 @@ -1 +1 @@ -0.21.0 (5b4b8b2ae 2017-08-12) \ No newline at end of file +0.22.0 (3423351a5 2017-10-06) \ No newline at end of file ++++++ config.toml ++++++ --- /var/tmp/diff_new_pack.oqvr0H/_old 2017-10-25 17:44:23.244240289 +0200 +++ /var/tmp/diff_new_pack.oqvr0H/_new 2017-10-25 17:44:23.244240289 +0200 @@ -1,16 +1,69 @@ +# default options are commented out # ============================================================================= # Tweaking how LLVM is compiled # ============================================================================= [llvm] -optimize = true -release-debuginfo = false + +# Indicates whether rustc will support compilation with LLVM +# note: rustc does not compile without LLVM at the moment +#enabled = true + +# Indicates whether the LLVM build is a Release or Debug build +#optimize = true + +# Indicates whether an LLVM Release build should include debug info +#release-debuginfo = false + +# Indicates whether the LLVM assertions are enabled or not #assertions = false + +# Indicates whether ccache is used when building LLVM ccache = true + +# If an external LLVM root is specified, we automatically check the version by +# default to make sure it's within the range that we're expecting, but setting +# this flag will indicate that this version check should not be done. #version-check = false -static-libstdcpp = false + +# Link libstdc++ statically into the librustc_llvm instead of relying on a +# dynamic version to be available. +#static-libstdcpp = false + +# Tell the LLVM build system to use Ninja instead of the platform default for +# the generated build system. This can sometimes be faster than make, for +# example. ninja = true -targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX" +# LLVM targets to build support for. +# Note: this is NOT related to Rust compilation targets. However, as Rust is +# dependent on LLVM for code generation, turning targets off here WILL lead to +# the resulting rustc being unable to compile for the disabled architectures. +# Also worth pointing out is that, in case support for new targets are added to +# LLVM, enabling them here doesn't mean Rust is automatically gaining said +# support. You'll need to write a target specification at least, and most +# likely, teach rustc about the C ABI of the target. Get in touch with the +# Rust team and file an issue if you need assistance in porting! +#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon" + +# LLVM experimental targets to build support for. These targets are specified in +# the same format as above, but since these targets are experimental, they are +# not built by default and the experimental Rust compilation targets that depend +# on them will not work unless the user opts in to building them. Possible +# experimental LLVM targets include WebAssembly for the +# wasm32-experimental-emscripten Rust target. +#experimental-targets = "" + +# Cap the number of parallel linker invocations when compiling LLVM. +# This can be useful when building LLVM with debug info, which significantly +# increases the size of binaries and consequently the memory required by +# each linker process. +# If absent or 0, linker invocations are treated like any other job and +# controlled by rustbuild's -j parameter. +#link-jobs = 0 + +# When invoking `llvm-config` this configures whether the `--shared` argument is +# passed to prefer linking to shared libraries. +#link-shared = false # ============================================================================= # General build configuration options @@ -23,33 +76,85 @@ cargo = "<cargo-bin>" rustc = "/usr/bin/rustc" -docs = true -compiler-docs = false +# Flag to specify whether any documentation is built. If false, rustdoc and +# friends will still be compiled but they will not be used to generate any +# documentation. +#docs = true + +# Indicate whether the compiler should be documented in addition to the standard +# library and facade crates. +#compiler-docs = false # Indicate whether submodules are managed and updated automatically. -submodules = false +#submodules = true + +# The path to (or name of) the GDB executable to use. This is only used for +# executing the debuginfo test suite. #gdb = "gdb" + +# The node.js executable to use. Note that this is only used for the emscripten +# target when running tests, otherwise this can be omitted. #nodejs = "node" + +# Python interpreter to use for various tasks throughout the build, notably +# rustdoc tests, the lldb python interpreter, and some dist bits and pieces. +# Note that Python 2 is currently required. #python = "python2.7" -vendor = true +# Force Cargo to check that Cargo.lock describes the precise dependency +# set that all the Cargo.toml files create, instead of updating it. +#locked-deps = false -full-bootstrap = false +# Indicate whether the vendored sources are used for Rust dependencies or not +vendor = true -# Enable a build of the and extended rust tool set which is not only the -# compiler but also tools such as Cargo. This will also produce "combined -# installers" which are used to install Rust and Cargo together. This is -# disabled by default. -extended = false +# Typically the build system will build the rust compiler twice. The second +# compiler, however, will simply use its own libraries to link against. If you +# would rather to perform a full bootstrap, compiling the compiler three times, +# then you can set this option to true. You shouldn't ever need to set this +# option to true. +full-bootstrap = true + +# Enable a build of the extended rust tool set which is not only the compiler +# but also tools such as Cargo. This will also produce "combined installers" +# which are used to install Rust and Cargo together. This is disabled by +# default. +#extended = false # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose -verbose = 2 +verbose = 0 + +# Build the sanitizer runtimes +#sanitizers = false + +# Build the profiler runtime +#profiler = false + +# Indicates whether the OpenSSL linked into Cargo will be statically linked or +# not. If static linkage is specified then the build system will download a +# known-good version of OpenSSL, compile it, and link it to Cargo. +#openssl-static = false + +# Run the build with low priority, by setting the process group's "nice" value +# to +10 on Unix platforms, and by using a "low priority" job object on Windows. +#low-priority = false + +# Arguments passed to the `./configure` script, used during distcheck. You +# probably won't fill this in but rather it's filled in by the `./configure` +# script. +#configure-args = [] + +# Indicates that a local rebuild is occurring instead of a full bootstrap, +# essentially skipping stage0 as the local compiler is recompiling itself again. +#local-rebuild = false # ============================================================================= # General install configuration options # ============================================================================= [install] prefix = "<prefix>" +sysconfdir = "/etc" +bindir = "<bindir>" libdir = "<libdir>" mandir = "<mandir>" docdir = "<docdir>" @@ -58,24 +163,84 @@ # Options for compiling Rust code itself # ============================================================================= [rust] -optimize = true -codegen-units = 0 # 0 = core-count +# Indicates that the build should be optimized for debugging Rust. Note that +# this is typically not what you want as it takes an incredibly large amount of +# time to have a debug-mode rustc compile any code (notably libstd). If this +# value is set to `true` it will affect a number of configuration options below +# as well, if unconfigured. +#debug = false + +# Whether or not to optimize the compiler and standard library +# Note: the slowness of the non optimized compiler compiling itself usually +# outweighs the time gains in not doing optimizations, therefore a +# full bootstrap takes much more time with optimize set to false. +#optimize = true + +# Number of codegen units to use for each compiler invocation. A value of 0 +# means "the number of cores on this machine", and 1+ is passed through to the +# compiler. +codegen-units = 0 + +# Whether or not debug assertions are enabled for the compiler and standard +# library. Also enables compilation of debug! and trace! logging macros. +#debug-assertions = false -debug-assertions = false +# Whether or not debuginfo is emitted debuginfo = true -debuginfo-lines = false -debuginfo-only-std = false +# Whether or not line number debug information is emitted +#debuginfo-lines = false + +# Whether or not to only build debuginfo for the standard library if enabled. +# If enabled, this will not compile the compiler with debuginfo, just the +# standard library. +#debuginfo-only-std = false + +# Whether or not jemalloc is built and enabled use-jemalloc = false debug-jemalloc = false -backtrace = true +# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE) +#backtrace = true + +# The default linker that will be hard-coded into the generated compiler for +# targets that don't specify linker explicitly in their target specifications. +# Note that this is not the linker used to link said compiler. #default-linker = "cc" -#default-ar = "ar" +# The "channel" for the Rust build to produce. The stable/beta channels only +# allow using stable features, whereas the nightly and dev channels allow using +# nightly features channel = "stable" +# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix +# platforms to ensure that the compiler is usable by default from the build +# directory (as it links to a number of dynamic libraries). This may not be +# desired in distributions, for example. rpath = false -optimize-tests = true -debuginfo-tests = true + +# Suppresses extraneous output from tests to ensure the output of the test +# harness is relatively clean. +#quiet-tests = false + +# Flag indicating whether tests are compiled with optimizations (the -O flag) or +# with debuginfo (the -g flag) +#optimize-tests = true +#debuginfo-tests = true + +# Flag indicating whether codegen tests will be run or not. If you get an error +# saying that the FileCheck executable is missing, you may want to disable this. codegen-tests = false + +# Flag indicating whether git info will be retrieved from .git automatically. +# Having the git information can cause a lot of rebuilds during development. +# Note: If this attribute is not explicity set (e.g. if left commented out) it +# will default to true if channel = "dev", but will default to false otherwise. +#ignore-git = true + +# When creating source tarballs whether or not to create a source tarball. +#dist-src = false + +# Whether to also run the Miri tests suite when running tests. +# As a side-effect also generates MIR for all libraries. +#test-miri = false ++++++ rust-1.21.0-44066-ppc64-struct-abi.patch ++++++ >From bc3a71ed00af01855b0ae8908ae271b83eca34f6 Mon Sep 17 00:00:00 2001 From: bors <[email protected]> Date: Sat, 2 Sep 2017 19:46:51 +0000 Subject: [PATCH] Auto merge of #44066 - cuviper:powerpc64-extern-abi, r=alexcrichton powerpc64: improve extern struct ABI These fixes all have to do with the 64-bit PowerPC ELF ABI for big-endian targets. The ELF v2 ABI for powerpc64le already worked well. - Return after marking return aggregates indirect. Fixes #42757. - Pass one-member float aggregates as direct argument values. - Aggregate arguments less than 64-bit must be written in the least- significant bits of the parameter space. - Larger aggregates are instead padded at the tail. (i.e. filling MSBs, padding the remaining LSBs.) New tests were also added for the single-float aggregate, and a 3-byte aggregate to check that it's filled into LSBs. Overall, at least these formerly-failing tests now pass on powerpc64: - run-make/extern-fn-struct-passing-abi - run-make/extern-fn-with-packed-struct - run-pass/extern-pass-TwoU16s.rs - run-pass/extern-pass-TwoU8s.rs - run-pass/struct-return.rs --- src/librustc_trans/cabi_powerpc64.rs | 64 +++++++++++++++++----- src/librustc_trans/cabi_x86.rs | 41 ++++++++++++-- .../run-make/extern-fn-struct-passing-abi/test.c | 32 ++++++++++- .../run-make/extern-fn-struct-passing-abi/test.rs | 27 +++++++++ .../run-make/extern-fn-with-packed-struct/test.c | 5 ++ .../run-make/extern-fn-with-packed-struct/test.rs | 26 +-------- 6 files changed, 151 insertions(+), 44 deletions(-) diff --git a/src/librustc_trans/cabi_powerpc64.rs b/src/librustc_trans/cabi_powerpc64.rs index 5c695387236f..fb5472eb6ae1 100644 --- a/src/librustc_trans/cabi_powerpc64.rs +++ b/src/librustc_trans/cabi_powerpc64.rs @@ -14,14 +14,26 @@ use abi::{FnType, ArgType, LayoutExt, Reg, RegKind, Uniform}; use context::CrateContext; +use rustc::ty::layout; -fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) +#[derive(Debug, Clone, Copy, PartialEq)] +enum ABI { + ELFv1, // original ABI used for powerpc64 (big-endian) + ELFv2, // newer ABI used for powerpc64le +} +use self::ABI::*; + +fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, + arg: &mut ArgType<'tcx>, + abi: ABI) -> Option<Uniform> { arg.layout.homogeneous_aggregate(ccx).and_then(|unit| { let size = arg.layout.size(ccx); - // Ensure we have at most eight uniquely addressable members. - if size > unit.size.checked_mul(8, ccx).unwrap() { + // ELFv1 only passes one-member aggregates transparently. + // ELFv2 passes up to eight uniquely addressable members. + if (abi == ELFv1 && size > unit.size) + || size > unit.size.checked_mul(8, ccx).unwrap() { return None; } @@ -42,21 +54,23 @@ fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut Ar }) } -fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) { +fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>, abi: ABI) { if !ret.layout.is_aggregate() { ret.extend_integer_width_to(64); return; } - // The PowerPC64 big endian ABI doesn't return aggregates in registers - if ccx.sess().target.target.target_endian == "big" { + // The ELFv1 ABI doesn't return aggregates in registers + if abi == ELFv1 { ret.make_indirect(ccx); + return; } - if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) { + if let Some(uniform) = is_homogeneous_aggregate(ccx, ret, abi) { ret.cast_to(ccx, uniform); return; } + let size = ret.layout.size(ccx); let bits = size.bits(); if bits <= 128 { @@ -80,31 +94,55 @@ fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tc ret.make_indirect(ccx); } -fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) { +fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>, abi: ABI) { if !arg.layout.is_aggregate() { arg.extend_integer_width_to(64); return; } - if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) { + if let Some(uniform) = is_homogeneous_aggregate(ccx, arg, abi) { arg.cast_to(ccx, uniform); return; } - let total = arg.layout.size(ccx); + let size = arg.layout.size(ccx); + let (unit, total) = match abi { + ELFv1 => { + // In ELFv1, aggregates smaller than a doubleword should appear in + // the least-significant bits of the parameter doubleword. The rest + // should be padded at their tail to fill out multiple doublewords. + if size.bits() <= 64 { + (Reg { kind: RegKind::Integer, size }, size) + } else { + let align = layout::Align::from_bits(64, 64).unwrap(); + (Reg::i64(), size.abi_align(align)) + } + }, + ELFv2 => { + // In ELFv2, we can just cast directly. + (Reg::i64(), size) + }, + }; + arg.cast_to(ccx, Uniform { - unit: Reg::i64(), + unit, total }); } pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>) { + let abi = match ccx.sess().target.target.target_endian.as_str() { + "big" => ELFv1, + "little" => ELFv2, + _ => unimplemented!(), + }; + if !fty.ret.is_ignore() { - classify_ret_ty(ccx, &mut fty.ret); + classify_ret_ty(ccx, &mut fty.ret, abi); } for arg in &mut fty.args { if arg.is_ignore() { continue; } - classify_arg_ty(ccx, arg); + classify_arg_ty(ccx, arg, abi); } } diff --git a/src/librustc_trans/cabi_x86.rs b/src/librustc_trans/cabi_x86.rs index 8b024b8c97fa..49634d6e78ce 100644 --- a/src/librustc_trans/cabi_x86.rs +++ b/src/librustc_trans/cabi_x86.rs @@ -11,12 +11,30 @@ use abi::{ArgAttribute, FnType, LayoutExt, Reg, RegKind}; use common::CrateContext; +use rustc::ty::layout::{self, Layout, TyLayout}; + #[derive(PartialEq)] pub enum Flavor { General, Fastcall } +fn is_single_fp_element<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, + layout: TyLayout<'tcx>) -> bool { + match *layout { + Layout::Scalar { value: layout::F32, .. } | + Layout::Scalar { value: layout::F64, .. } => true, + Layout::Univariant { .. } => { + if layout.field_count() == 1 { + is_single_fp_element(ccx, layout.field(ccx, 0)) + } else { + false + } + } + _ => false + } +} + pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>, flavor: Flavor) { @@ -33,12 +51,23 @@ pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, if t.options.is_like_osx || t.options.is_like_windows || t.options.is_like_openbsd { let size = fty.ret.layout.size(ccx); - match size.bytes() { - 1 => fty.ret.cast_to(ccx, Reg::i8()), - 2 => fty.ret.cast_to(ccx, Reg::i16()), - 4 => fty.ret.cast_to(ccx, Reg::i32()), - 8 => fty.ret.cast_to(ccx, Reg::i64()), - _ => fty.ret.make_indirect(ccx) + + // According to Clang, everyone but MSVC returns single-element + // float aggregates directly in a floating-point register. + if !t.options.is_like_msvc && is_single_fp_element(ccx, fty.ret.layout) { + match size.bytes() { + 4 => fty.ret.cast_to(ccx, Reg::f32()), + 8 => fty.ret.cast_to(ccx, Reg::f64()), + _ => fty.ret.make_indirect(ccx) + } + } else { + match size.bytes() { + 1 => fty.ret.cast_to(ccx, Reg::i8()), + 2 => fty.ret.cast_to(ccx, Reg::i16()), + 4 => fty.ret.cast_to(ccx, Reg::i32()), + 8 => fty.ret.cast_to(ccx, Reg::i64()), + _ => fty.ret.make_indirect(ccx) + } } } else { fty.ret.make_indirect(ccx); diff --git a/src/test/run-make/extern-fn-struct-passing-abi/test.c b/src/test/run-make/extern-fn-struct-passing-abi/test.c index 44a940a17a98..25cd6da10b8f 100644 --- a/src/test/run-make/extern-fn-struct-passing-abi/test.c +++ b/src/test/run-make/extern-fn-struct-passing-abi/test.c @@ -43,6 +43,16 @@ struct FloatPoint { double y; }; +struct FloatOne { + double x; +}; + +struct IntOdd { + int8_t a; + int8_t b; + int8_t c; +}; + // System V x86_64 ABI: // a, b, c, d, e should be in registers // s should be byval pointer @@ -283,7 +293,7 @@ struct Huge huge_struct(struct Huge s) { // p should be in registers // return should be in registers // -// Win64 ABI: +// Win64 ABI and 64-bit PowerPC ELFv1 ABI: // p should be a byval pointer // return should be in a hidden sret pointer struct FloatPoint float_point(struct FloatPoint p) { @@ -292,3 +302,23 @@ struct FloatPoint float_point(struct FloatPoint p) { return p; } + +// 64-bit PowerPC ELFv1 ABI: +// f1 should be in a register +// return should be in a hidden sret pointer +struct FloatOne float_one(struct FloatOne f1) { + assert(f1.x == 7.); + + return f1; +} + +// 64-bit PowerPC ELFv1 ABI: +// i should be in the least-significant bits of a register +// return should be in a hidden sret pointer +struct IntOdd int_odd(struct IntOdd i) { + assert(i.a == 1); + assert(i.b == 2); + assert(i.c == 3); + + return i; +} diff --git a/src/test/run-make/extern-fn-struct-passing-abi/test.rs b/src/test/run-make/extern-fn-struct-passing-abi/test.rs index aaae7ae4fb49..54a4f868eb4e 100644 --- a/src/test/run-make/extern-fn-struct-passing-abi/test.rs +++ b/src/test/run-make/extern-fn-struct-passing-abi/test.rs @@ -53,6 +53,20 @@ struct FloatPoint { y: f64 } +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(C)] +struct FloatOne { + x: f64, +} + +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(C)] +struct IntOdd { + a: i8, + b: i8, + c: i8, +} + #[link(name = "test", kind = "static")] extern { fn byval_rect(a: i32, b: i32, c: i32, d: i32, e: i32, s: Rect); @@ -83,6 +97,10 @@ extern { fn huge_struct(s: Huge) -> Huge; fn float_point(p: FloatPoint) -> FloatPoint; + + fn float_one(f: FloatOne) -> FloatOne; + + fn int_odd(i: IntOdd) -> IntOdd; } fn main() { @@ -91,6 +109,8 @@ fn main() { let u = FloatRect { a: 3489, b: 3490, c: 8. }; let v = Huge { a: 5647, b: 5648, c: 5649, d: 5650, e: 5651 }; let p = FloatPoint { x: 5., y: -3. }; + let f1 = FloatOne { x: 7. }; + let i = IntOdd { a: 1, b: 2, c: 3 }; unsafe { byval_rect(1, 2, 3, 4, 5, s); @@ -113,5 +133,12 @@ fn main() { assert_eq!(sret_byval_struct(1, 2, 3, 4, s), t); assert_eq!(sret_split_struct(1, 2, s), t); assert_eq!(float_point(p), p); + assert_eq!(int_odd(i), i); + + // MSVC/GCC/Clang are not consistent in the ABI of single-float aggregates. + // x86_64: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82028 + // i686: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82041 + #[cfg(not(all(windows, target_env = "gnu")))] + assert_eq!(float_one(f1), f1); } } diff --git a/src/test/run-make/extern-fn-with-packed-struct/test.c b/src/test/run-make/extern-fn-with-packed-struct/test.c index 506954fca461..4124e202c1dd 100644 --- a/src/test/run-make/extern-fn-with-packed-struct/test.c +++ b/src/test/run-make/extern-fn-with-packed-struct/test.c @@ -1,6 +1,8 @@ // ignore-license // Pragma needed cause of gcc bug on windows: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991 +#include <assert.h> + #ifdef _MSC_VER #pragma pack(push,1) struct Foo { @@ -18,5 +20,8 @@ struct __attribute__((packed)) Foo { #endif struct Foo foo(struct Foo foo) { + assert(foo.a == 1); + assert(foo.b == 2); + assert(foo.c == 3); return foo; } diff --git a/src/test/run-make/extern-fn-with-packed-struct/test.rs b/src/test/run-make/extern-fn-with-packed-struct/test.rs index 9e81636e3670..d2540ad61542 100644 --- a/src/test/run-make/extern-fn-with-packed-struct/test.rs +++ b/src/test/run-make/extern-fn-with-packed-struct/test.rs @@ -8,36 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::fmt; - -#[repr(packed)] -#[derive(Copy, Clone)] +#[repr(C, packed)] +#[derive(Copy, Clone, Debug, PartialEq)] struct Foo { a: i8, b: i16, c: i8 } -impl PartialEq for Foo { - fn eq(&self, other: &Foo) -> bool { - self.a == other.a && self.b == other.b && self.c == other.c - } -} - -impl fmt::Debug for Foo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let a = self.a; - let b = self.b; - let c = self.c; - - f.debug_struct("Foo") - .field("a", &a) - .field("b", &b) - .field("c", &c) - .finish() - } -} - #[link(name = "test", kind = "static")] extern { fn foo(f: Foo) -> Foo; -- 2.13.5 ++++++ rust-1.21.0-44203-exclude-compiler-rt-test.patch ++++++ >From 35f8a2065b7d17d39481a75cefa739df7a061084 Mon Sep 17 00:00:00 2001 From: Josh Stone <[email protected]> Date: Wed, 30 Aug 2017 18:20:59 -0700 Subject: [PATCH] rustbuild: update the rust-src filter for compiler-rt We wanted `src/compiler-rt/test` filtered from the `rust-src` package, but that path is now `src/libcompiler_builtins/compiler-rt/test`. This saves over half of the installed rust-src size. (50MB -> 22MB) --- src/bootstrap/dist.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 746f85a9d59d..05d59e7d5956 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -754,7 +754,7 @@ impl Step for Src { "src/libprofiler_builtins", ]; let std_src_dirs_exclude = [ - "src/compiler-rt/test", + "src/libcompiler_builtins/compiler-rt/test", "src/jemalloc/test/unit", ]; -- 2.13.5 ++++++ rust-1.21.0-44440-s390x-global-align.patch ++++++ >From 0f5ee28213a73733e6811b176c89ecececfe9cbc Mon Sep 17 00:00:00 2001 From: bors <[email protected]> Date: Mon, 11 Sep 2017 12:53:21 +0000 Subject: [PATCH] Auto merge of #44440 - cuviper:min_global_align, r=japaric Add `TargetOptions::min_global_align`, with s390x at 16-bit The SystemZ `LALR` instruction provides PC-relative addressing for globals, but only to *even* addresses, so other compilers make sure that such globals are always 2-byte aligned. In Clang, this is modeled with `TargetInfo::MinGlobalAlign`, and `TargetOptions::min_global_align` now serves the same purpose for rustc. In Clang, the only targets that set this are SystemZ, Lanai, and NVPTX, and the latter two don't have targets in rust master. Fixes #44411. r? @eddyb --- src/librustc_back/target/mod.rs | 6 ++++ .../target/s390x_unknown_linux_gnu.rs | 1 + src/librustc_trans/consts.rs | 24 ++++++++++++-- src/test/run-make/min-global-align/Makefile | 22 +++++++++++++ .../run-make/min-global-align/min_global_align.rs | 38 ++++++++++++++++++++++ 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/test/run-make/min-global-align/Makefile create mode 100644 src/test/run-make/min-global-align/min_global_align.rs diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 130e1b695dbd..301cf3f8c820 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -425,6 +425,9 @@ pub struct TargetOptions { /// Whether or not stack probes (__rust_probestack) are enabled pub stack_probes: bool, + + /// The minimum alignment for global symbols. + pub min_global_align: Option<u64>, } impl Default for TargetOptions { @@ -486,6 +489,7 @@ impl Default for TargetOptions { crt_static_default: false, crt_static_respected: false, stack_probes: false, + min_global_align: None, } } } @@ -724,6 +728,7 @@ impl Target { key!(crt_static_default, bool); key!(crt_static_respected, bool); key!(stack_probes, bool); + key!(min_global_align, Option<u64>); if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) { for name in array.iter().filter_map(|abi| abi.as_string()) { @@ -914,6 +919,7 @@ impl ToJson for Target { target_option_val!(crt_static_default); target_option_val!(crt_static_respected); target_option_val!(stack_probes); + target_option_val!(min_global_align); if default.abi_blacklist != self.options.abi_blacklist { d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter() diff --git a/src/librustc_back/target/s390x_unknown_linux_gnu.rs b/src/librustc_back/target/s390x_unknown_linux_gnu.rs index 78a6bb7933d9..aad9effacd44 100644 --- a/src/librustc_back/target/s390x_unknown_linux_gnu.rs +++ b/src/librustc_back/target/s390x_unknown_linux_gnu.rs @@ -22,6 +22,7 @@ pub fn target() -> TargetResult { base.max_atomic_width = Some(64); // see #36994 base.exe_allocation_crate = None; + base.min_global_align = Some(16); Ok(Target { llvm_target: "s390x-unknown-linux-gnu".to_string(), diff --git a/src/librustc_trans/consts.rs b/src/librustc_trans/consts.rs index 310cd6fe9559..f7f9b9386841 100644 --- a/src/librustc_trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -26,6 +26,7 @@ use rustc::ty; use rustc::hir; +use std::cmp; use std::ffi::{CStr, CString}; use syntax::ast; use syntax::attr; @@ -42,6 +43,25 @@ pub fn bitcast(val: ValueRef, ty: Type) -> ValueRef { } } +fn set_global_alignment(ccx: &CrateContext, + gv: ValueRef, + mut align: machine::llalign) { + // The target may require greater alignment for globals than the type does. + // Note: GCC and Clang also allow `__attribute__((aligned))` on variables, + // which can force it to be smaller. Rust doesn't support this yet. + if let Some(min) = ccx.sess().target.target.options.min_global_align { + match ty::layout::Align::from_bits(min, min) { + Ok(min) => align = cmp::max(align, min.abi() as machine::llalign), + Err(err) => { + ccx.sess().err(&format!("invalid minimum global alignment: {}", err)); + } + } + } + unsafe { + llvm::LLVMSetAlignment(gv, align); + } +} + pub fn addr_of_mut(ccx: &CrateContext, cv: ValueRef, align: machine::llalign, @@ -53,7 +73,7 @@ pub fn addr_of_mut(ccx: &CrateContext, bug!("symbol `{}` is already defined", name); }); llvm::LLVMSetInitializer(gv, cv); - llvm::LLVMSetAlignment(gv, align); + set_global_alignment(ccx, gv, align); llvm::LLVMRustSetLinkage(gv, llvm::Linkage::InternalLinkage); SetUnnamedAddr(gv, true); gv @@ -271,7 +291,7 @@ pub fn trans_static<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ccx.statics_to_rauw().borrow_mut().push((g, new_g)); new_g }; - llvm::LLVMSetAlignment(g, ccx.align_of(ty)); + set_global_alignment(ccx, g, ccx.align_of(ty)); llvm::LLVMSetInitializer(g, v); // As an optimization, all shared statics which do not have interior diff --git a/src/test/run-make/min-global-align/Makefile b/src/test/run-make/min-global-align/Makefile new file mode 100644 index 000000000000..2eacc36f380d --- /dev/null +++ b/src/test/run-make/min-global-align/Makefile @@ -0,0 +1,22 @@ +-include ../tools.mk + +# This tests ensure that global variables respect the target minimum alignment. +# The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have +# type-alignment of 1, but some targets require greater global alignment. + +SRC = min_global_align.rs +LL = $(TMPDIR)/min_global_align.ll + +all: +ifeq ($(UNAME),Linux) +# Most targets are happy with default alignment -- take i686 for example. +ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86) + $(RUSTC) --target=i686-unknown-linux-gnu --emit=llvm-ir $(SRC) + [ "$$(grep -c 'align 1' "$(LL)")" -eq "3" ] +endif +# SystemZ requires even alignment for PC-relative addressing. +ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz) + $(RUSTC) --target=s390x-unknown-linux-gnu --emit=llvm-ir $(SRC) + [ "$$(grep -c 'align 2' "$(LL)")" -eq "3" ] +endif +endif diff --git a/src/test/run-make/min-global-align/min_global_align.rs b/src/test/run-make/min-global-align/min_global_align.rs new file mode 100644 index 000000000000..3d4f9001a747 --- /dev/null +++ b/src/test/run-make/min-global-align/min_global_align.rs @@ -0,0 +1,38 @@ +// Copyright 2017 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. + +#![feature(no_core, lang_items)] +#![crate_type="rlib"] +#![no_core] + +pub static STATIC_BOOL: bool = true; + +pub static mut STATIC_MUT_BOOL: bool = true; + +const CONST_BOOL: bool = true; +pub static CONST_BOOL_REF: &'static bool = &CONST_BOOL; + + +#[lang = "sized"] +trait Sized {} + +#[lang = "copy"] +trait Copy {} + +#[lang = "freeze"] +trait Freeze {} + +#[lang = "sync"] +trait Sync {} +impl Sync for bool {} +impl Sync for &'static bool {} + +#[lang="drop_in_place"] +pub unsafe fn drop_in_place<T: ?Sized>(_: *mut T) { } -- 2.13.5 ++++++ rust-rpmlintrc ++++++ --- /var/tmp/diff_new_pack.oqvr0H/_old 2017-10-25 17:44:23.280238599 +0200 +++ /var/tmp/diff_new_pack.oqvr0H/_new 2017-10-25 17:44:23.280238599 +0200 @@ -3,4 +3,6 @@ addFilter("non-executable-script*./usr/lib/rustlib/src/.*") # filters for rust-std # rlib not in elf format -addFilter("binaryinfo-readelf-failed*./usr/lib/rustlib/*.rlib") \ No newline at end of file +addFilter("binaryinfo-readelf-failed*./usr/lib/rustlib/*.rlib") +# rust has no stable ABI as of yet, soname is of no use yet +addFilter("no-soname.*/usr/lib/lib.*") ++++++ rustc-1.20.0-src.tar.gz -> rustc-1.21.0-src.tar.gz ++++++ /work/SRC/openSUSE:Factory/rust/rustc-1.20.0-src.tar.gz /work/SRC/openSUSE:Factory/.rust.new/rustc-1.21.0-src.tar.gz differ: char 14, line 1
