[PATCH] Add run path when linking with tcc, fixing bug #20622.

2015-05-22 Thread Vincent Lefevre
Add run path when linking with tcc, fixing bug #20622.

Signed-off-by: Vincent Lefevre 
---
 m4/libtool.m4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a3bc337..cb4fea3 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -5232,6 +5232,7 @@ _LT_EOF
 
case $cc_basename in
tcc*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
  ;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -5790,6 +5791,7 @@ _LT_EOF
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs 
$deplibs $compiler_flags'
+   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
   esac
   ;;
-- 
2.1.4




[PATCH 0/2] AIX: Do not rely on OBJECT_MODE env var being set.

2015-05-22 Thread Michael Haubenwallner
Hi!

While testing --with-aix-soname=[aix|both|svr4] libtool patches within gcc,
I've discovered that gcc does not set OBJECT_MODE during multilib build.
Instead, the only settings done are: CC='xgcc -maix64' CXX='xg++ -maix64',
besides AR="$AR -X32_64" NM="$NM -X32_64" - which feels like a workaround
anyway and would be necessary for LD, STRIP and RANLIB too.

However, I've found some ABI-specific LD-flags settings in _LT_ENABLE_LOCK,
but that would be too late for checking "the name lister ($NM) interface".
Besides that, _LT_ENABLE_LOCK feels suboptimal anyway as the place to set
the ABI-specific tool flags based on created object's file type.

So I would like to introduce _LT_SET_TOOL_ABI_FLAG(TOOL, [TOOLVAR]) macro
(patch 2/2), doing something useful for power*-*-aix* for now, but designed
to adopt similar settings from _LT_ENABLE_LOCK by subsequent refactorings.

Thanks!
/haubi/



[PATCH 1/2] Fix func_echo_all inside configure.

2015-05-22 Thread Michael Haubenwallner
* m4/libtool.m4 (func_echo_all): Properly get $* through m4.
---
 m4/libtool.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a3bc337..c42a418 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1218,7 +1218,7 @@ fi
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-$ECHO "$*"
+$ECHO "@S|@*"
 }
 
 case $ECHO in
-- 
2.0.5




[PATCH 2/2] AIX: Do not rely on OBJECT_MODE env var being set.

2015-05-22 Thread Michael Haubenwallner
To compile 64-bit, AIX toolchain provides support to set the environment
variable OBJECT_MODE=64, to avoid the need for changing anything else in
the build environment. However, gcc ignores OBJECT_MODE, and does not
set it while building gcc itself during its multi-lib build either.
Also, CC may be some wrapper to operate in 64-bit mode. So we cannot
rely on OBJECT_MODE being set to properly support 64-bit builds.

Instead, we better identify the object mode in use by looking at the
file type of an object file generated by CC, to properly set the
commandline flags for additional tools used within libtool. While there
is similar code for LD in _LT_ENABLE_LOCK, this is too late for NM.

* m4/libtool.m4 (_LT_CACHE_CHECK_OBJECT_FILE_TYPE): New. Provides object
file type identified using /usr/bin/file.
(_LT_PREPARE_TOOLS_ABI_FLAGS): New. Defines func_set_tool_abi_flag.
Define AIX specific ABI flags for LD, AR, NM, STRIP, RANLIB.
Set AIX_OBJECT_MODE as well.
(_LT_SET_TOOL_ABI_FLAG): New. Uses func_set_tool_abi_flag to set host
specific ABI flags into tool commands.
(_LT_PROG_AR): Use _LT_SET_TOOL_ABI_FLAG.
(LT_PATH_LD): Ditto.
(LT_PATH_NM): Ditto.
(_LT_CMD_OLD_ARCHIVE): Use _LT_SET_TOOL_ABI_FLAG for STRIP, RANLIB.
(_LT_LINKER_SHLIBS): Use AIX_OBJECT_MODE.
(_LT_LANG_CXX_CONFIG): Ditto.
* m4/ltoptions.m4 (_LT_WITH_AIX_SONAME): Ditto.
---
 m4/libtool.m4   | 84 ++---
 m4/ltoptions.m4 |  3 ++-
 2 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index c42a418..7421075 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1177,6 +1177,79 @@ fi
 ])# _LT_SYS_MODULE_PATH_AIX
 
 
+# _LT_CACHE_CHECK_OBJECT_FILE_TYPE
+# 
+# Compiles a minimal program and identifies the file type of that object file.
+# All object files linked together in one build configuration have to be of
+# the same object file type.  As we always need the C compiler anyway, there
+# is no point in checking object file types per TAG.
+m4_defun([_LT_CACHE_CHECK_OBJECT_FILE_TYPE],
+[AC_REQUIRE([AC_PROG_CC])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+AC_CACHE_CHECK([$CC object file type], [lt_cv_object_file_type],
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+[echo "$as_me:$LINENO: LC_ALL=C /usr/bin/file conftest.$ac_objext" 
>&AS_MESSAGE_LOG_FD
+lt_cv_object_file_type=`LC_ALL=C /usr/bin/file conftest.$ac_objext 
2>&AS_MESSAGE_LOG_FD`
+ac_status=$?
+func_echo_all "$lt_cv_object_file_type" >&AS_MESSAGE_LOG_FD
+func_echo_all "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+lt_cv_object_file_type=`func_echo_all "$lt_cv_object_file_type" | $SED -e 
"s/^conftest\.$ac_objext:  *//"`
+])
+  ])
+]) # _LT_CACHE_CHECK_OBJECT_FILE_TYPE
+
+
+# _LT_PREPARE_TOOLS_ABI_FLAGS
+# ---
+m4_defun([_LT_PREPARE_TOOLS_ABI_FLAGS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+# func_set_tool_abi_flag TOOL [TOOLVAR]
+# Ensure that TOOL-specific command in $TOOL (or $TOOLVAR if specified) does
+# contain $lt_abi_flag_TOOL (if defined below) as standalone argument.
+# Does nothing if $TOOL (or $TOOLVAR) is empty.
+func_set_tool_abi_flag () {
+  eval "AS_CASE([\" \@S|@@S|@{2-@S|@1}  \"],
+  ['   '],
+[# command is empty
+],
+  [*\" \@S|@lt_abi_flag_@S|@1 \"*],
+[# standalone flag found, or flag is empty
+],
+[@S|@{2-@S|@1}=\"\@S|@@S|@{2-@S|@1} \@S|@lt_abi_flag_@S|@1\"]
+  )"
+}
+
+# PORTME Define flags for various tools to accept the ABI selected by
+# '$CC $CFLAGS $CPPFLAGS'.
+case $host in
+power*-*-aix4.[[3-9]]* | power*-aix[[5-9]]*)
+  _LT_CACHE_CHECK_OBJECT_FILE_TYPE
+  case $ac_status:$lt_cv_object_file_type in
+  0:*64-bit*) AIX_OBJECT_MODE=64 ;;
+  0:*"RISC System/6000"*) AIX_OBJECT_MODE=32 ;;
+  *) AC_MSG_FAILURE([failed to check $CC generated ABI]) ;;
+  esac
+  lt_abi_flag_LD=-b$AIX_OBJECT_MODE
+  lt_abi_flag_AR=-X$AIX_OBJECT_MODE
+  lt_abi_flag_NM=-X$AIX_OBJECT_MODE
+  lt_abi_flag_STRIP=-X$AIX_OBJECT_MODE
+  lt_abi_flag_RANLIB=-X$AIX_OBJECT_MODE
+  ;;
+esac
+]) # _LT_PREPARE_TOOLS_ABI_FLAGS
+
+
+# _LT_SET_TOOL_ABI_FLAG(TOOL, [TOOLVAR])
+# 
+# Ensure to be defined, and call: func_set_tool_abi_flag TOOL TOOLVAR
+m4_defun([_LT_SET_TOOL_ABI_FLAG],
+[m4_require([_LT_PREPARE_TOOLS_ABI_FLAGS])dnl
+func_set_tool_abi_flag $1 $2
+]) # _LT_SET_TOOL_ABI_FLAG
+
+
 # _LT_SHELL_INIT(ARG)
 # ---
 m4_define([_LT_SHELL_INIT],
@@ -1285,7 +1358,7 @@ m4_defun([_LT_ENABLE_LOCK],
 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
-# libtool support.
+# libtool support. Should move to _LT_PREPARE_TOOLS_ABI_FLAGS.
 case $host in
 ia64-*-hpux*)
   # Find out what ABI is being produced by ac_compile, and set mode
@@ -1494,6 +1567,7 @@ m4_defun([_LT_PROG_AR],
 [AC_CHECK_TOOLS(AR, [ar], false)
 : ${AR=ar}

[patch #8675] elftoolchain strip support

2015-05-22 Thread Xin Li
URL:
  

 Summary: elftoolchain strip support
 Project: GNU Libtool
Submitted by: delphij
Submitted on: Sat 23 May 2015 12:20:56 AM GMT
Category: None
Priority: 7 - High
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Currently libtool does not properly detect elftoolchain's version of strip(1).
 The proposed patch fixes this.



___

File Attachments:


---
Date: Sat 23 May 2015 12:20:56 AM GMT  Name:
0001-Support-elftoolchain-strip.patch  Size: 906B   By: delphij
Proposed patch


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/