Bug #12016
closedUse of GNU ld should explicitly specify the required output format
100%
Description
grub and loader builds both invoke the GNU linker (gld
) during their build but assume that the linker's default output mode is 32-bit.
As distributions move towards 64-bit-by-default tooling, the required output format must be specified.
For example, on the latest OmniOS bloody, errors such as the following occur during the build:
/usr/bin/gld -g -nostdlib -N -Ttext 7C00 -o stage1.exec stage1.o /usr/bin/gld: i386 architecture of input file `stage1.o' is incompatible with i386:x86-64 output
Updated by Igor Kozhukhov over 2 years ago
i have proposed it a long time ago, but had no feedbacks:
http://cr.dilos.org/cr/igork/il-gld32/
you can try to reuse it
Updated by Andy Fiddaman over 2 years ago
I did it slightly differently, but the same idea:
Review is at: https://illumos.org/rb/r/2463/
Updated by Andy Fiddaman over 2 years ago
Testing notes.
With this patch applied, I built illumos-gate on OpenIndiana, OmniOS r151032 and OmniOS bloody.
The GNU ld (gld) binary on each of these uses the following default output format:
OpenIndiana$ gld --print-output-format elf32-i386-sol2 OmniOS-r151032% gld --print-output-format elf32-i386-sol2 OmniOS-bloody% gld --print-output-format elf64-x86-64-sol2
The build was successful in all cases.
Updated by Electric Monk over 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit f52943a93040563107b95bccb9db87d9971ef47d
commit f52943a93040563107b95bccb9db87d9971ef47d Author: Andy Fiddaman <omnios@citrus-it.co.uk> Date: 2019-11-26T15:59:35.000Z 12016 Use of GNU ld should explicitly specify the required output format Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Matthias Scheler <matthias.scheler@wdc.com> Approved by: Robert Mustacchi <rm@fingolfin.org>