Skip to content

add mips64r6 linux targets #52666

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
gnzlbg opened this issue Jul 24, 2018 · 9 comments
Closed

add mips64r6 linux targets #52666

gnzlbg opened this issue Jul 24, 2018 · 9 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. O-MIPS Target: MIPS processors

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Jul 24, 2018

The mips64r6 isa is incompatible with the previous ones (r5,r4,r3,r2, ...).

We should add two targets:

  • mipsisa64r6-unknown-linux-gnuabi64
  • mipsisa64r6el-unknown-linux-gnuabi64

to target these, since compiling with -C target-cpu=mips64r6 is never going to work with the current mips64 targets.

We should also probably error if one of the current targets is used and -C target-cpu=mips64r6 is passed as an option, since that is never going to work and the linker errors one gets are not really the best (rust-lang/packed_simd#18 (comment)):

error: linking with `mips64-linux-gnuabi64-gcc` failed: exit code: 1
  |
  = note: "mips64-linux-gnuabi64-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.packed_simd0.rcgu.o" "-o" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps" "-L" "/checkout/target/release/deps" "-L" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib" "-Wl,-Bstatic" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libtest-cd2e845f4c70927d.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libterm-9eb611101cf4cecf.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libgetopts-4874943d5732d1b7.rlib" "-Wl,--start-group" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libstd-3f6ab34df8ffd83e.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libpanic_unwind-a5a7585073f51dde.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libunwind-003f74338435e0fd.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/liballoc_system-2755128d19d935f8.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/liblibc-b75d74899d2adc7f.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/liballoc-8b879cd22eb4890a.rlib" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/libarrayvec-eb8868cfdf72a318.rlib" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/libnodrop-f44f02a725192a9d.rlib" "/checkout/target/mips64-unknown-linux-gnuabi64/release/deps/libcfg_if-f697f12200a30b1b.rlib" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libcore-f30fde47d896be92.rlib" "-Wl,--end-group" "/rust/lib/rustlib/mips64-unknown-linux-gnuabi64/lib/libcompiler_builtins-ddc5be726ac41261.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util"
  = note: /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.packed_simd0.rcgu.o: linking mips:isa64r6 module with previous mips:isa64r2 modules
          /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.packed_simd0.rcgu.o: linking -mnan=2008 module with previous -mnan=legacy modules
          /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: failed to merge target specific data of file /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.packed_simd0.rcgu.o
          /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.crate.allocator.rcgu.o: linking mips:isa64r6 module with previous mips:isa64r2 modules
          /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.crate.allocator.rcgu.o: linking -mnan=2008 module with previous -mnan=legacy modules
          /usr/lib/gcc-cross/mips64-linux-gnuabi64/7/../../../../mips64-linux-gnuabi64/bin/ld: failed to merge target specific data of file /checkout/target/mips64-unknown-linux-gnuabi64/release/deps/packed_simd-bc52a852fd902da6.crate.allocator.rcgu.o
          collect2: error: ld returned 1 exit status
          
error: aborting due to previous error

The linking -mnan=2008 module with previous -mnan=legacy modules is basically something that has to be set for the whole binary, and this means that core and std must be compiled with it.

@kennytm kennytm added O-MIPS Target: MIPS processors C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Jul 24, 2018
@wzssyqa
Copy link
Contributor

wzssyqa commented Aug 26, 2018

mips-r6.diff.gz

WIth this patch, I can bootstrap rustc 1.28, and build all rust-*/cargo in Debian archive.

It depends on https://reviews.llvm.org/D50857

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Aug 27, 2018

Thanks, could you update us when the LLVM patch gets merged?

@wzssyqa
Copy link
Contributor

wzssyqa commented Aug 27, 2018

@gnzlbg yep. I will post a message here when the patch for llvm merged.

@wzssyqa
Copy link
Contributor

wzssyqa commented Sep 27, 2018

@gnzlbg llvm support is official now

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Sep 27, 2018

Nice! What remains to be done is:

  • update llvm in rust to llvm trunk (we are already closely following it, so this shouldn't be too hard)
  • create target description files for mips64r6 targets

@wzssyqa
Copy link
Contributor

wzssyqa commented Jan 29, 2019

@gnzlbg how about the progress of this bug?

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 29, 2019

@wzssyqa LLVM has been updated a couple of times since my last comment, so one should be able to target mips64r6 already using xargo. AFAIK nobody has contributed a target description file for it yet, but if somebody gets xargo to compile for these targets, adding it would be very easy.

@wzssyqa
Copy link
Contributor

wzssyqa commented Mar 5, 2019

#58941

@sanxiyn
Copy link
Member

sanxiyn commented Mar 20, 2019

Targets landed.

@sanxiyn sanxiyn closed this as completed Mar 20, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. O-MIPS Target: MIPS processors
Projects
None yet
Development

No branches or pull requests

4 participants