[Bug go/104973] GCC 11.2.1 build failure with Go support (mv: cannot stat 'cpugen.o': No such file or directory)

2022-03-19 Thread sam at gentoo dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104973

--- Comment #5 from Sam James  ---
I'm forwarding a report from downstream which two people have commented in:
1. Dennis, the original reporter;
2. PaX Team, who commented too.

They're likely the same issue or related. I can't reproduce it myself yet, but
I've tried repeatedly.

[Bug go/104973] GCC 11.2.1 build failure with Go support (mv: cannot stat 'cpugen.o': No such file or directory)

2022-03-18 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104973

--- Comment #4 from Ian Lance Taylor  ---
The golang.org/x/sys/cpu.o is a different object file.  That one uses
gcpugen.go, not cpugen.go.  The original reporter is not reporting any problems
involving gcpugen.go.  The cpugen.go (not gcpugen.go) file is an input for
internal/cpu.o.

[Bug go/104973] GCC 11.2.1 build failure with Go support (mv: cannot stat 'cpugen.o': No such file or directory)

2022-03-18 Thread pageexec at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104973

--- Comment #3 from PaX Team  ---
(In reply to Andrew Pinski from comment #1)
> Can you attach what is inside cpugen.go?

i'm one of the original bug reproducers, this is what i get here:


work # find . -name  cpugen.go -ls
 29921892  4 -rw-r--r--   1 root root   74 Mar 18 10:13
./build/x86_64-pc-linux-gnu/libgo/cpugen.go
 29922436  4 -rw-r--r--   1 root root   74 Mar 18 10:13
./build/x86_64-pc-linux-gnu/32/libgo/cpugen.go
work # cat ./build/x86_64-pc-linux-gnu/libgo/cpugen.go
package cpu
const CacheLinePadSize = 64
const FunctionDescriptors = false
work # cat ./build/x86_64-pc-linux-gnu/32/libgo/cpugen.go
package cpu
const CacheLinePadSize = 64
const FunctionDescriptors = false


the relevant build log:

libtool: compile: 
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./gcc/gccgo
-B/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem
/usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include
-fchecking=1 -minline-all-stringops -O2 -g -m32 -I . -c
-fgo-pkgpath=golang.org/x/sys/cpu
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/byteorder.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_gccgo_x86.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_linux_noinit.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_x86.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/hwcap_linux.go
gcpugen.go  -fPIC -o golang.org/x/sys/.libs/cpu.o

libtool: compile: 
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./gcc/gccgo
-B/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem
/usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include
-fchecking=1 -minline-all-stringops -O2 -g -m32 -I . -c
-fgo-pkgpath=golang.org/x/sys/cpu
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/byteorder.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_gccgo_x86.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_linux_noinit.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/cpu_x86.go
/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/libgo/go/golang.org/x/sys/cpu/hwcap_linux
.go gcpugen.go -o golang.org/x/sys/cpu.o >/dev/null 2>&1

note that there's a -o output specified but it's for the 'wrong' file name.
i've got these cpu.o files:

work # find . -name  cpu.o -ls
 29922270 60 -rw-r--r--   1 root root58160 Mar 18 10:13
./build/x86_64-pc-linux-gnu/libgo/cpu.o
 29923192 44 -rw-r--r--   1 root root41656 Mar 18 10:13
./build/x86_64-pc-linux-gnu/32/libgo/internal/cpu.o
 29922867 44 -rw-r--r--   1 root root43384 Mar 18 10:13
./build/x86_64-pc-linux-gnu/32/libgo/internal/.libs/cpu.o
 29927256 92 -rw-r--r--   1 root root92688 Mar 18 10:15
./build/x86_64-pc-linux-gnu/32/libgo/golang.org/x/sys/cpu.o
 29927254 96 -rw-r--r--   1 root root95608 Mar 18 10:15
./build/x86_64-pc-linux-gnu/32/libgo/golang.org/x/sys/.libs/cpu.o

would you like me to upload anything of the above or any other build files?

[Bug go/104973] GCC 11.2.1 build failure with Go support (mv: cannot stat 'cpugen.o': No such file or directory)

2022-03-17 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104973

--- Comment #2 from Ian Lance Taylor  ---
Your build log shows a line like this:

libtool: compile: 
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/gccgo
-B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem
/usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include
-minline-all-stringops -O2 -g -I . -c -fgo-pkgpath=internal/cpu
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu.go
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu_amd64.go
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu_x86.go
cpugen.go 

My build log shows a line like this:

libtool: compile:  /home/iant/gcc/gcc-11-objdir/./gcc/gccgo
-B/home/iant/gcc/gcc-11-objdir/./gcc/
-B/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/bin/
-B/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/lib/ -isystem
/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/include -isystem
/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/sys-include -fchecking=1
-minline-all-stringops -O2 -g -I . -c -fgo-pkgpath=internal/cpu
../../../gcc-11-branch/libgo/go/internal/cpu/cpu.go
../../../gcc-11-branch/libgo/go/internal/cpu/cpu_amd64.go
../../../gcc-11-branch/libgo/go/internal/cpu/cpu_x86.go cpugen.go  -fPIC -o
internal/.libs/cpu.o

Note that my line has a -o ption at the end but yours does not.

I think that is the root of the problem.

Earlier your log has this:

/usr/sbin/mkdir -p internal; files=`echo
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu.go
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu_amd64.go
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgo/go/internal/cpu/cpu_x86.go
cpugen.go | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; /bin/bash ./libtool
--tag GO --mode=compile
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/gccgo
-B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem
/usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include 
   -minline-all-stringops  -O2 -g -I . -c -fgo-pkgpath=`echo internal/cpu.lo |
sed -e 's/.lo$//'`  -o internal/cpu.lo $files

My log has this:

/bin/mkdir -p internal; files=`echo
../../../gcc-11-branch/libgo/go/internal/cpu/cpu.go
../../../gcc-11-branch/libgo/go/internal/cpu/cpu_amd64.go
../../../gcc-11-branch/libgo/go/internal/cpu/cpu_x86.go cpugen.go | sed -e
's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; /bin/sh ./libtool --tag GO
--mode=compile /home/iant/gcc/gcc-11-objdir/./gcc/gccgo
-B/home/iant/gcc/gcc-11-objdir/./gcc/
-B/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/bin/
-B/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/lib/ -isystem
/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/include -isystem
/home/iant/gcc/gcc-11-install/x86_64-pc-linux-gnu/sys-include   -fchecking=1 
-minline-all-stringops  -O2 -g -I . -c -fgo-pkgpath=`echo internal/cpu.lo | sed
-e 's/.lo$//'`  -o internal/cpu.lo $files

Here the -o option is present in both cases.

So why does the -o option disappear?  Could this be somehow due to the patches
being applied at the start of your build log?

[Bug go/104973] GCC 11.2.1 build failure with Go support (mv: cannot stat 'cpugen.o': No such file or directory)

2022-03-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104973

--- Comment #1 from Andrew Pinski  ---
Can you attach what is inside cpugen.go?