summaryrefslogtreecommitdiffstats
path: root/patches/03_ld-fix-tests-on-busybox-ash.patch
blob: 250a32a3208c974a31d8cffad47cf3dc9da7d94d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Author: "P. J. McDermott" <pj@pehjota.net>
Subject: ld: Fix tests on BusyBox ash

BusyBox ash doesn't recognize the delimeter ("EOF") of a here-document
unless it's followed by a newline character.

So, running the test suite with /bin/sh linked to busybox results in the
following errors with ld's tests (note the "EOF: not found" errors):

    Test Run By root on Mon Dec  9 02:21:30 2013
    Native configuration is x86_64-unknown-linux-gnu
    
                    === ld tests ===
    
    Schedule of variations:
        unix
    
    Running target unix
    Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
    Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
    Using /usr/src/binutils_2.23.2-1/tmp/src/ld/testsuite/config/default.exp as tool-and-target-specific interface file.
    ERROR: tcl error sourcing tool-and-target-specific interface file /usr/src/binutils_2.23.2-1/tmp/src/ld/testsuite/config/default.exp.
    Error getting native link files: -dynamic-linker /lib/core-linux-eglibc/ld-linux-x86-64.so.2 /usr/lib/core-linux-eglibc/crt1.o /usr/lib/core-linux-eglibc/crti.o /usr/lib/core-linux-eglibc/gcc-4.7/crtbegin.o
    sh: eval: line 2: EOF: not found
    Error getting native link files: -dynamic-linker /lib/core-linux-eglibc/ld-linux-x86-64.so.2 /usr/lib/core-linux-eglibc/crt1.o /usr/lib/core-linux-eglibc/crti.o /usr/lib/core-linux-eglibc/gcc-4.7/crtbegin.o
    sh: eval: line 2: EOF: not found
        while executing
    "error "Error getting native link files: $result" "
        invoked from within
    "if $status { error "Error getting native link files: $result" }"
        invoked from within
    "if ![info exists $varname] {
            #configure.host returns variables that can be substituted into
            #makefile rules, with embedded shell variable expansions..."
        (procedure "get_link_files" line 6)
        invoked from within
    "get_link_files $x"
        ("foreach" body line 2)
        invoked from within
    "foreach x {HOSTING_CRT0 HOSTING_LIBS} {
            get_link_files $x
        }"
        invoked from within
    "if [isnative] {
        foreach x {HOSTING_CRT0 HOSTING_LIBS} {
            get_link_files $x
        }
    } else {
        foreach x {HOSTING_CRT0 HOSTING_LIBS} { set $x "" }
    ..."
        (file "/usr/src/binutils_2.23.2-1/tmp/src/ld/testsuite/config/default.exp" line 141)
        invoked from within
    "source /usr/src/binutils_2.23.2-1/tmp/src/ld/testsuite/config/default.exp"
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 source /usr/src/binutils_2.23.2-1/tmp/src/ld/testsuite/config/default.exp"
        invoked from within
    "catch "uplevel #0 source ${dir}/${initfile}" error"

diff -Naur src.orig/ld/testsuite/config/default.exp src/ld/testsuite/config/default.exp
--- src.orig/ld/testsuite/config/default.exp	2012-03-14 21:57:57.000000000 -0400
+++ src/ld/testsuite/config/default.exp	2013-12-08 23:32:51.502069716 -0500
@@ -119,7 +119,7 @@
 	#configure.host returns variables that can be substituted into
 	#makefile rules, with embedded shell variable expansions.
 	#make wants $$shell_var, we want $shell_var ...
-	set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <<EOF\n\$$varname\nEOF"
+	set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <<EOF\n\$$varname\nEOF\n"
 	set status [catch "exec sh -c [list $cmd]" result]
 	if $status { error "Error getting native link files: $result" }
 	set cmd "CC='$CC' && eval echo \"$result\""