Bug 1279172 - When linking ppc64le objects on ppc64 host, gcc produces a ppc32le binary.
When linking ppc64le objects on ppc64 host, gcc produces a ppc32le binary.
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
ppc64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-11-08 06:18 EST by Laurent Vivier
Modified: 2016-12-20 10:31 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 10:31:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
backport of r228089 to fedora gcc RPM package (1.50 KB, patch)
2015-11-08 06:20 EST, Laurent Vivier
no flags Details | Diff

  None (edit)
Description Laurent Vivier 2015-11-08 06:18:36 EST
Description of problem:

I was trying to build a ppc64le kernel on a ppc64 host, all the kernel builds well, except the VDSO64 part. The difference here is the VDSO64 part is linked using gcc instead of ld.

The folloxing command is used to link:

gcc -mlittle-endian -m64 -Wl,-T -Wl,elf64lppc ...

and it fails:

 VDSO64L arch/powerpc/kernel/vdso64/vdso64.so.dbg
/usr/bin/powerpc64-linux-gnu-ld: arch/powerpc/kernel/vdso64/sigtramp.o:
file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/powerpc64-linux-gnu-ld: final link failed: File in wrong format

This is because gcc calls collect2 with:

/usr/libexec/gcc/ppc64-redhat-linux/5.1.1/collect2", [ ... "--oformat",
"elf32-powerpcle", "-m", "elf64lppc",...
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

a.c -- 8< ---------------

void _start(void)

b.c -- 8< ---------------

void b(void)

-- 8< -------------------

1- gcc -nostdlib -mlittle-endian -m64 -c -o a.o a.c
   file a.o

2- gcc -nostdlib -mlittle-endian -m64 -c -o b.o b.c
   file b.o

3- gcc -nostdlib -mlittle-endian -m64 -o c a.o b.o
   file c

Actual results:

1- file a.o
a.o: ELF 64-bit LSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped

2- file b.o
b.o: ELF 64-bit LSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped

3- file c
c: ELF 32-bit LSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, BuildID[sha1]=b1f7ec48c66453b7877818d9c6cfc153c2a0159e, not stripped

Expected results:

3- file c
c: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, BuildID[sha1]=cd2c31117165176abec8e66300775cb4ac2286c7, not stripped

Additional info:

This has been fixed upstream in gcc-6


and backported to gcc-5:

Comment 1 Laurent Vivier 2015-11-08 06:20 EST
Created attachment 1091247 [details]
backport of r228089 to fedora gcc RPM package

I've built and tested a gcc RPM with this patch and it works fine now.
Comment 2 Fedora End Of Life 2016-11-24 08:11:53 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2016-12-20 10:31:22 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

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