Re: [PATCH 1/2] Use POSIX nm to simplify AIX export_symbols_cmds.

2016-03-19 Thread David Edelsohn
I agree with this in principle, but I'm not convinced that the patch
itself is correct.

I also would have split the MS-compatible part of the patch as a
separate step.  It is not listed in the ChangeLog and just confuses
the patch.

I don't see that this emits TLS symbols.  Global TLS symbols are not
in the symcode list.

Global symbol pipe and exclude symbols somehow restricts the symbols
to the non "dot" symbols?

The export_symbols_cmds awk command does not have matching quotes, so
I don't know what is going on.

awk '\''{ kw = "" } /^[[VWZ]] / { kw = " weak" } { print $ 3 kw }'\''

you're starting and ending with '\" which seems odd. why aren't these
complementary?

Thanks, David

On Wed, Mar 2, 2016 at 11:19 AM, Michael Haubenwallner
 wrote:
> * m4/libtool.m4 (LT_PATH_NM): Detect POSIX-compatible nm for AIX.  In
> BSD mode, the AIX nm does not tell whether a symbol is weak, need to use
> POSIX mode instead.
> (_LT_CMD_GLOBAL_SYMBOLS): Support POSIX-compatible nm.  Reorder to allow
> for platform specific hooks during transformation of global_symbol_pipe
> into C source code.  For AIX, set hook to transform even weak text
> symbols as text symbols.
> (_LT_LINKER_SHLIBS): Use global_symbol_pipe to simplify forming the
> export_symbols_cmds for AIX.
> ---
>  m4/libtool.m4 | 101 
> --
>  1 file changed, 55 insertions(+), 46 deletions(-)
>
> diff --git a/m4/libtool.m4 b/m4/libtool.m4
> index 2c0e657..6134522 100644
> --- a/m4/libtool.m4
> +++ b/m4/libtool.m4
> @@ -3755,10 +3755,10 @@ _LT_DECL([], [want_nocaseglob], [1],
>
>  # LT_PATH_NM
>  # --
> -# find the pathname to a BSD- or MS-compatible name lister
> +# find the pathname to a BSD-, POSIX- or MS-compatible name lister
>  AC_DEFUN([LT_PATH_NM],
>  [AC_REQUIRE([AC_PROG_CC])dnl
> -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
> +AC_CACHE_CHECK([for BSD-, POSIX- or MS-compatible name lister (nm)], 
> lt_cv_path_NM,
>  [if test -n "$NM"; then
># Let the user override the test.
>lt_cv_path_NM=$NM
> @@ -3808,6 +3808,26 @@ else
>: ${lt_cv_path_NM=no}
>  fi])
>  if test no != "$lt_cv_path_NM"; then
> +  case $host_os in
> +  aix[[4-9]]*)
> +# With AIX nm we need the '-l' flag to get the "weak" information
> +# for the Import File, but '-l' is ignored with the '-B' flag.  So
> +# we use the '-P' (POSIX) flag instead.  As users often provide the
> +# '-B' flag, which conflicts with '-P', we drop any provided flag.
> +# AIX nm needs the '-C' flag to disable demangling.  For both GNU
> +# and AIX nm, the '-g' flag shows public (global) symbols only,
> +# and the '-p' flag disables sorting to improve performance.
> +set dummy $lt_cv_path_NM
> +case `@S|@2 -V 2>&1` in
> +*GNU* | *'with BFD'*)
> +  lt_cv_path_NM="@S|@2 -Bgp"
> +  ;;
> +*)
> +  lt_cv_path_NM="@S|@2 -PlCgp"
> +  ;;
> +esac
> +;;
> +  esac
>NM=$lt_cv_path_NM
>  else
># Didn't find any BSD compatible name lister, look for dumpbin.
> @@ -3832,7 +3852,7 @@ fi
>  test -z "$NM" && NM=nm
>  _LT_SET_TOOL_ABI_FLAG([NM])
>  AC_SUBST([NM])
> -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
> +_LT_DECL([], [NM], [1], [A BSD-, POSIX- or MS-compatible name lister])dnl
>
>  AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
>[lt_cv_nm_interface="BSD nm"
> @@ -3847,6 +3867,8 @@ AC_CACHE_CHECK([the name lister ($NM) interface], 
> [lt_cv_nm_interface],
>cat conftest.out >_MESSAGE_LOG_FD
>if $GREP 'External.*some_variable' conftest.out > /dev/null; then
>  lt_cv_nm_interface="MS dumpbin"
> +  elif $GREP '^[[   ]]*_*some_variable' conftest.out > /dev/null; then
> +lt_cv_nm_interface="POSIX nm"
>fi
>rm -f conftest*])
>  ])# LT_PATH_NM
> @@ -4012,8 +4034,33 @@ symcode='[[BCDEGRST]]'
>  # Regexp to match symbols that can be accessed directly from C.
>  sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
>
> +if test "$lt_cv_nm_interface" = "MS dumpbin"; then
> +  # Gets list of data symbols to import.
> +  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
> +  # Adjust the below global symbol transforms to fixup imported variables.
> +  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char 
> \1;/p'"
> +  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
> +  lt_c_name_lib_hook="\
> +  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
> +  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
> +else
> +  # Disable hooks by default.
> +  lt_cv_sys_global_symbol_to_import=
> +  lt_cdecl_hook=
> +  lt_c_name_hook=
> +  lt_c_name_lib_hook=
> +fi
> +
>  # Define system-specific variables.
>  case $host_os in
> +aix[[4-9]]*)
> +  case `$NM -V 2>&1` in
> +  *GNU* | *'with BFD'*) ;;
> +  *)
> +symcode='[[BDLTVWZ]]'
> +lt_cdecl_hook=" -e 's/^W/T/p'" # weak text symbol
> +  esac
> +  ;;
>  aix*)
>  

ping (regression fix) [PATCH] bump gl-mod/bootstrap for AIX sed

2016-03-19 Thread Michael Haubenwallner
Hi Pavel,

This one actually fixes a regression with AIX sed,
bumping the gl-mod/bootstrap module to include
https://github.com/gnulib-modules/bootstrap/commit/3395ec04c42ab16ccbee05941f5b6ccee5907fdc

See attached testsuite.log for testcase "54: standard command line options"
failing since
  commit 08c5524fb24b923ad91c2bdca836f1eafa56fd6c
  Author: Pavel Raiskup 
  Date:   Tue Feb 23 00:38:39 2016 +0100

  bootstrap: use the upstream repo as git module

Thanks!
/haubi/

On 03/15/2016 12:23 PM, Michael Haubenwallner wrote:
> gl-mod/bootstrap: Update.
> bootstrap: Recreate.


# -*- compilation -*-
54. help.at:26: testing standard command line options ...
/tools/haubi/src/libtool-2.4.6.34-08c5/tests/help.at:30: $LIBTOOLIZE --help
stdout:
Usage: 
/tools/haubi/src/test-libtool-2.4.6.34-08c5/gcc-g++-32bit-rtlaix-trad/build/libtoolize
 [OPTION]...

Prepare a package to use libtool.

Options:
   -c, --copy  copy files rather than symlinking them
   --debug enable verbose shell tracing
   -n, --dry-run   print commands rather than running them
   -f, --force replace existing files
   -i, --install   copy missing auxiliary files
   --ltdl[=DIR]install libltdl sources [default: libltdl]
   --no-warnings   equivalent to '-Wnone'
   --nonrecursive  prepare ltdl for non-recursive make
   -q, --quiet work silently
   --recursive prepare ltdl for recursive make
   --subprojectprepare ltdl to configure and build independently
   -v, --verbose   verbosely report processing
   --version   print version information and exit
   -W, --warnings=CATEGORY
   report the warnings falling in CATEGORY [all]
   -h, --help  print short or long help message


Warning categories include:
   'all'  show all warnings
   'none' turn off all the warnings
   'error'warnings are treated as fatal errors
   'environment'   show warnings about LIBTOOLIZE_OPTIONS content
   'file'  show warnings about file copying and linking

The following space or comma delimited options can be passed to libtoolize
via the environment variable LIBTOOLIZE_OPTIONS, unknown environment
options are ignored:

   --debug enable verbose shell tracing
   --no-warnings   don't display warning messages
   --quiet work silently
   --verbose   verbosely report processing

You must 'cd' to the top directory of your package before you run
'libtoolize'.

When reporting a bug, please describe a test case to reproduce it and
include the following information:

   host-triplet:   powerpc-ibm-aix7.1.1.0
   version:libtoolize (GNU libtool) 2.4.6.34-08c5
   automake:   
   autoconf:   

Report bugs to .
GNU libtool home page: .
General help using GNU software: .
/tools/haubi/src/libtool-2.4.6.34-08c5/tests/help.at:31: $LIBTOOLIZE --version
0a1
> sed: The label :fwd2blank is greater than eight characters.
stdout:
libtoolize (GNU libtool) 2.4.6.34-08c5
/tools/haubi/src/libtool-2.4.6.34-08c5/tests/help.at:31: exit code was 2, 
expected 0
54. help.at:26: 54. standard command line options (help.at:26): FAILED 
(help.at:31)


avoid issues if CP, MV or RM are predefined in the execution environment

2016-03-19 Thread Richard PALO
Please see problem report and submitted patches 
https://savannah.gnu.org/support/index.php?108987
It would be great if these could be included in the upcoming release.

Currently, and since many years, pkgsrc has patched libtool to simply 'unset' 
CP, MV & RM

This patchset 'fixes' the use as documented, that is to respect the environment 
if these variables
are set, but naturally -- if set -- they will be just the path to the tool and 
as such can in no
way expect that '-f' is specified (which is '--force' under the Gnu flavours of 
these tools).
-- 
Richard PALO