Use of GNU ld should explicitly specify the required output format
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 Andy Fiddaman almost 2 years ago
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 almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit f52943a93040563107b95bccb9db87d9971ef47d Author: Andy Fiddaman <firstname.lastname@example.org> Date: 2019-11-26T15:59:35.000Z 12016 Use of GNU ld should explicitly specify the required output format Reviewed by: Toomas Soome <email@example.com> Reviewed by: Matthias Scheler <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>