Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bogus "errors" and warnings while compiling code for MIPS1

Chiusa
#1,003 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by tracing how rustc_codegen_gcc configures libgccjit for the mipsel-sony-psx target and its static relocation model; the issue does not name source files or tests. Reproduce with the provided no_std program, comparing debug and release builds against LLVM. Done means the spurious PIC errors and memcpy overflow warnings are resolved while the compiled result remains correct.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I've been writing Rust code for the PlayStation (mipsel-sony-psx), a MIPS1-based target with a static relocation model.
While compiling this code using LLVM, it works fine. But with rustc_codegen_gcc, I get errors related to PIC which does not affect the compiled result.

libgccjit.so: error: position-independent code requires '-mabicalls'
libgccjit.so: error: position-independent code requires '-mabicalls'
libgccjit.so: error: position-independent code requires '-mabicalls'
   Compiling dummy v0.1.0 (/project)
libgccjit.so: error: position-independent code requires '-mabicalls'
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.23s

If I compile with --release, it spits out overflow warnings related to some memcpy operations on top of the errors, that shouldn't be there since my code doesn't use any:

   Compiling compiler_builtins v0.1.160 (/home/builder/.rustup/toolchains/nightly-2026-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins)
   Compiling core v0.0.0 (/home/builder/.rustup/toolchains/nightly-2026-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
libgccjit.so: error: position-independent code requires '-mabicalls'
libgccjit.so: error: position-independent code requires '-mabicalls'
   Compiling alloc v0.0.0 (/home/builder/.rustup/toolchains/nightly-2026-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
libgccjit.so: error: position-independent code requires '-mabicalls'
libgccjit.so: warning: : 'memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
libgccjit.so: warning: : 'memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
libgccjit.so: warning: : 'memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
   Compiling dummy v0.1.0 (/project)
libgccjit.so: error: position-independent code requires '-mabicalls'
    Finished `release` profile [optimized] target(s) in 34.04s

It's important to note, that despite these warnings and errors, nothing ends up being wrong with the compiled result, which isn't that bad, but still makes me suspicious.

This is how the program looks like:

#![no_std]
#![no_main]

use core::panic::PanicInfo;
use core::hint::black_box;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
    loop {}
}

#[unsafe(no_mangle)]
fn _start() {
    black_box(18);
}
Lingua principale
Rust
Stelle
1.2k
Fork
106
Merge medio
6h 17m
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rustc_codegen_gcc

Tutte le issue di rust-lang/rustc_codegen_gcc

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.