[syslinux] LDFLAGS and distro overrides

Matt Fleming matt at console-pimps.org
Tue Jul 2 08:28:46 PDT 2013


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.

-- 
Matt Fleming, Intel Open Source Technology Center


More information about the Syslinux mailing list