Simple cross build fails out of the box on Fedora
Rot127
rot127@posteo.com
Thu Mar 12 20:12:18 GMT 2026
On Debian it works out of the box with:
```
sudo apt install crossbuild-essential-s390x
./configure --host=s390x-linux-gnu
make
```
So I guess I just use a Debian VM now.
But --with-build-sysroot should probably be removed. Since it obviously
doesn't do what it promises.
The problem with Fedora might be that it doesn't have the C-library and
binaries all under /usr/s390x-linux-gnu/.
One needs to install another package for libc which then is under
/usr/s390x-redhat-linux/sys-root/fc42/.
On Debian it was enough to give the host name. Guess it just assumes
everything is under /usr/<HOST>.
On 3/12/26 08:24, Jan Beulich wrote:
> On 11.03.2026 20:51, Rot127 wrote:
>> I try to build binutils on Fedora but configure fails already to compile
>> the test program.
>> I cannot for the sake of it see what the problem is according to the
>> `configure --help` docs.
>>
>> Reproducible with:
>>
>> ```
>> ./configure \
>> --host=s390x-linux-gnu \
>> --target=s390x-linux-gnu \
>> --with-build-sysroot=/usr/s390x-redhat-linux/sys-root/fc42/usr
>> ```
> A couple of observations, but I'm nowhere near a specialist: Isn't the
> trailing /usr wrong here, considering the ld output at the bottom?
>
>> Build error:
>>
>> ```
>> gcc version 15.2.1 20250808 (Red Hat Cross 15.2.1-1) (GCC)
>> configure:4654: $? = 0
>> configure:4643: s390x-linux-gnu-gcc -V >&5
>> s390x-linux-gnu-gcc: error: unrecognized command-line option '-V'
>> s390x-linux-gnu-gcc: fatal error: no input files
>> compilation terminated.
>> configure:4654: $? = 1
>> configure:4643: s390x-linux-gnu-gcc -qversion >&5
>> s390x-linux-gnu-gcc: error: unrecognized command-line option
>> '-qversion'; did you mean '--version'?
>> s390x-linux-gnu-gcc: fatal error: no input files
>> compilation terminated.
>> configure:4654: $? = 1
>> configure:4674: checking whether the C compiler works
>> configure:4696: s390x-linux-gnu-gcc conftest.c >&5
> Judging from what's visible here and what I can find in configure.ac,
> --with-build-sysroot, which merely sets SYSROOT_CFLAGS_FOR_TARGET, does
> not take any effect here. That env var looks to be used only later in
> the Makefile.
>
> Finally, "simple cross build" also doesn't look quite right. Aiui that
> names the case where you pass --target, but not --host.
>
> Jan
>
>> /usr/bin/s390x-linux-gnu-ld: cannot find crt1.o: No such file or directory
>> /usr/bin/s390x-linux-gnu-ld: cannot find crti.o: No such file or directory
>> /usr/bin/s390x-linux-gnu-ld: cannot find -lc: No such file or directory
>> /usr/bin/s390x-linux-gnu-ld: cannot find crtn.o: No such file or directory
>> collect2: error: ld returned 1 exit status
>> configure:4700: $? = 1
>> configure:4738: result: no
>> configure: failed program was:
>> | /* confdefs.h */
>> | #define PACKAGE_NAME ""
>> | #define PACKAGE_TARNAME ""
>> | #define PACKAGE_VERSION ""
>> | #define PACKAGE_STRING ""
>> | #define PACKAGE_BUGREPORT ""
>> | #define PACKAGE_URL ""
>> | /* end confdefs.h. */
>> |
>> | int
>> | main ()
>> | {
>> |
>> | ;
>> | return 0;
>> | }
>> configure:4743: error: in
>> `/home/user/repos/rz-framework-cmp/data/binutils-2.46.0':
>> configure:4745: error: C compiler cannot create executables
>> See `config.log' for more details
>> ```
>>
>> All the libraries and bins live happily at their place:
>>
>> ```
>> > ll /usr/bin/s390x-linux-gnu-gcc
>> -rwxr-xr-x. 1 root root 1.9M Aug 13 2025 /usr/bin/s390x-linux-gnu-gcc
>>
>> > ll /usr/s390x-redhat-linux/sys-root/fc42/usr/lib64/crt*
>> -rw-r--r--. 1 root root 2.8K Jan 23 01:00
>> /usr/s390x-redhat-linux/sys-root/fc42/usr/lib64/crt1.o
>> -rw-r--r--. 1 root root 1.7K Jan 23 01:00
>> /usr/s390x-redhat-linux/sys-root/fc42/usr/lib64/crti.o
>> -rw-r--r--. 1 root root 1.3K Jan 23 01:00
>> /usr/s390x-redhat-linux/sys-root/fc42/usr/lib64/crtn.o
>> ```
>>
>> Would really appreciate any help.
>>
>>
More information about the Binutils
mailing list