[syslinux] Compiling extlinux statically

Gene Cumm gene.cumm at gmail.com
Sat Aug 8 08:50:10 PDT 2015


On Sat, Aug 8, 2015 at 10:32 AM, Adam Baxter via Syslinux
<syslinux at zytor.com> wrote:
> Hi,
> I'm trying to build extlinux statically, but no matter what CFLAGS or
> OPTFLAGS I set in the Makefiles I get bios/extlinux/extlinux: ELF 64-bit
> LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared
> libs), for GNU/Linux 2.6.24,
> BuildID[sha1]=ef970f59a48b226b2397b73a56e02a73b79c5f0a, not stripped
>
>
> I have tried adding OPTFLAGS= -static to the extlinux/Makefile as well as
> linux/Makefile but I'm obviously missing something.
>
> What flags do I need, and where?

diff --git a/extlinux/Makefile b/extlinux/Makefile
index 02d1db5..aac8208 100644
--- a/extlinux/Makefile
+++ b/extlinux/Makefile
@@ -52,7 +52,7 @@ spotless: clean
 installer: extlinux

 extlinux: $(OBJS)
-       $(CC) $(LDFLAGS) -o $@ $^
+       $(CC) $(LDFLAGS) -o $@ $^ -static

 strip:
        $(STRIP) extlinux


$ ldd bios/extlinux/extlinux
        not a dynamic executable

-- 
-Gene


More information about the Syslinux mailing list