#3616 closed defect (fixed)

[patch] rtems-tools - elftoolchain native elf detection broken on x86_64 machines

Reported by: Christian Spindeldreier Owned by: Christian Spindeldreier <spindeldreier@…>
Priority: high Milestone: Indefinite
Component: tool/rsb Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The native elf detection script of rtems-tools (rtems-tools/rtemstoolkit/elftoolchain/common/native-elf-format) does not recognize the host string "x86_64" as EM_X86_64. It expects the string x86-64.

The attached patch fixes this issue that causes the rtems-source-builder build process to abort.

The issue was observed on ubuntu 16.04.5 and ubuntu 18.04.1 (both x86_64) when trying to build the 5/rtems-arm target of rtems-source-builder (master). Manually adding the patch to rtems-tools-5-1.cfg recipe fixed the issue.

%patch add rtems-tools file://rtems-tools_fix-native-elf-detection-on-x86_64-machines.patch

Attachments (1)

rtems-tools_fix-native-elf-detection-on-x86_64-machines.patch (952 bytes) - added by Christian Spindeldreier on 11/25/18 at 10:27:10.

Download all attachments as: .zip

Change History (8)

comment:1 Changed on 11/23/18 at 16:20:28 by Christian Spindeldreier

While trying to add the patch file, i got the the following trac error:

IndexError: pop from empty list

caused by the GET operation on /attachment/ticket/3616/

Last edited on 11/23/18 at 17:59:43 by Christian Spindeldreier (previous) (diff)

comment:2 Changed on 11/23/18 at 16:23:37 by Christian Spindeldreier

rtems-tools_fix-native-elf-detection-on-x86_64-machines.patch

  • rtemstoolkit/elftoolchain/common/native-elf-format

    From 6697c53638439a883097f7729746d9103c981a6a Mon Sep 17 00:00:00 2001
    From: Christian Spindeldreier <spindeldreier@ims.uni-hannover.de>
    Date: Fri, 23 Nov 2018 16:29:31 +0100
    Subject: [PATCH] fix native elf detection on x86_64 machines
    
    ---
     rtemstoolkit/elftoolchain/common/native-elf-format | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/rtemstoolkit/elftoolchain/common/native-elf-format b/rtemstoolkit/elftoolchain/common/native-elf-format
    index 7ebaaa8..7a5ca5b 100755
    a b $1 ~ "Machine:" { 
    3939            elfarch = "EM_386";
    4040        } else if (match($0, "MIPS")) {
    4141            elfarch = "EM_MIPS";
    42         } else if (match($0, ".*[xX]86-64")) {
     42        } else if (match($0, ".*[xX]86[-_]64")) {
    4343            elfarch = "EM_X86_64";
    4444        } else {
    4545            elfarch = "unknown";

comment:3 Changed on 11/25/18 at 00:28:00 by Amar Takhar

Hello, is your language set to English or another one? If it is not English please try setting it to that and re-submit it appears to be a bug within the template system in trac see #3617

comment:4 Changed on 11/25/18 at 00:31:37 by Chris Johns

Can you please send the patch to the elftoolchain project as well?

https://sourceforge.net/p/elftoolchain/tickets/

comment:5 in reply to:  3 Changed on 11/25/18 at 10:29:18 by Christian Spindeldreier

Replying to Amar Takhar:

Hello, is your language set to English or another one? If it is not English please try setting it to that and re-submit it appears to be a bug within the template system in trac see #3617

I changed my language to english and uploaded the patch file, thank you for the advice.

comment:6 in reply to:  4 Changed on 11/25/18 at 10:53:06 by Christian Spindeldreier

Replying to Chris Johns:

Can you please send the patch to the elftoolchain project as well?

https://sourceforge.net/p/elftoolchain/tickets/

The patch is now submitted to the elftoolchain project
https://sourceforge.net/p/elftoolchain/tickets/564/

comment:7 Changed on 11/27/18 at 06:02:51 by Christian Spindeldreier <spindeldreier@…>

Owner: set to Christian Spindeldreier <spindeldreier@…>
Resolution: fixed
Status: newclosed

In 97dc555/rtems-tools:

fix native elf detection on x86_64 machines

Closes #3616

Note: See TracTickets for help on using tickets.