All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] syslinux: Use the host compiler to build extlinux
@ 2017-09-30 23:13 Carlos Santos
  2017-09-30 23:35 ` [Buildroot] [PATCH v2] " Carlos Santos
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos Santos @ 2017-09-30 23:13 UTC (permalink / raw)
  To: buildroot

Like the utilities, it is meant to run on the host machine, hence must
be built using the host toolchain.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
Tested with the following defconfig:

BR2_x86_64=y
BR2_x86_atom=y
BR2_DL_DIR="$(HOME)/src"
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-x86-64-core2-full-2017.05-1078-g95b1dae.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_TARGET_GENERIC_GETTY_PORT="ttyS1"
BR2_ENABLE_LOCALE_WHITELIST=""
BR2_ROOTFS_OVERLAY="board/technologic/ts5x00/fs-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/pc/linux.config"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_SYSLINUX=y
BR2_TARGET_SYSLINUX_MBR=y
BR2_TARGET_SYSLINUX_EFI=y

Notice that I did not actualy use a ts5x00 board, just used its
defconfig as a base to create my configuration.
---
 ...-extlinux-Use-the-host-toolchain-to-build.patch | 60 ++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch

diff --git a/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch b/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
new file mode 100644
index 0000000000..1ce484bd93
--- /dev/null
+++ b/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
@@ -0,0 +1,60 @@
+From 9497112ff28f87ca3c12ca2191e64cdacc5bf8d6 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sat, 30 Sep 2017 19:49:55 -0300
+Subject: [PATCH] extlinux: Use the host toolchain to build.
+
+It is meant to run on the host machine, hence must be built using the
+host toolchain.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ extlinux/Makefile | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/extlinux/Makefile b/extlinux/Makefile
+index 1721ee54..5c4baa5a 100644
+--- a/extlinux/Makefile
++++ b/extlinux/Makefile
+@@ -18,16 +18,15 @@ include $(MAKEDIR)/syslinux.mk
+ 
+ OPTFLAGS = -g -Os
+ INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller
+-CFLAGS	 = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
++CFLAGS	 = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
+ 	   $(OPTFLAGS) $(INCLUDES)
+-LDFLAGS	 = 
++LDFLAGS	 = $(LDFLAGS_FOR_BUILD)
+ 
+ SRCS     = main.c \
+ 	   mountinfo.c \
+ 	   ../libinstaller/syslxmod.c \
+ 	   ../libinstaller/syslxopt.c \
+ 	   ../libinstaller/syslxcom.c \
+-	   ../libinstaller/syslxrw.c \
+ 	   ../libinstaller/setadv.c \
+ 	   ../libinstaller/advio.c \
+ 	   ../libinstaller/bootsect_bin.c \
+@@ -53,16 +52,16 @@ spotless: clean
+ installer: extlinux
+ 
+ extlinux: $(OBJS)
+-	$(CC) $(LDFLAGS) -o $@ $^
++	$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
+ 
+ strip:
+ 	$(STRIP) extlinux
+ 
+ %.o: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
+ %.i: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
+ %.s: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
+ 
+ -include .*.d
+-- 
+2.13.5
+
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux
  2017-09-30 23:13 [Buildroot] [PATCH] syslinux: Use the host compiler to build extlinux Carlos Santos
@ 2017-09-30 23:35 ` Carlos Santos
  2017-10-02 19:15   ` Thomas Petazzoni
  2018-04-01 15:48   ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Carlos Santos @ 2017-09-30 23:35 UTC (permalink / raw)
  To: buildroot

Like the utilities, it is meant to run on the host machine, hence must
be built using the host toolchain.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
Changes v1->v2
  - Patch for syslinux version 6.03 (the previous one was for the master
    branch (syslinux-6.04-pre1).
---
Tested with the following defconfig:

BR2_x86_64=y
BR2_x86_atom=y
BR2_DL_DIR="$(HOME)/src"
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-x86-64-core2-full-2017.05-1078-g95b1dae.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_TARGET_GENERIC_GETTY_PORT="ttyS1"
BR2_ENABLE_LOCALE_WHITELIST=""
BR2_ROOTFS_OVERLAY="board/technologic/ts5x00/fs-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/pc/linux.config"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_SYSLINUX=y
BR2_TARGET_SYSLINUX_MBR=y
BR2_TARGET_SYSLINUX_EFI=y

Notice that I did not actualy use a ts5x00 board, just used its
defconfig as a base to create my configuration.
---
 ...-extlinux-Use-the-host-toolchain-to-build.patch | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch

diff --git a/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch b/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
new file mode 100644
index 0000000000..62675cf6cc
--- /dev/null
+++ b/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
@@ -0,0 +1,53 @@
+From 4df2e7c0ae84bfbdba0ed285c0664aa089b38b7e Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sat, 30 Sep 2017 19:49:55 -0300
+Subject: [PATCH] extlinux: Use the host toolchain to build.
+
+It is meant to run on the host machine, hence must be built using the
+host toolchain.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ extlinux/Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/extlinux/Makefile b/extlinux/Makefile
+index 02d1db51..5c4baa5a 100644
+--- a/extlinux/Makefile
++++ b/extlinux/Makefile
+@@ -18,9 +18,9 @@ include $(MAKEDIR)/syslinux.mk
+ 
+ OPTFLAGS = -g -Os
+ INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller
+-CFLAGS	 = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
++CFLAGS	 = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
+ 	   $(OPTFLAGS) $(INCLUDES)
+-LDFLAGS	 = 
++LDFLAGS	 = $(LDFLAGS_FOR_BUILD)
+ 
+ SRCS     = main.c \
+ 	   mountinfo.c \
+@@ -52,16 +52,16 @@ spotless: clean
+ installer: extlinux
+ 
+ extlinux: $(OBJS)
+-	$(CC) $(LDFLAGS) -o $@ $^
++	$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
+ 
+ strip:
+ 	$(STRIP) extlinux
+ 
+ %.o: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
+ %.i: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
+ %.s: %.c
+-	$(CC) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
++	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
+ 
+ -include .*.d
+-- 
+2.13.5
+
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux
  2017-09-30 23:35 ` [Buildroot] [PATCH v2] " Carlos Santos
@ 2017-10-02 19:15   ` Thomas Petazzoni
  2017-10-02 20:36     ` Carlos Santos
  2018-04-01 15:48   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2017-10-02 19:15 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 30 Sep 2017 20:35:20 -0300, Carlos Santos wrote:
> Like the utilities, it is meant to run on the host machine, hence must
> be built using the host toolchain.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

It is not entirely clear if everybody agrees that "extlinux" is a host
or a target program.

Beno?t Allard, who used to work on the syslinux package in Buildroot
wrote in http://www.syslinux.org/archives/2017-April/025755.html:

"""
1. utilities required during the build (prepcore)
2. utilities meant to be run in the target operating-system (isohybrid,
  memdisk, the extlinux installer, ...)
3. utilities used to boot the operating system
"""

So he was considering the extlinux installer as a program for the
target.

A few years earlier, another person on the Buildroot mailing list, also
wanted to have the extlinux installer on the target:
http://buildroot-busybox.2317881.n4.nabble.com/syslinux-on-target-td81294.html.

So, I'm not sure. Perhaps we need a host-syslinux package to install
those utilities ?

Or perhaps I'm being too complicated here, we should just merge your
patch, and adjusts when/if someone complains ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux
  2017-10-02 19:15   ` Thomas Petazzoni
@ 2017-10-02 20:36     ` Carlos Santos
  2017-10-13 15:10       ` Carlos Santos
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos Santos @ 2017-10-02 20:36 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org, "Beno?t Allard" <benoit.allard@greenbone.net>
> Sent: Monday, October 2, 2017 4:15:47 PM
> Subject: Re: [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux

> Hello,
> 
> On Sat, 30 Sep 2017 20:35:20 -0300, Carlos Santos wrote:
>> Like the utilities, it is meant to run on the host machine, hence must
>> be built using the host toolchain.
>> 
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> 
> It is not entirely clear if everybody agrees that "extlinux" is a host
> or a target program.
> 
> Beno?t Allard, who used to work on the syslinux package in Buildroot
> wrote in http://www.syslinux.org/archives/2017-April/025755.html:
> 
> """
> 1. utilities required during the build (prepcore)
> 2. utilities meant to be run in the target operating-system (isohybrid,
>  memdisk, the extlinux installer, ...)
> 3. utilities used to boot the operating system
> """
> 
> So he was considering the extlinux installer as a program for the
> target.
> 
> A few years earlier, another person on the Buildroot mailing list, also
> wanted to have the extlinux installer on the target:
> http://buildroot-busybox.2317881.n4.nabble.com/syslinux-on-target-td81294.html.
> 
> So, I'm not sure. Perhaps we need a host-syslinux package to install
> those utilities ?
> 
> Or perhaps I'm being too complicated here, we should just merge your
> patch, and adjusts when/if someone complains ?

Well, there is a chicken-egg problem here because extlinux is a boot
loader so you must have it installed on the target partition in order to
be able to boot.

On embedded systems this made on the host machine, manipulating the
disk image (which was exactly the problem I had when I needed to use
extlinux).

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux
  2017-10-02 20:36     ` Carlos Santos
@ 2017-10-13 15:10       ` Carlos Santos
  0 siblings, 0 replies; 6+ messages in thread
From: Carlos Santos @ 2017-10-13 15:10 UTC (permalink / raw)
  To: buildroot

> From: "Carlos Santos" <casantos@datacom.ind.br>
> To: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> Cc: "Beno?t Allard" <benoit.allard@greenbone.net>, buildroot at buildroot.org
> Sent: Monday, October 2, 2017 5:36:39 PM
> Subject: Re: [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux

>> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
>> To: "Carlos Santos" <casantos@datacom.ind.br>
>> Cc: buildroot at buildroot.org, "Beno?t Allard" <benoit.allard@greenbone.net>
>> Sent: Monday, October 2, 2017 4:15:47 PM
>> Subject: Re: [Buildroot] [PATCH v2] syslinux: Use the host compiler to build
>> extlinux
> 
>> Hello,
>> 
>> On Sat, 30 Sep 2017 20:35:20 -0300, Carlos Santos wrote:
>>> Like the utilities, it is meant to run on the host machine, hence must
>>> be built using the host toolchain.
>>> 
>>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>> 
>> It is not entirely clear if everybody agrees that "extlinux" is a host
>> or a target program.
>> 
>> Beno?t Allard, who used to work on the syslinux package in Buildroot
>> wrote in http://www.syslinux.org/archives/2017-April/025755.html:
>> 
>> """
>> 1. utilities required during the build (prepcore)
>> 2. utilities meant to be run in the target operating-system (isohybrid,
>>  memdisk, the extlinux installer, ...)
>> 3. utilities used to boot the operating system
>> """
>> 
>> So he was considering the extlinux installer as a program for the
>> target.
>> 
>> A few years earlier, another person on the Buildroot mailing list, also
>> wanted to have the extlinux installer on the target:
>> http://buildroot-busybox.2317881.n4.nabble.com/syslinux-on-target-td81294.html.
>> 
>> So, I'm not sure. Perhaps we need a host-syslinux package to install
>> those utilities ?
>> 
>> Or perhaps I'm being too complicated here, we should just merge your
>> patch, and adjusts when/if someone complains ?
> 
> Well, there is a chicken-egg problem here because extlinux is a boot
> loader so you must have it installed on the target partition in order to
> be able to boot.
> 
> On embedded systems this made on the host machine, manipulating the
> disk image (which was exactly the problem I had when I needed to use
> extlinux).

Quick follow-up.

Commit 8e0d4118982ae5a29e462f0a476d82772459cf5c moved the helper programs
to the host and 8e0d4118982ae5a29e462f0a476d82772459cf5c removed the host
variant of the package, so looks like the original goal was to make
extlinux a host utility, since it is installed at $(HOST_DIR)/sbin/.

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] syslinux: Use the host compiler to build extlinux
  2017-09-30 23:35 ` [Buildroot] [PATCH v2] " Carlos Santos
  2017-10-02 19:15   ` Thomas Petazzoni
@ 2018-04-01 15:48   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-04-01 15:48 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 30 Sep 2017 20:35:20 -0300, Carlos Santos wrote:
> Like the utilities, it is meant to run on the host machine, hence must
> be built using the host toolchain.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> Changes v1->v2
>   - Patch for syslinux version 6.03 (the previous one was for the master
>     branch (syslinux-6.04-pre1).
> ---
> Tested with the following defconfig:

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-01 15:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30 23:13 [Buildroot] [PATCH] syslinux: Use the host compiler to build extlinux Carlos Santos
2017-09-30 23:35 ` [Buildroot] [PATCH v2] " Carlos Santos
2017-10-02 19:15   ` Thomas Petazzoni
2017-10-02 20:36     ` Carlos Santos
2017-10-13 15:10       ` Carlos Santos
2018-04-01 15:48   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.