bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

difference between default behaviour of GNU nm and AIX nm (symbol deman


From: Laurent Vivier
Subject: difference between default behaviour of GNU nm and AIX nm (symbol demangling)
Date: Mon, 24 Jun 2002 13:17:56 +0200

Low-level symbol demangling is not made by default with GNU nm, but it
is with AIX nm.
This creates some problems when exporting symbols from libraries.

>From man pages:

GNU:

       ""-C""
       ""--demangle[=style]""
           Decode (demangle) low-level symbol  names  into  user-
           level  names.  Besides removing any initial underscore
           prepended by the system, this makes C++ function names
           readable.  Different compilers have different mangling
           styles. The optional demangling style argument can  be
           used  to  choose  an  appropriate demangling style for
           your compiler.

       ""--no-demangle""
           Do not demangle low-level symbol names.  This  is  the
           default.

AIX:

        -C Suppresses the demangling of C++ names. The default is 
        to demangle all C++ symbol names.

The proposed solution is as following:

*** ../../link/link/src/libtool/libtool.m4      Tue Sep 11 05:16:01 2001
--- libtool.m4  Mon Jun 24 10:45:34 2002
***************
*** 3471,3477 ****
        #   nm: unknown option "B" ignored
        # Tru64's nm complains that /dev/null is an invalid object file
        if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep
'(/dev/null|Invalid file or object type)' >/dev/null; then
!       lt_cv_path_NM="$tmp_nm -B"
        break
        elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep
/dev/null >/dev/null; then
        lt_cv_path_NM="$tmp_nm -p"
--- 3471,3493 ----
        #   nm: unknown option "B" ignored
        # Tru64's nm complains that /dev/null is an invalid object file
        if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep
'(/dev/null|Invalid file or object type)' >/dev/null; then
!         # AIX needs to suppress demangling for C++ to work correctly
!         # AIX nm : The default is to demangle all C++ symbol names
!         # GNU nm : The default is to not demangle low-level symbol
names.
!         case $host_os in
!         aix*)
!           # check if we are using GNU nm on AIX
!           if $tmp_nm -V 2> /dev/null | grep GNU 2>&1 > /dev/null
!           then
!             lt_cv_path_NM="$tmp_nm -B"
!           else
!             lt_cv_path_NM="$tmp_nm -BC"
!           fi
!           ;;
!         *)
!           lt_cv_path_NM="$tmp_nm -B"
!           ;;
!         esac
        break
        elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep
/dev/null >/dev/null; then
        lt_cv_path_NM="$tmp_nm -p"

-- 
-------------- Laurent Vivier ---------------
        mailto:address@hidden       
 phone: (+33) 476 29 7866  Bullcom: 229-7866
--------------BULL/FREC:B1-226---------------
When we speak of free software, we are refer-
ring to freedom, not price. (in GPL:Preamble)
-------------- BI&S/GeODE/AIX ---------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]