#1120809 stress-ng FTCBFS for s390x: -fmodulo-sched is not removed

#1120809#5
Date:
2025-11-14 22:08:23 UTC
From:
To:
Hi Colin,

I noticed that stress-ng fails to cross build from source by timing out
the build of stress-vecwide.c. The other Colin then pointed me at your
recent changes, so it looked like this should have been fixed, but
somehow is not. As far as I understand things, the Makefile.machine does
not give a sensible MACHINE during cross builds for s390x and then your
patch dropping -fmodulo-sched does not kick in.

How about trying $(CC) -dumpmachine in addition to the objdump approach?

Helmut

#1120809#10
Date:
2025-11-20 05:56:26 UTC
From:
To:
Hi Helmut,

I tried performing a cross build from x86 for s390x with latest patch and it did appear to build fine.
I also tested the cross built binary on an s390 machine.

Are you still seeing this issue?
If yes, could you please provide me some hints on how to reproduce this?

Thanks and Regards,
Pranav

#1120809#15
Date:
2025-11-20 09:00:13 UTC
From:
To:
Hi Pranav,

Thank you!

I expect that if it built, it'll work.

Yes. I can see it locally and I also observe it on QA infrastructure
https://crossqa.debian.net/src/stress-ng

Please bear in mind that the issue is related to performance. sbuild
aborts the build after 150 minutes of no output, so it really depends on
the speed of the machine performing the build. The ones I've been using
were aged x86 machines. Not the slowest, but also not very fast.
https://buildd.debian.org/status/fetch.php?pkg=stress-ng&arch=s390x&ver=0.19.06-3&stamp=1763035378&raw=1
| cc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/stress-ng-0.19.06=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize  -DHAVE_SOURCE_DATE_EPOCH=1763032064 -std=gnu99 -DHAVE_CFLAGS='"-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/stress-ng-0.19.06=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize  -DHAVE_SOURCE_DATE_EPOCH=1763032064 -std=gnu99"' -DHAVE_LDFLAGS='"-Wl,-z,relro -Wl,-z,now"' -DHAVE_CXXFLAGS='"-g -O2 -ffile-prefix-map=/build/reproducible-path/stress-ng-0.19.06=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/stress-ng-0.19.06=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize  -DHAVE_SOURCE_DATE_EPOCH=1763032064"' -c -o stress-vecwide.o stress-vecwide.c

The cross buildd did this:
https://crossqa.debian.net/build/stress-ng_0.19.06-3_s390x_20251115213510.log
| s390x-linux-gnu-gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize -fmodulo-sched  -DHAVE_SOURCE_DATE_EPOCH=1763032064 -std=gnu99 -DHAVE_CFLAGS='"-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize -fmodulo-sched  -DHAVE_SOURCE_DATE_EPOCH=1763032064 -std=gnu99"' -DHAVE_LDFLAGS='"-Wl,-z,relro -Wl,-z,now"' -DHAVE_CXXFLAGS='"-g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -DVERSION='"0.19.06"' -Wformat -fstack-protector-strong -Werror=format-security -D_FORTIFY_SOURCE=2 -fipa-pta -fivopts -ftree-vectorize -ftree-slp-vectorize -fmodulo-sched  -DHAVE_SOURCE_DATE_EPOCH=1763032064"' -c -o stress-vecwide.o stress-vecwide.c

The changelog for -2 says:
|  * Add fix to disable -fmodulo-sched for s390 systems to speed up
|    very long build times.

Now we see the -fmodulo-sched option on the cross compiler invocation,
but not on the native one. How about your own cross builds?

Helmut

#1120809#20
Date:
2025-11-24 14:28:37 UTC
From:
To:
Hi Helmut,

Thanks a lot for providing the info.
I have raised a PR for this: https://github.com/ColinIanKing/stress-ng/pull/591

When doing the cross compilation, although the CC and CXX variables was set to the target architecture's toolchain, it was using the native objdump. So, Makefile.machine, instead of generating the output s390, was generating big which caused the if condition in the Makefile to fail and led to the addition of -fmodulo-sched flag to CC which resulted in the insane build time.

/usr/share/dpkg/buildtools.mk sets all the necessary variables including CC, CXX and OBJDUMP accordingly and hence exporting it fixes the issue.

And as you suggested in a previous mail, adding -dumpmachine flag is a very promising idea and doesn't seem to be prone to errors like this.

Thanks and Regards,
Pranav

#1120809#25
Date:
2025-12-01 03:06:54 UTC
From:
To:
Hi Helmut,

This PR is now merged.

Thank you,
Pranav