Benoît Allard
2017-Jun-30 09:44 UTC
[syslinux] [PATCH v2 0/4] Allow cross-building of syslinux
Hi together, this is the second version of my cross-compilation patch serie. I'm sending it in the hope to get an honest review, and possibly see the patches integrated upstream. Those patches allow to build syslinux using a toolchain different from the host one by explicitely using the host toolchain for the utilities that are required at build-time / on the build machine. I am using the XX_FOR_BUILD environment variables for that, which is a common practice for projects using autoconf. Those patches are originally written for the buildroot project, and you can browse them anytime on the project repository [0]. Until a release come out that render them useless of course. Best Regards, Ben. [0] https://git.busybox.net/buildroot/tree/boot/syslinux Beno?t Allard (4): memdisk: Force ld output format to 32-bits utils: Use the host toolchain to build. lzo: Use the host toolchain for prepcore efi/wrapper: build it with the host toolchain. efi/Makefile | 2 +- lzo/Makefile | 7 +++++-- memdisk/Makefile | 2 +- utils/Makefile | 12 ++++++------ 4 files changed, 13 insertions(+), 10 deletions(-) -- 2.1.4
Benoît Allard
2017-Jun-30 09:44 UTC
[syslinux] [PATCH v2 1/4] memdisk: Force ld output format to 32-bits
On toolchains where the default output is x86_64, we need to be consistent with the other .o files Signed-off-by: Beno?t Allard <benoit.allard at greenbone.net> --- memdisk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memdisk/Makefile b/memdisk/Makefile index 42e56e0..ccd5738 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -78,7 +78,7 @@ memdisk16.o: memdisk16.asm $(NASM) -f bin $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $< memdisk_%.o: memdisk_%.bin - $(LD) -r -b binary -o $@ $< + $(LD) --oformat elf32-i386 -r -b binary -o $@ $< memdisk16.elf: $(OBJS16) $(LD) -Ttext 0 -o $@ $^ -- 2.1.4
Benoît Allard
2017-Jun-30 09:44 UTC
[syslinux] [PATCH v2 2/4] utils: Use the host toolchain to build.
The utilities are meant to run on the host machine, hence must be built using the host toolchain. Signed-off-by: Beno?t Allard <benoit.allard at greenbone.net> --- utils/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/Makefile b/utils/Makefile index dfe6259..ac91aaa 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -17,8 +17,8 @@ VPATH = $(SRC) include $(MAKEDIR)/syslinux.mk -CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) -LDFLAGS = -O2 +CFLAGS = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) +LDFLAGS = $(LDFLAGS_FOR_BUILD) -O2 C_TARGETS = isohybrid gethostip memdiskfind SCRIPT_TARGETS = mkdiskimage @@ -35,7 +35,7 @@ ISOHDPFX = $(addprefix $(OBJ)/,../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin \ all: $(TARGETS) %.o: %.c - $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $< + $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $< mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl $(PERL) $(SRC)/bin2hex.pl < $(OBJ)/../mbr/mbr.bin | cat $(SRC)/mkdiskimage.in - > $@ @@ -51,13 +51,13 @@ isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl $(PERL) $(SRC)/isohdpfxarray.pl $(ISOHDPFX) > $@ isohybrid: isohybrid.o isohdpfx.o - $(CC) $(LDFLAGS) -o $@ $^ -luuid + $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ -luuid gethostip: gethostip.o - $(CC) $(LDFLAGS) -o $@ $^ + $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ memdiskfind: memdiskfind.o - $(CC) $(LDFLAGS) -o $@ $^ + $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ tidy dist: rm -f *.o .*.d isohdpfx.c -- 2.1.4
Benoît Allard
2017-Jun-30 09:44 UTC
[syslinux] [PATCH v2 3/4] lzo: Use the host toolchain for prepcore
Signed-off-by: Beno?t Allard <benoit.allard at greenbone.net> --- lzo/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lzo/Makefile b/lzo/Makefile index 29f1fa6..c016e5a 100644 --- a/lzo/Makefile +++ b/lzo/Makefile @@ -11,10 +11,13 @@ ## ----------------------------------------------------------------------- VPATH = $(SRC) -include $(MAKEDIR)/build.mk +include $(MAKEDIR)/syslinux.mk INCLUDES += -I$(SRC)/include +%.o: %.c + $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS_FOR_BUILD) $(INCLUDES) -c -o $@ $< + LIBOBJS = $(patsubst %.c,%.o,$(subst $(SRC)/,,$(sort $(wildcard $(SRC)/src/*.c)))) LIB = lzo.a BINS = prepcore @@ -30,7 +33,7 @@ $(LIB) : $(LIBOBJS) $(RANLIB) $@ prepcore : prepcore.o $(LIB) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $^ $(LIBS) tidy dist clean spotless: rm -f $(BINS) -- 2.1.4
Benoît Allard
2017-Jun-30 09:44 UTC
[syslinux] [PATCH v2 4/4] efi/wrapper: build it with the host toolchain.
Signed-off-by: Beno?t Allard <benoit.allard at greenbone.net> --- efi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/efi/Makefile b/efi/Makefile index d3788d9..a17258a 100644 --- a/efi/Makefile +++ b/efi/Makefile @@ -78,7 +78,7 @@ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS) # cp $^ $@ wrapper: wrapper.c - $(CC) $^ -o $@ + $(CC_FOR_BUILD) $^ -o $@ # # Build the wrapper app and wrap our .so to produce a .efi -- 2.1.4
Seemingly Similar Threads
- [PATCH 1/2] memdisk: Force ld output format to 32-bits
- [PATCH v2 0/4] Allow cross-building of syslinux
- [PATCH 0/2] Cross-compilation patches
- [PATCH 1/3] The VPrint definition is now part of the exports of gnu-efi
- [PATCH 2/2] utils: Use the host toolchain to build.