diff mbox

dependencies: Add host prerequisite for elf2flt

Message ID 1378282615.12336.1.camel@phoenix
State Rejected
Headers show

Commit Message

Axel Lin Sept. 4, 2013, 8:16 a.m. UTC
This ensures elf2flt will be built when BR2_PACKAGE_HOST_ELF2FLT=y before
building other packages.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
I don't have a blackfin platform, only test build this for blackfin.
Without this patch, the first time build will result in ELF binary because
busybox is built before elf2flt.
With this path, the result looks good, it produces BFLT executable for busybox.

 support/dependencies/dependencies.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thomas Petazzoni Sept. 4, 2013, 8:51 a.m. UTC | #1
Dear Axel Lin,

On Wed, 04 Sep 2013 16:16:55 +0800, Axel Lin wrote:
> This ensures elf2flt will be built when BR2_PACKAGE_HOST_ELF2FLT=y before
> building other packages.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> I don't have a blackfin platform, only test build this for blackfin.
> Without this patch, the first time build will result in ELF binary because
> busybox is built before elf2flt.
> With this path, the result looks good, it produces BFLT executable for busybox.

I don't think host-elf2flt should be added at this level of dependency.
If I understand correctly elf2flt, it interfaces with the linker, so I
believe making elf2flt a dependency of binutils would probably make a
bit more sense.

Best regards,

Thomas
Gustavo Zacarias Sept. 4, 2013, 10:34 a.m. UTC | #2
On 09/04/2013 05:51 AM, Thomas Petazzoni wrote:
> I don't think host-elf2flt should be added at this level of dependency.
> If I understand correctly elf2flt, it interfaces with the linker, so I
> believe making elf2flt a dependency of binutils would probably make a
> bit more sense.

It's already done correctly in the dependency deparment...

HOST_ELF2FLT_DEPENDENCIES = host-binutils host-zlib

The problem is it's never pulled in when it's necessary - before the
real packages start building, so adding it up as a gcc dep when
BR2_BINFMT_FLAT=y would be appropiate.

Regards.
Thomas Petazzoni Sept. 4, 2013, 11:19 a.m. UTC | #3
Dear Gustavo Zacarias,

On Wed, 04 Sep 2013 07:34:34 -0300, Gustavo Zacarias wrote:
> On 09/04/2013 05:51 AM, Thomas Petazzoni wrote:
> > I don't think host-elf2flt should be added at this level of dependency.
> > If I understand correctly elf2flt, it interfaces with the linker, so I
> > believe making elf2flt a dependency of binutils would probably make a
> > bit more sense.
> 
> It's already done correctly in the dependency deparment...
> 
> HOST_ELF2FLT_DEPENDENCIES = host-binutils host-zlib

What I was suggesting is that host-elf2flt should have been a
dependency of host-binutils. But that's obviously wrong, since elf2flt
requires the libbfd library I suspect.

> The problem is it's never pulled in when it's necessary - before the
> real packages start building, so adding it up as a gcc dep when
> BR2_BINFMT_FLAT=y would be appropiate.

Indeed. If it's not needed during the gcc build, one solution is to add
its as a dependency in host-gcc-final.

Thomas
Gustavo Zacarias Sept. 4, 2013, 11:27 a.m. UTC | #4
On 09/04/2013 08:19 AM, Thomas Petazzoni wrote:

>> HOST_ELF2FLT_DEPENDENCIES = host-binutils host-zlib
> 
> What I was suggesting is that host-elf2flt should have been a
> dependency of host-binutils. But that's obviously wrong, since elf2flt
> requires the libbfd library I suspect.

Yes that's true, the order would be binutils -> elf2flt -> gcc -> world
domination.

> Indeed. If it's not needed during the gcc build, one solution is to add
> its as a dependency in host-gcc-final.

It's needed for some uClibc combination, link-flat.so which uses elf2flt
pulls in libgcc according to uclibc/Makerules (used in
uclibc/libc/Makefile.in).
I think it's safer to pull it in for gcc-intermediate or even gcc-initial.
Regards.
Thomas Petazzoni Sept. 4, 2013, 11:34 a.m. UTC | #5
Dear Gustavo Zacarias,

On Wed, 04 Sep 2013 08:27:17 -0300, Gustavo Zacarias wrote:

> > Indeed. If it's not needed during the gcc build, one solution is to add
> > its as a dependency in host-gcc-final.
> 
> It's needed for some uClibc combination, link-flat.so which uses elf2flt
> pulls in libgcc according to uclibc/Makerules (used in
> uclibc/libc/Makefile.in).
> I think it's safer to pull it in for gcc-intermediate or even gcc-initial.

gcc-intermediate is going to be skipped in some situations after my
patch "[PATCHv2 03/14] toolchain-internal: skip gcc-intermediate when
possible" is merged.

So, as a dependency of gcc-initial seems like a better choice.

Thanks,

Thomas
Gustavo Zacarias Sept. 4, 2013, 12:14 p.m. UTC | #6
On 09/04/2013 09:13 AM, Thomas De Schampheleire wrote:

> I know little about this flat format, but isn't it possible to use an
> external toolchain and still want flat binaries?

Yes, an example is the blackfin external toolchain.
elf2flt is shipped with said toolchains so it's not related if that's
your concern.
Regards.
Thomas De Schampheleire Sept. 4, 2013, 12:14 p.m. UTC | #7
Op 4-sep.-2013 13:35 schreef "Thomas Petazzoni" <
thomas.petazzoni@free-electrons.com> het volgende:
>
> Dear Gustavo Zacarias,
>
> On Wed, 04 Sep 2013 08:27:17 -0300, Gustavo Zacarias wrote:
>
> > > Indeed. If it's not needed during the gcc build, one solution is to
add
> > > its as a dependency in host-gcc-final.
> >
> > It's needed for some uClibc combination, link-flat.so which uses elf2flt
> > pulls in libgcc according to uclibc/Makerules (used in
> > uclibc/libc/Makefile.in).
> > I think it's safer to pull it in for gcc-intermediate or even
gcc-initial.
>
> gcc-intermediate is going to be skipped in some situations after my
> patch "[PATCHv2 03/14] toolchain-internal: skip gcc-intermediate when
> possible" is merged.
>
> So, as a dependency of gcc-initial seems like a better choice.

I know little about this flat format, but isn't it possible to use an
external toolchain and still want flat binaries?

Best regards,
Thomas
Thomas De Schampheleire Sept. 4, 2013, 12:16 p.m. UTC | #8
Op 4-sep.-2013 14:14 schreef "Gustavo Zacarias" <gustavo@zacarias.com.ar>
het volgende:
>
> On 09/04/2013 09:13 AM, Thomas De Schampheleire wrote:
>
> > I know little about this flat format, but isn't it possible to use an
> > external toolchain and still want flat binaries?
>
> Yes, an example is the blackfin external toolchain.
> elf2flt is shipped with said toolchains so it's not related if that's
> your concern.

Ok thanks. That was indeed my concern...

Best regards,
Thomas
diff mbox

Patch

diff --git a/support/dependencies/dependencies.mk b/support/dependencies/dependencies.mk
index 4a220e0..3b8ea31 100644
--- a/support/dependencies/dependencies.mk
+++ b/support/dependencies/dependencies.mk
@@ -24,6 +24,10 @@  ifeq ($(BR2_CCACHE),y)
 DEPENDENCIES_HOST_PREREQ += host-ccache
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_ELF2FLT),y)
+DEPENDENCIES_HOST_PREREQ += host-elf2flt
+endif
+
 core-dependencies:
 	@HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
 		DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \