[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15276: libtool.m4 incorrectly resolves lt_sysroot?
From: |
Hans Beckerus |
Subject: |
bug#15276: libtool.m4 incorrectly resolves lt_sysroot? |
Date: |
Thu, 05 Sep 2013 19:59:55 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.2; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
On 2013-09-05 2:33, Hans Beckérus wrote:
Sorry for the typo in previous mail, libtool,mk should of course be
libtool.m4. Nothing else.
Thanks.
Hans
On Thu, Sep 5, 2013 at 2:19 PM, Hans Beckérus <address@hidden> wrote:
I am having problem running a SDK cross-compilation toolchain built
through Yocto.
After some digging I discovered that the root cause of the problem is
the fact that the sysroot is incorrectly resolved if --with-sysroot is
not specified when running configure. Actually in Yocto --with-sysroot
is replaced by -with-libtool-sysroot but that is irrelevant in this
case. I believe the error is in libtool.mk. Specifically the following
piece of code:
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
[AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[ --with-sysroot[=DIR] Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).],
[], [with_sysroot=no])
dnl lt_sysroot will always be passed unquoted. We quote it here
dnl in case the user passed a directory name.
lt_sysroot=
case ${with_sysroot} in #(
yes)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
AC_MSG_RESULT([${with_sysroot}])
AC_MSG_ERROR([The sysroot must be an absolute path.])
;;
esac
If --with-sysroot is *not* set it should be picked-up from the
compiler. But the switch statement above is wrong since the yes) and
no) cases are swapped.
Here is my configuration:
host-triplet: arm-poky-linux-gnueabi
shell: /bin/sh
compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a
-mthumb-interwork -mfloat-abi=softfp -mtune=cortex-a9
--sysroot=/proj/nci_up/cpri_splitter/poky-chris/1.4+snapshot/sysroots/cortexa9-vfp-poky-linux-gnueabi
compiler flags: -O2 -pipe -g -feliminate-unused-debug-types
linker: arm-poky-linux-gnueabi-ld
--sysroot=/proj/nci_up/cpri_splitter/poky-chris/1.4+snapshot/sysroots/cortexa9-vfp-poky-linux-gnueabi
(gnu? yes)
arm-poky-linux-gnueabi-libtool: (GNU libtool) 2.4.2
automake: automake (GNU automake) 1.12.6
autoconf: autoconf (GNU Autoconf) 2.69
Thanks.
Hans
Here is a patch that corrects the problem. This patch has also been sent
to Yocto for review.
Thanks.
Hans
--
diff -ur libtool-2.4.2.orig/configure libtool-2.4.2/configure
--- libtool-2.4.2.orig/configure 2013-09-05 10:37:50.982677000 +0200
+++ libtool-2.4.2/configure 2013-09-05 10:12:24.551681000 +0200
@@ -6814,7 +6814,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -6822,7 +6822,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/libltdl/configure libtool-2.4.2/libltdl/configure
--- libtool-2.4.2.orig/libltdl/configure 2013-09-05 10:37:24.738048000 +0200
+++ libtool-2.4.2/libltdl/configure 2013-09-05 10:38:44.540026000 +0200
@@ -6027,7 +6027,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -6035,7 +6035,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/libltdl/m4/libtool.m4
libtool-2.4.2/libltdl/m4/libtool.m4
--- libtool-2.4.2.orig/libltdl/m4/libtool.m4 2013-09-05 10:37:24.690013000 +0200
+++ libtool-2.4.2/libltdl/m4/libtool.m4 2013-09-05 12:05:51.560281000 +0200
@@ -1234,7 +1234,7 @@
dnl in case the user passed a directory name.
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -1242,7 +1242,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
AC_MSG_RESULT([${with_libtool_sysroot}])
diff -ur libtool-2.4.2.orig/tests/cdemo/configure
libtool-2.4.2/tests/cdemo/configure
--- libtool-2.4.2.orig/tests/cdemo/configure 2013-09-05 10:37:24.793021000 +0200
+++ libtool-2.4.2/tests/cdemo/configure 2013-09-05 10:39:01.039463000 +0200
@@ -5907,7 +5907,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5915,7 +5915,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/demo/configure
libtool-2.4.2/tests/demo/configure
--- libtool-2.4.2.orig/tests/demo/configure 2013-09-05 10:37:24.878048000 +0200
+++ libtool-2.4.2/tests/demo/configure 2013-09-05 10:39:15.357833000 +0200
@@ -5905,7 +5905,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5913,7 +5913,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/depdemo/configure
libtool-2.4.2/tests/depdemo/configure
--- libtool-2.4.2.orig/tests/depdemo/configure 2013-09-05
10:37:25.003086000 +0200
+++ libtool-2.4.2/tests/depdemo/configure 2013-09-05 10:39:33.424217000 +0200
@@ -5902,7 +5902,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5910,7 +5910,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/f77demo/configure
libtool-2.4.2/tests/f77demo/configure
--- libtool-2.4.2.orig/tests/f77demo/configure 2013-09-05
10:37:25.232029000 +0200
+++ libtool-2.4.2/tests/f77demo/configure 2013-09-05 12:02:54.749911000 +0200
@@ -6887,7 +6887,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -6895,7 +6895,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/fcdemo/configure
libtool-2.4.2/tests/fcdemo/configure
--- libtool-2.4.2.orig/tests/fcdemo/configure 2013-09-05
10:37:25.320032000 +0200
+++ libtool-2.4.2/tests/fcdemo/configure 2013-09-05 12:03:34.350859000 +0200
@@ -6986,7 +6986,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -6994,7 +6994,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/mdemo/configure
libtool-2.4.2/tests/mdemo/configure
--- libtool-2.4.2.orig/tests/mdemo/configure 2013-09-05 10:37:25.458028000 +0200
+++ libtool-2.4.2/tests/mdemo/configure 2013-09-05 12:04:04.233622000 +0200
@@ -5934,7 +5934,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5942,7 +5942,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/mdemo2/configure
libtool-2.4.2/tests/mdemo2/configure
--- libtool-2.4.2.orig/tests/mdemo2/configure 2013-09-05
10:37:25.564096000 +0200
+++ libtool-2.4.2/tests/mdemo2/configure 2013-09-05 12:04:36.688447000 +0200
@@ -5907,7 +5907,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5915,7 +5915,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/pdemo/configure
libtool-2.4.2/tests/pdemo/configure
--- libtool-2.4.2.orig/tests/pdemo/configure 2013-09-05 10:37:25.619085000 +0200
+++ libtool-2.4.2/tests/pdemo/configure 2013-09-05 12:04:50.578801000 +0200
@@ -5910,7 +5910,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -5918,7 +5918,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5
diff -ur libtool-2.4.2.orig/tests/tagdemo/configure
libtool-2.4.2/tests/tagdemo/configure
--- libtool-2.4.2.orig/tests/tagdemo/configure 2013-09-05
10:37:25.727040000 +0200
+++ libtool-2.4.2/tests/tagdemo/configure 2013-09-05 12:05:11.896353000 +0200
@@ -6926,7 +6926,7 @@
lt_sysroot=
case ${with_libtool_sysroot} in #(
- yes)
+ no)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
@@ -6934,7 +6934,7 @@
/*)
lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
;; #(
- no|'')
+ yes|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
${with_libtool_sysroot}" >&5