Solaris build fix breaks Solaris
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
Quoted 8 lines · John Levon
16396:055d98aa2dd0 almost works but not quite.
LDFLAGS_DIRECTmeans 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.aSpecifying 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 inLDFLAGS_DIRECT: -melf_i386 is.
-- Keir
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.aSpecifying 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
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.xcon 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 directorySince 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
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
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