Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Makefile: Set default emulation for MIPS64/MIPS64el n64
@ 2013-05-17 19:42 Markos Chandras
  2013-05-18 17:31 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Markos Chandras @ 2013-05-17 19:42 UTC (permalink / raw)
  To: buildroot

From: Markos Chandras <markos.chandras@imgtec.com>

binutils set the default emulation for MIPS64/MIPS64el to
elf32btsmipn32 and elf32ltsmipn3 respectively. This breaks
linking for programs calling the linker directly without passing
the appropriate emulation parameter (-m). Unfortunately,
binutils do not provide a way to set the default emulation when
building the linker therefore we export the LDEMULATION variable
to set the preferred emulation ourselves. This fixes

http://autobuild.buildroot.net/results/0f2a760b94069ac915d856cd1ae1998e5483807a/

and possibly other build failures as well.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 5d2a7ae..d80d12d 100644
--- a/Makefile
+++ b/Makefile
@@ -354,6 +354,10 @@ ifeq ($(BR2_ECLIPSE_REGISTER),y)
 TARGETS+=toolchain-eclipse-register
 endif
 
+ifeq ($(BR2_MIPS_NABI64),y)
+export LDEMULATION=elf64btsmip
+endif
+
 include fs/common.mk
 
 TARGETS+=target-post-image
-- 
1.8.2.1

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

* [Buildroot] [PATCH] Makefile: Set default emulation for MIPS64/MIPS64el n64
  2013-05-17 19:42 [Buildroot] [PATCH] Makefile: Set default emulation for MIPS64/MIPS64el n64 Markos Chandras
@ 2013-05-18 17:31 ` Thomas Petazzoni
  2013-05-18 17:58   ` Markos Chandras
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2013-05-18 17:31 UTC (permalink / raw)
  To: buildroot

Dear Markos Chandras,

On Fri, 17 May 2013 20:42:40 +0100, Markos Chandras wrote:
> From: Markos Chandras <markos.chandras@imgtec.com>
> 
> binutils set the default emulation for MIPS64/MIPS64el to
> elf32btsmipn32 and elf32ltsmipn3 respectively. This breaks
> linking for programs calling the linker directly without passing
> the appropriate emulation parameter (-m). Unfortunately,
> binutils do not provide a way to set the default emulation when
> building the linker therefore we export the LDEMULATION variable
> to set the preferred emulation ourselves. This fixes
> 
> http://autobuild.buildroot.net/results/0f2a760b94069ac915d856cd1ae1998e5483807a/
> 
> and possibly other build failures as well.

I am not sure this is the right fix for the problem. I believe the
problem is that the external toolchain wrapper should also wrap "ld" in
order to pass the right arguments to select the correct emulation, just
like we have a wrapper for "gcc" to select the correct architecture,
ABI and so on.

No?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] Makefile: Set default emulation for MIPS64/MIPS64el n64
  2013-05-18 17:31 ` Thomas Petazzoni
@ 2013-05-18 17:58   ` Markos Chandras
  0 siblings, 0 replies; 3+ messages in thread
From: Markos Chandras @ 2013-05-18 17:58 UTC (permalink / raw)
  To: buildroot

On 05/18/2013 06:31 PM, Thomas Petazzoni wrote:
> Dear Markos Chandras,
> 
> On Fri, 17 May 2013 20:42:40 +0100, Markos Chandras wrote:
>> From: Markos Chandras <markos.chandras@imgtec.com>
>>
>> binutils set the default emulation for MIPS64/MIPS64el to
>> elf32btsmipn32 and elf32ltsmipn3 respectively. This breaks
>> linking for programs calling the linker directly without passing
>> the appropriate emulation parameter (-m). Unfortunately,
>> binutils do not provide a way to set the default emulation when
>> building the linker therefore we export the LDEMULATION variable
>> to set the preferred emulation ourselves. This fixes
>>
>> http://autobuild.buildroot.net/results/0f2a760b94069ac915d856cd1ae1998e5483807a/
>>
>> and possibly other build failures as well.
> 
> I am not sure this is the right fix for the problem. I believe the
> problem is that the external toolchain wrapper should also wrap "ld" in
> order to pass the right arguments to select the correct emulation, just
> like we have a wrapper for "gcc" to select the correct architecture,
> ABI and so on.
> 
> No?
> 
> Thomas
> 
Hi Thomas,

I am not sure what you mean by "external toolchain" here since this is a
problem with the buildroot toolchain as well. I probably don't
understand the solution you propose. This is a "quick and dirty" fix.
The ideal solution to this problem would be to fix the build systems to
use "gcc" instead of "ld" for linking.

-- 
Regards,
Markos Chandras

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

end of thread, other threads:[~2013-05-18 17:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17 19:42 [Buildroot] [PATCH] Makefile: Set default emulation for MIPS64/MIPS64el n64 Markos Chandras
2013-05-18 17:31 ` Thomas Petazzoni
2013-05-18 17:58   ` Markos Chandras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox