Skip to contentSkip to conversation

Solaris build fix breaks Solaris

DISCUSSION John Levon 2 participants 6 messages Nov 12, 2007 – Nov 13, 2007

lore
Share & tools
lore

John Levon

author
#0 lore raw

16396:055d98aa2dd0 almost works but not quite. LDFLAGS_DIRECT means we end up with:

gld -melf_i386 -nostdlib -N -Ttext 0x100000 -o hvmloader.tmp hvmloader.o mp_tables.o util.o smbios.o 32bitbios_support.o acpi/acpi.a

Specifying a linker script and asking for -nostdlib is obviously contradictory. Removing $(LDFLAGS_DIRECT) fixes the problem.

regards
john

#1 lore raw
Quoted 8 lines · John Levon

16396:055d98aa2dd0 almost works but not quite. LDFLAGS_DIRECT means we end up with:

gld -melf_i386 -nostdlib -N -Ttext 0x100000 -o hvmloader.tmp hvmloader.o mp_tables.o util.o smbios.o 32bitbios_support.o acpi/acpi.a

Specifying a linker script and asking for -nostdlib is obviously contradictory. Removing $(LDFLAGS_DIRECT) fixes the problem.

That command line doesn't specify a linker script. And even if it did, how would that contradict -nostdlib? Also the -nostdlib is not in
LDFLAGS_DIRECT: -melf_i386 is.

-- Keir

author
#2 lore raw
Quoted 9 lines · Keir Fraser
Quoted 5 lines

gld -melf_i386 -nostdlib -N -Ttext 0x100000 -o hvmloader.tmp hvmloader.o mp_tables.o util.o smbios.o 32bitbios_support.o acpi/acpi.a

Specifying a linker script and asking for -nostdlib is obviously contradictory. Removing $(LDFLAGS_DIRECT) fixes the problem.

That command line doesn't specify a linker script. And even if it did, how would that contradict -nostdlib? Also the -nostdlib is not in
LDFLAGS_DIRECT: -melf_i386 is.

-melf_i386 translates to using an internal script, specifically /usr/sfw/i386-pc-solaris2.11/lib/ldscripts/elf_i386.xc on Solaris. Clearly -nostdlib means it can't be used, so it cannot find the relevant script and gives up:

hatchback:~ $ gld -nostdlib -melf_i386 a.o
gld: cannot open linker script file ldscripts/elf_i386.xc: No such file or directory

Since the -nostdlib is presumably there for a reason, the correct fix seems to be to remove $(LDFLAGS_DIRECT), right?

regards
john

#3 lore raw
Quoted 7 lines · John Levon

On Tue, Nov 13, 2007 at 05:00:03AM +0000, Keir Fraser wrote:

-melf_i386 translates to using an internal script, specifically /usr/sfw/i386-pc-solaris2.11/lib/ldscripts/elf_i386.xc on Solaris. Clearly -nostdlib means it can't be used, so it cannot find the relevant script and gives up:

Quoted 6 lines

hatchback:~ $ gld -nostdlib -melf_i386 a.o
gld: cannot open linker script file ldscripts/elf_i386.xc: No such file or directory

Since the -nostdlib is presumably there for a reason, the correct fix seems to be to remove $(LDFLAGS_DIRECT), right?

Huh, okay. Well actually I think -nostdlib is overkill. I didn't add it originally, and I hadn't realised that all it does is kill some default library paths. Xen itself is linked without -nostdlib, for example.

I'll just kill uses of -nostdlib.

-- Keir

#4 lore raw
Quoted 9 lines · Keir Fraser
Quoted 1 line · John Levon

On Tue, Nov 13, 2007 at 05:00:03AM +0000, Keir Fraser wrote:

Huh, okay. Well actually I think -nostdlib is overkill. I didn't add it originally, and I hadn't realised that all it does is kill some default library paths. Xen itself is linked without -nostdlib, for example.

I'll just kill uses of -nostdlib.

Oh, I see, it is needed when linking 'raw' binaries with gcc, but not with gld. I expect it was on a few gcc command lines, and I didn't remove it when we started changing over to use gld directly.

-- Keir

author
#5 lore raw
Quoted 8 lines · Keir Fraser
Quoted 8 lines · John Levon
Quoted 2 lines · Keir Fraser

Huh, okay. Well actually I think -nostdlib is overkill. I didn't add it originally, and I hadn't realised that all it does is kill some default library paths. Xen itself is linked without -nostdlib, for example.

Quoted 5 lines
Quoted 1 line

I'll just kill uses of -nostdlib.

Oh, I see, it is needed when linking 'raw' binaries with gcc, but not with gld. I expect it was on a few gcc command lines, and I didn't remove it when we started changing over to use gld directly.

Ah, makes sense. Thanks for the fix

regards
john