patches/binutils/2.17a/100-uclibc-conf.patch
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 55 249c47587aa4
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
yann@55
     1
diff -dur binutils-2.17.old/bfd/configure binutils-2.17/bfd/configure
yann@55
     2
--- binutils-2.17.old/bfd/configure	2006-06-23 20:17:03.000000000 +0200
yann@55
     3
+++ binutils-2.17/bfd/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
     4
@@ -3576,7 +3576,7 @@
yann@55
     5
   ;;
yann@55
     6
 
yann@55
     7
 # This must be Linux ELF.
yann@55
     8
-linux-gnu*)
yann@55
     9
+linux-gnu*|linux-uclibc*)
yann@55
    10
   lt_cv_deplibs_check_method=pass_all
yann@55
    11
   ;;
yann@55
    12
 
yann@55
    13
diff -dur binutils-2.17.old/binutils/configure binutils-2.17/binutils/configure
yann@55
    14
--- binutils-2.17.old/binutils/configure	2006-04-06 23:49:29.000000000 +0200
yann@55
    15
+++ binutils-2.17/binutils/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
    16
@@ -3411,7 +3411,7 @@
yann@55
    17
   ;;
yann@55
    18
 
yann@55
    19
 # This must be Linux ELF.
yann@55
    20
-linux-gnu*)
yann@55
    21
+linux-gnu*|linux-uclibc*)
yann@55
    22
   lt_cv_deplibs_check_method=pass_all
yann@55
    23
   ;;
yann@55
    24
 
yann@55
    25
diff -dur binutils-2.17.old/configure binutils-2.17/configure
yann@55
    26
--- binutils-2.17.old/configure	2006-04-06 23:49:25.000000000 +0200
yann@55
    27
+++ binutils-2.17/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
    28
@@ -1276,7 +1276,7 @@
yann@55
    29
   am33_2.0-*-linux*)
yann@55
    30
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
yann@55
    31
     ;;
yann@55
    32
-  sh-*-linux*)
yann@55
    33
+  sh*-*-linux*)
yann@55
    34
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
yann@55
    35
     ;;    
yann@55
    36
   sh*-*-pe|mips*-*-pe|*arm-wince-pe)
yann@55
    37
@@ -1584,7 +1584,7 @@
yann@55
    38
   romp-*-*)
yann@55
    39
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
yann@55
    40
     ;;
yann@55
    41
-  sh-*-* | sh64-*-*)
yann@55
    42
+  sh*-*-* | sh64-*-*)
yann@55
    43
     case "${host}" in
yann@55
    44
       i[3456789]86-*-vsta) ;; # don't add gprof back in
yann@55
    45
       i[3456789]86-*-go32*) ;; # don't add gprof back in
yann@55
    46
diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
yann@55
    47
--- binutils-2.17.old/configure.in	2006-06-23 20:19:53.000000000 +0200
yann@55
    48
+++ binutils-2.17/configure.in	2007-05-01 18:26:03.000000000 +0200
yann@55
    49
@@ -468,7 +468,7 @@
yann@55
    50
   am33_2.0-*-linux*)
yann@55
    51
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
yann@55
    52
     ;;
yann@55
    53
-  sh-*-linux*)
yann@55
    54
+  sh*-*-linux*)
yann@55
    55
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
yann@55
    56
     ;;    
yann@55
    57
   sh*-*-pe|mips*-*-pe|*arm-wince-pe)
yann@55
    58
@@ -776,7 +776,7 @@
yann@55
    59
   romp-*-*)
yann@55
    60
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
yann@55
    61
     ;;
yann@55
    62
-  sh-*-* | sh64-*-*)
yann@55
    63
+  sh*-*-* | sh64-*-*)
yann@55
    64
     case "${host}" in
yann@55
    65
       i[[3456789]]86-*-vsta) ;; # don't add gprof back in
yann@55
    66
       i[[3456789]]86-*-go32*) ;; # don't add gprof back in
yann@55
    67
diff -dur binutils-2.17.old/gas/configure binutils-2.17/gas/configure
yann@55
    68
--- binutils-2.17.old/gas/configure	2006-04-06 23:49:31.000000000 +0200
yann@55
    69
+++ binutils-2.17/gas/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
    70
@@ -3411,7 +3411,7 @@
yann@55
    71
   ;;
yann@55
    72
 
yann@55
    73
 # This must be Linux ELF.
yann@55
    74
-linux-gnu*)
yann@55
    75
+linux-gnu*|linux-uclibc*)
yann@55
    76
   lt_cv_deplibs_check_method=pass_all
yann@55
    77
   ;;
yann@55
    78
 
yann@55
    79
diff -dur binutils-2.17.old/gprof/configure binutils-2.17/gprof/configure
yann@55
    80
--- binutils-2.17.old/gprof/configure	2006-04-06 23:49:33.000000000 +0200
yann@55
    81
+++ binutils-2.17/gprof/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
    82
@@ -3414,6 +3414,11 @@
yann@55
    83
   lt_cv_deplibs_check_method=pass_all
yann@55
    84
   ;;
yann@55
    85
 
yann@55
    86
+linux-uclibc*)
yann@55
    87
+  lt_cv_deplibs_check_method=pass_all
yann@55
    88
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
yann@55
    89
+  ;;
yann@55
    90
+
yann@55
    91
 netbsd* | knetbsd*-gnu)
yann@55
    92
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
yann@55
    93
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
yann@55
    94
diff -dur binutils-2.17.old/ld/configure binutils-2.17/ld/configure
yann@55
    95
--- binutils-2.17.old/ld/configure	2006-04-11 12:36:26.000000000 +0200
yann@55
    96
+++ binutils-2.17/ld/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
    97
@@ -3413,7 +3413,7 @@
yann@55
    98
   ;;
yann@55
    99
 
yann@55
   100
 # This must be Linux ELF.
yann@55
   101
-linux-gnu*)
yann@55
   102
+linux-gnu*|linux-uclibc*)
yann@55
   103
   lt_cv_deplibs_check_method=pass_all
yann@55
   104
   ;;
yann@55
   105
 
yann@55
   106
diff -dur binutils-2.17.old/libtool.m4 binutils-2.17/libtool.m4
yann@55
   107
--- binutils-2.17.old/libtool.m4	2005-12-27 17:37:57.000000000 +0100
yann@55
   108
+++ binutils-2.17/libtool.m4	2007-05-01 18:26:03.000000000 +0200
yann@55
   109
@@ -739,7 +739,7 @@
yann@55
   110
   ;;
yann@55
   111
 
yann@55
   112
 # This must be Linux ELF.
yann@55
   113
-linux-gnu*)
yann@55
   114
+linux-gnu*|linux-uclibc*)
yann@55
   115
   lt_cv_deplibs_check_method=pass_all
yann@55
   116
   ;;
yann@55
   117
 
yann@55
   118
diff -dur binutils-2.17.old/ltconfig binutils-2.17/ltconfig
yann@55
   119
--- binutils-2.17.old/ltconfig	2005-07-16 04:36:38.000000000 +0200
yann@55
   120
+++ binutils-2.17/ltconfig	2007-05-01 18:26:03.000000000 +0200
yann@55
   121
@@ -602,6 +602,7 @@
yann@55
   122
 
yann@55
   123
 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
yann@55
   124
 case $host_os in
yann@55
   125
+linux-uclibc*) ;;
yann@55
   126
 linux-gnu*) ;;
yann@55
   127
 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
yann@55
   128
 esac
yann@55
   129
@@ -1247,7 +1248,7 @@
yann@55
   130
   ;;
yann@55
   131
 
yann@55
   132
 # This must be Linux ELF.
yann@55
   133
-linux-gnu*)
yann@55
   134
+linux-gnu*|linux-uclibc*)
yann@55
   135
   version_type=linux
yann@55
   136
   need_lib_prefix=no
yann@55
   137
   need_version=no
yann@55
   138
diff -dur binutils-2.17.old/opcodes/configure binutils-2.17/opcodes/configure
yann@55
   139
--- binutils-2.17.old/opcodes/configure	2006-02-17 15:36:28.000000000 +0100
yann@55
   140
+++ binutils-2.17/opcodes/configure	2007-05-01 18:26:03.000000000 +0200
yann@55
   141
@@ -3579,7 +3579,7 @@
yann@55
   142
   ;;
yann@55
   143
 
yann@55
   144
 # This must be Linux ELF.
yann@55
   145
-linux-gnu*)
yann@55
   146
+linux-gnu*|linux-uclibc*)
yann@55
   147
   lt_cv_deplibs_check_method=pass_all
yann@55
   148
   ;;
yann@55
   149