Bug 1296211 - SLOF cannot be built on 64bit little endian host
SLOF cannot be built on 64bit little endian host
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc (Show other bugs)
ppc64le Linux
unspecified Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
Michael Petlan
Depends On:
  Show dependency treegraph
Reported: 2016-01-06 10:41 EST by Laurent Vivier
Modified: 2016-11-04 02:27 EDT (History)
4 users (show)

See Also:
Fixed In Version: gcc-4.8.5-6.el7
Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-04 02:27:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Laurent Vivier 2016-01-06 10:41:48 EST
Description of problem:

SLOF is always built as a big endian target. To be built on a little endian host, SLOF makefile adds "-m64 -mbig" to gcc flags.

But the build fails on the link edition:

 ====== Building slof ======
make -C slof BOARD=qemu PLATFORM= FLAG="-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " TARG=ppc64 RELEASE=-DRELEASE=\"\\\"git-749c50b84b83a9b9\\\"\"
make[2]: Entering directory `/home/lvivier/SLOF/board-qemu/slof'
gcc -m64 -mbig -mabi=elfv1 -T/home/lvivier/SLOF/slof/OF.lds /home/lvivier/SLOF/slof/ofw.o version.o paflof.o helpers.o allocator.o \
/home/lvivier/SLOF/slof/entry.o romfs.o OF.o nvramlog.o /home/lvivier/SLOF/board-qemu/llfw/board_io.o \
/home/lvivier/SLOF/board-qemu/llfw/io_generic_lib.o -static -nostdlib -Wl,-q,-n /home/lvivier/SLOF/lib/libbootmsg.a /home/lvivier/SLOF/lib/libelf.a /home/lvivier/SLOF/lib/libhvcall.a /home/lvivier/SLOF/lib/libvirtio.a /home/lvivier/SLOF/lib/libusb.a /home/lvivier/SLOF/lib/libnvram.a /home/lvivier/SLOF/lib/libveth.a /home/lvivier/SLOF/lib/libe1k.a /home/lvivier/SLOF/lib/libc.a -o paflof
/home/lvivier/SLOF/slof/ofw.o:(.slof.loader+0x5c): undefined reference to `.patch_broken_sc1'

$ file /home/lvivier/SLOF/slof/ofw.o
/home/lvivier/SLOF/slof/ofw.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped

patch_broken_sc1 is in libhvcall:
$ nm lib/libhvcall/brokensc1.o|grep patch
0000000000000000 D patch_broken_sc1
$ file lib/libhvcall/brokensc1.o
lib/libhvcall/brokensc1.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. git clone git://git.qemu-project.org/SLOF.git
2. cd SLOF
3. make V=2 qemu

Actual results:

Error: undefined reference to `.patch_broken_sc1'

Expected results:

Build slof without error.

Additional info:

It seems that "gcc" adds "--oformat elf32-powerpc" in case of "-mbig" even if the target is 64bit:

    %{mlittle|mlittle-endian:;mbig|mbig-endian: --oformat elf32-powerpc;mcall-i960-old:;:}

If we remove the "-mbig" from the command line, all works fine as ld will use for output format the same as the input format (elf64-powerpc).

This can be related to BZ1279172, and this patch should fix this one too:
Comment 2 Jakub Jelinek 2016-05-03 12:31:49 EDT
This stuff got removed in http://gcc.gnu.org/r227397
and has been backported to 5 branch in r228089.
Comment 4 Michael Petlan 2016-07-25 05:51:11 EDT
test fails with gcc-4.8.5-4.el7.ppc64le
test passes for gcc-4.8.5-9.el7.ppc64le

Comment 6 errata-xmlrpc 2016-11-04 02:27:27 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.