[syslinux] LDFLAGS and distro overrides

Igor Sverkos igor.sverkos at googlemail.com
Thu Jul 11 15:22:35 PDT 2013


Hi,

Matt Fleming:
> This just came up on IRC,
>
> 15:01 < chithead> the first one that fails is ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E --hash-style=gnu -T /var/tmp/portage/sys-boot/syslinux-6.01_pre5/work/syslinux-6.01-pre5/core/i386/syslinux.ld -M -o ldlinux.elf ldlinux.o \
> 15:01 < chithead>         --start-group libcom32.a --whole-archive /var/tmp/portage/sys-boot/syslinux-6.01_pre5/work/syslinux-6.01-pre5/bios/com32/lib/libcom32core.a libldlinux.a --end-group \
> 15:01 < chithead>         > ldlinux.map
> 15:01 < chithead> ld: unrecognized option '-Wl,-O1'
>
> Our use of $(LDFLAGS) may seem slightly unconventional within Syslinux
> in that we don't pass it to GCC, but pass it directly to ld. Hence the
> above error where GCC flags are being passed to ld. ArchLinux also has
> to clean up their environment before building Syslinux,
>
>   https://aur.archlinux.org/packages/sy/syslinux-firmware-git/PKGBUILD
>
> Now, for the core and .c32 modules we absolutely want to a clean build
> environment, free from any distro-specific overrides because these files
> don't execute within the usual target machine environment, and we need
> to very tightly control how they are built. However, for things like the
> installers, I can appreciate that package developers may want to build
> them with distro-specific flags.
>
> To ensure that no flags accidentally slip through when building core and
> .c32 files (and still allowing things to be customised when people know
> what they're doing), I'm proposing that we prefix our make variables
> with "SLX_" or something similar. This should also stop people running
> into build problems like the above IRC report.

Not sure about the status, but with syslinux-5.11-pre8 on a Gentoo box I got


ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E
--hash-style=gnu -T syslinux.ld -M -o ldlinux.elf ldlinux.o \
	--start-group libcom32.a --whole-archive ../com32/lib/libcom32core.a
libldlinux.a --end-group \
	> ldlinux.map
ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E
--hash-style=gnu -T syslinux.ld -M -o isolinux.elf isolinux.o \
	--start-group libcom32.a --whole-archive ../com32/lib/libcom32core.a
libisolinux.a --end-group \
	> isolinux.map
ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E
--hash-style=gnu -T syslinux.ld -M -o isolinux-debug.elf
isolinux-debug.o \
	--start-group libcom32.a --whole-archive ../com32/lib/libcom32core.a
libisolinux-debug.a --end-group \
	> isolinux-debug.map
ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E
--hash-style=gnu -T syslinux.ld -M -o pxelinux.elf pxelinux.o \
	--start-group libcom32.a --whole-archive ../com32/lib/libcom32core.a
libpxelinux.a --end-group \
	> pxelinux.map
ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -Bsymbolic -pie -E
--hash-style=gnu -T syslinux.ld -M -o lpxelinux.elf lpxelinux.o \
	--start-group libcom32.a --whole-archive ../com32/lib/libcom32core.a
liblpxelinux.a --end-group \
	> lpxelinux.map
ld: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
make[1]: *** [ldlinux.elf] Error 1
make[1]: *** Waiting for unfinished jobs....
ld: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
ldmake[1]: *** [isolinux.elf] Error 1
: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
make[1]: ld: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
*** [isolinux-debug.elf] Error 1
make[1]: *** [lpxelinux.elf] Error 1
ld: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
make[1]: *** [pxelinux.elf] Error 1
rm ldlinux.o isolinux.o isolinux-debug.o
make[1]: Leaving directory
`/var/tmp/portage/sys-boot/syslinux-5.11_pre8/work/syslinux-5.11-pre8/core'
make: *** [all] Error 2


After I set "filter-flags '-W*'" (a Gentoo-specific command from
Gentoo's flag-o-matic eclass) I was able to build syslinux-5.11-pre8.


-- 
Regards,
Igor


More information about the Syslinux mailing list