* [U-Boot] standalone-examples: support custom GCC lib
@ 2013-07-16 13:44 Jack Mitchell
2013-07-16 13:44 ` [U-Boot] [PATCH] " Jack Mitchell
2013-07-17 7:11 ` Albert ARIBAUD
0 siblings, 2 replies; 6+ messages in thread
From: Jack Mitchell @ 2013-07-16 13:44 UTC (permalink / raw)
To: u-boot
Fighting with compiling u-boot today and dealing with problems related
to using a custom built openembedded toolchain, I found the need to
specify a custom location for the GCC lib.
This is well supported when building u-boot, but my compile was failing
in the standalone examples, as there was no support for a custom GCC lib
in the standalone examples Makefile.
I am no toolchain or u-boot expert, and as such to avoid the firey pits
of flamewar hell, this is an RFC ;)
--
Jack Mitchell (jack at embed.me.uk)
Embedded Systems Engineer
http://www.embed.me.uk
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] standalone-examples: support custom GCC lib
2013-07-16 13:44 [U-Boot] standalone-examples: support custom GCC lib Jack Mitchell
@ 2013-07-16 13:44 ` Jack Mitchell
2013-09-06 21:24 ` [U-Boot] " Tom Rini
2013-09-10 13:55 ` Tom Rini
2013-07-17 7:11 ` Albert ARIBAUD
1 sibling, 2 replies; 6+ messages in thread
From: Jack Mitchell @ 2013-07-16 13:44 UTC (permalink / raw)
To: u-boot
From: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
Add support for defining the gcc lib in standalone examples as is
done in the main u-boot Makefile
Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
---
examples/standalone/Makefile | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index baaa2fb..b1be527 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -68,7 +68,18 @@ ELF := $(addprefix $(obj),$(ELF))
BIN := $(addprefix $(obj),$(BIN))
SREC := $(addprefix $(obj),$(SREC))
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
+# Add GCC lib
+ifdef USE_PRIVATE_LIBGCC
+ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
+PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
+else
+PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
+endif
+else
+PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+endif
+PLATFORM_LIBS += $(PLATFORM_LIBGCC)
+export PLATFORM_LIBS
CPPFLAGS += -I..
@@ -98,7 +109,7 @@ $(ELF):
$(obj)%: $(obj)%.o $(LIB)
$(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
- -L$(gcclibdir) -lgcc
+ $(PLATFORM_LIBS)
$(SREC):
$(obj)%.srec: $(obj)%
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] standalone-examples: support custom GCC lib
2013-07-16 13:44 [U-Boot] standalone-examples: support custom GCC lib Jack Mitchell
2013-07-16 13:44 ` [U-Boot] [PATCH] " Jack Mitchell
@ 2013-07-17 7:11 ` Albert ARIBAUD
2013-07-17 8:31 ` Jack Mitchell
1 sibling, 1 reply; 6+ messages in thread
From: Albert ARIBAUD @ 2013-07-17 7:11 UTC (permalink / raw)
To: u-boot
Hi Jack,
On Tue, 16 Jul 2013 14:44:22 +0100, Jack Mitchell
<ml@communistcode.co.uk> wrote:
> Fighting with compiling u-boot today and dealing with problems related
> to using a custom built openembedded toolchain, I found the need to
> specify a custom location for the GCC lib.
>
> This is well supported when building u-boot, but my compile was failing
> in the standalone examples, as there was no support for a custom GCC lib
> in the standalone examples Makefile.
>
> I am no toolchain or u-boot expert, and as such to avoid the firey pits
> of flamewar hell, this is an RFC ;)
... which wasn't tagged '[RFC]', apparently. :)
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] standalone-examples: support custom GCC lib
2013-07-17 7:11 ` Albert ARIBAUD
@ 2013-07-17 8:31 ` Jack Mitchell
0 siblings, 0 replies; 6+ messages in thread
From: Jack Mitchell @ 2013-07-17 8:31 UTC (permalink / raw)
To: u-boot
On 17/07/13 08:11, Albert ARIBAUD wrote:
> Hi Jack,
>
> On Tue, 16 Jul 2013 14:44:22 +0100, Jack Mitchell
> <ml@communistcode.co.uk> wrote:
>
>> Fighting with compiling u-boot today and dealing with problems related
>> to using a custom built openembedded toolchain, I found the need to
>> specify a custom location for the GCC lib.
>>
>> This is well supported when building u-boot, but my compile was failing
>> in the standalone examples, as there was no support for a custom GCC lib
>> in the standalone examples Makefile.
>>
>> I am no toolchain or u-boot expert, and as such to avoid the firey pits
>> of flamewar hell, this is an RFC ;)
>
> ... which wasn't tagged '[RFC]', apparently. :)
>
> Amicalement,
>
The great plans of mice and men, huh? I intended for the RFC tag to go
on, but in all my excitement it was forgotten.
--
Jack Mitchell (jack at embed.me.uk)
Embedded Systems Engineer
http://www.embed.me.uk
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] standalone-examples: support custom GCC lib
2013-07-16 13:44 ` [U-Boot] [PATCH] " Jack Mitchell
@ 2013-09-06 21:24 ` Tom Rini
2013-09-10 13:55 ` Tom Rini
1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2013-09-06 21:24 UTC (permalink / raw)
To: u-boot
On Tue, Jul 16, 2013 at 02:44:23PM +0100, Jack Mitchell wrote:
> From: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
>
> Add support for defining the gcc lib in standalone examples as is
> done in the main u-boot Makefile
>
> Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130906/5221462a/attachment.pgp>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] standalone-examples: support custom GCC lib
2013-07-16 13:44 ` [U-Boot] [PATCH] " Jack Mitchell
2013-09-06 21:24 ` [U-Boot] " Tom Rini
@ 2013-09-10 13:55 ` Tom Rini
1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2013-09-10 13:55 UTC (permalink / raw)
To: u-boot
On Tue, Jul 16, 2013 at 02:44:23PM +0100, Jack Mitchell wrote:
> From: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
>
> Add support for defining the gcc lib in standalone examples as is
> done in the main u-boot Makefile
>
> Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
>
> ---
> examples/standalone/Makefile | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
> index baaa2fb..b1be527 100644
> --- a/examples/standalone/Makefile
> +++ b/examples/standalone/Makefile
> @@ -68,7 +68,18 @@ ELF := $(addprefix $(obj),$(ELF))
> BIN := $(addprefix $(obj),$(BIN))
> SREC := $(addprefix $(obj),$(SREC))
>
> -gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
> +# Add GCC lib
> +ifdef USE_PRIVATE_LIBGCC
> +ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
> +PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
> +else
> +PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
> +endif
> +else
> +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
> +endif
> +PLATFORM_LIBS += $(PLATFORM_LIBGCC)
> +export PLATFORM_LIBS
We already inherit this logic from the top level Makefile, so this leads
to duplicating $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o in PLATFORM_LIBS.
Second, currently for ARM, libgcc.o ends up requring 'hang' to be
provided.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130910/220241f1/attachment.pgp>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-10 13:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16 13:44 [U-Boot] standalone-examples: support custom GCC lib Jack Mitchell
2013-07-16 13:44 ` [U-Boot] [PATCH] " Jack Mitchell
2013-09-06 21:24 ` [U-Boot] " Tom Rini
2013-09-10 13:55 ` Tom Rini
2013-07-17 7:11 ` Albert ARIBAUD
2013-07-17 8:31 ` Jack Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox