Project

General

Profile

Bug #12016

Use of GNU ld should explicitly specify the required output format

Added by Andy Fiddaman 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

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

History

#1

Updated by Igor Kozhukhov 11 months 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

#2

Updated by Andy Fiddaman 11 months ago

  • Description updated (diff)
#3

Updated by Andy Fiddaman 11 months ago

I did it slightly differently, but the same idea:

Review is at: https://illumos.org/rb/r/2463/

#4

Updated by Andy Fiddaman 11 months 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.

#5

Updated by Electric Monk 11 months 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>

Also available in: Atom PDF