[Buildroot] [PATCH 1/1] package/swupdate: fix build issue with some toolchains
Jörg Krause
joerg.krause at embedded.rocks
Tue Oct 27 08:04:02 UTC 2015
Dear Thomas,
On Mo, 2015-10-26 at 23:04 +0100, Thomas Petazzoni wrote:
> Dear Jörg Krause,
>
> On Mon, 26 Oct 2015 22:15:51 +0100, Jörg Krause wrote:
>
> > +# Using 'ld' directly for the 'builtin-target' in Makefile.build
> > to compile a
> > +# set of object files into one object file does not work for some
> > toolchains
> > +# (x86_64 and mips64) leading to different kind of relocation
> > errors. By
> > +# passing the below values for 'LD' and 'ldflags-y', we ensure
> > that 'gcc' is
> > +# used to compile the 'builtin-target' target.
> > define SWUPDATE_BUILD_CMDS
> > - $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
> > + $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D) \
> > + LD="$(TARGET_CC)" ldflags-y="-Wl,-r -nostdlib"
> > endef
>
> But shouldn't upstream be fixed to use gcc instead of ld? Using ld
> directly is normally not a good idea.
On second thought, yes.
swupdate uses simplified Kbuild files from the Linux Kernel so I was
not sure about touching the existing Makefiles. But there are some
benefits to prefer gcc over ld for partial linking.
I'll prepare a patch for upstream. Usually, Stefano (swupdate
maintainer) reviews patches near-time. If he accepts, we can backport
from upstream, right?
Best regards
Jörg Krause
More information about the buildroot
mailing list