Der Versuch, das Golang -Paket zu erstellen, das mit der GCC -Kompilierung Segfault endetLinux

Linux verstehen
Anonymous
 Der Versuch, das Golang -Paket zu erstellen, das mit der GCC -Kompilierung Segfault endet

Post by Anonymous »

Nach einem Paket -Upgrade auf meinem Ubuntu 24.04 bin ich auf die Unfähigkeit gestoßen, mit fast einem der Golang -Pakete zu erstellen/zu installieren/zu arbeiten.

Code: Select all

$ go install -v honnef.co/go/tools/cmd/staticcheck@latest
go: downloading honnef.co/go/tools v0.6.1
go: downloading golang.org/x/tools v0.30.0
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading golang.org/x/sync v0.11.0
go: downloading golang.org/x/mod v0.23.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
runtime/cgo
# runtime/cgo
/tmp/ccyaXynT.s: Assembler messages:
/tmp/ccyaXynT.s: Internal error (Segmentation fault).
Please report this bug.
Mein Go env ist:

Code: Select all

$ go env
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3918232214=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.1'
GOWORK=''
PKG_CONFIG='pkg-config'
Entfernen ~/.cache/go-build hilft nicht. Nachdem ich ein gewisses Eingraben ausgab, habe ich den exakten Befehl erfasst, verursacht den Fehler: < /p>

Code: Select all

WORK=/tmp/go-build94545583
cd /usr/local/go/src/runtime/cgo
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x003.o -c gcc_context.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x004.o -c gcc_fatalf.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x005.o -c gcc_libinit.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x006.o -c gcc_linux_amd64.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x007.o -c gcc_mmap.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x008.o -c gcc_setenv.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x009.o -c gcc_sigaction.c
TERM='dumb' gcc -I .  -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x010.o -c gcc_stack_unix.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x011.o -c gcc_traceback.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x012.o -c gcc_util.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x013.o -c linux_syscall.c
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o $WORK/b331/_x014.o -c gcc_amd64.S
# runtime/cgo
/tmp/ccuohmsg.s: Assembler messages:
/tmp/ccuohmsg.s: Internal error (Segmentation fault).
Please report this bug.
< /code>
GCC-Version ist 13.3.0.$ gcc-9 -I . -fPIC -m64 -pthread -fmessage-length=0 -ffile-prefix-map=$WORK/b331=/tmp/go-build -gno-record-gcc-switches -I $WORK/b331/ -O2 -g -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement -ffile-prefix-map=/usr/local/go=/_/GOROOT -frandom-seed=LT5_d3ncbMuqN3lN9Xk7 -o ~/_x014.o -c gcc_amd64.S

$ echo $?
0
< /code>
Dies ist Go1.25.1 Installieren Sie von Go.dev. < /p>
Was ist das? GCC -Fehler? Ubuntu Bug? Wie löste ich es? Ich habe diese temporäre Datei gespeichert (fügte -Save -Temps 
Option für GCC -Aufruf hinzugefügt und verwendet Strace Dienstprogramm, um zu wissen

Code: Select all

$ as --debug-prefix-map /tmp/go-build94545583/b331=/tmp/go-build --debug-prefix-map usr/local/go=/_/GOROOT -I . -I /tmp/go-build94545583/b331/ --gdwarf-5 --64 -o ~/_x014.o ~/_x014.s
/home/user/_x014.s: Assembler messages:
/home/user/_x014.s: Internal error (Segmentation fault).
Please report this bug.
und GCC-9 Die Version ist:

Code: Select all

$ as --gdwarf2 -I . -I /tmp/go-build94545583/b331/ --64 -o ~/_x014.o ~/_x014.s

$ echo $?
0

Da beide dieselbe Version von As Compiler verwenden, besteht die Hauptdifferenz in -Gdwarf2 und -gdwarf5 Optionen. In der Tat, wenn ich es tauschte, wird die Datei kompiliert! < /P>
Vorschläge? Bitte.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post
  • Was bedeutet die GCC-Warnung „Projektparameterübergabe für X in GCC 7.1 geändert“?
    by Guest » » in C++
    0 Replies
    49 Views
    Last post by Guest
  • C Cpputest Zeiger Mock Segfault
    by Guest » » in C++
    0 Replies
    18 Views
    Last post by Guest
  • Bash PHP Stille Segfault
    by Anonymous » » in Php
    0 Replies
    17 Views
    Last post by Anonymous
  • Golang äquivalent zu Python-formatierter Zeichenfolge mit F-Strings
    by Anonymous » » in Python
    0 Replies
    6 Views
    Last post by Anonymous
  • Geschwindigkeit von Golang vs. Java
    by Anonymous » » in Java
    0 Replies
    8 Views
    Last post by Anonymous