[pcre-dev] [Bug 1278] New: pcre 8.31 fails to link with Sun …

Página superior
Eliminar este mensaje
Autor: Dennis Clarke
Fecha:  
A: pcre-dev
Temas nuevos: [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10, [pcre-dev] [Bug 1278] pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10
Asunto: [pcre-dev] [Bug 1278] New: pcre 8.31 fails to link with Sun Studio 12 on Solaris 10 Update 10
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1278
           Summary: pcre 8.31 fails to link with Sun Studio 12 on Solaris 10
                    Update 10
           Product: PCRE
           Version: 8.31
          Platform: Sun
               URL: http://www.blastwave.org
        OS/Version: Solaris
            Status: NEW
          Severity: bug
          Priority: high
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: dclarke@???
         QAContact: dclarke@???
                CC: pcre-dev@???



So the environment is a nice new Oracle Solaris 10 box thus :

$ uname -a
SunOS node002 5.10 Generic_147440-22 sun4v sparc SUNW,T5240
$ prtconf -v | grep Memory
prtconf: devinfo facility not available
Memory size: 8192 Megabytes
$ psrinfo -pv
The physical processor has 64 virtual processors (0-63)
UltraSPARC-T2+ (chipid 0, clock 1582 MHz)
The physical processor has 64 virtual processors (64-127)
UltraSPARC-T2+ (chipid 1, clock 1582 MHz)

$ which cc
/opt/SUNWspro/bin/cc

$ cc -V
cc: Sun C 5.9 SunOS_sparc Patch 124867-16 2010/08/11
usage: cc [ options] files. Use 'cc -flags' for details

$ which CC
/opt/SUNWspro/bin/CC

$ CC -V
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-27 2011/08/09

The user environment is :

$ env | sort
AS=/usr/ccs/bin/as
CC=/opt/SUNWspro/bin/cc
CFLAGS=-erroff -xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xa
-xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -D_TS_ERRNO -ftrap=%none -Qy
-xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -D_POSIX_PTHREAD_SEMANTICS
-D_LARGEFILE64_SOURCE
COLUMNS=124
CONFIG_SHELL=/bin/bash
CPPFLAGS=-I/usr/local/include -I/usr/local/include/readline
CXX=/opt/SUNWspro/bin/CC
CXXFLAGS=-erroff -m64 -R/usr/local/lib -L/usr/local/lib -mc -xO3 -xs
-D_TS_ERRNO
EDITOR=/usr/xpg4/bin/vi
HOME=/export/home/dclarke
LANG=C
LC_ALL=C
LC_COLLATE=C
LC_CTYPE=C
LC_MESSAGES=C
LC_MONETARY=C
LC_NUMERIC=C
LC_TIME=C
LD=/usr/ccs/bin/ld
LD_LIBRARY_PATH=/usr/local/lib
LD_OPTIONS=-Qy -L/usr/local/lib
LD_RUN_PATH=/usr/local/lib/$ISALIST:/usr/local/lib
LINES=40
LOGNAME=dclarke
M4=/usr/local/bin/gm4
MAIL=/usr/mail/dclarke
MANPATH=/usr/share/man:/usr/X11/share/man
PAGER=/usr/xpg4/bin/more
PATH=/usr/local/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/bin:/sbin:/bin:/usr/sbin:/usr/dt/bin:/usr/openwin/bin:/opt/schily/bin
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
PWD=/usr/local/build/pcre-8.31_sparcv9_001
SHELL=/bin/bash
SRC=/usr/local/src
SSH_CLIENT=66.103.61.128 56173 22
SSH_CONNECTION=66.103.61.128 56173 66.225.151.250 22
SSH_TTY=/dev/pts/2
TERM=vt100
TZ=GMT0
USER=dclarke
VISUAL=/usr/xpg4/bin/vi
_=/usr/xpg4/bin/env

I will extract from the source tarball so that this is a clean test :

$ ls $SRC/pcre*
/usr/local/src/pcre-8.30.tar.gz /usr/local/src/pcre-8.31.tar.gz

$ mdigest -a sha256 /usr/local/src/pcre-8.31.tar.gz
4e1f5d462796fdf782650195050953b8503b2a2fc05c31b681c2d5d54d1f659b
/usr/local/src/pcre-8.31.tar.gz

$ sx /usr/local/src/pcre-8.31.tar.gz
star: fifo had 737 puts 602 gets.
star: fifo was 1 times empty and 0 times full.
star: fifo held 7016960 bytes max, size was 33556480 bytes
star: fifo is 0% full (8k), size 32770k.
star: 737 blocks + 0 bytes (total of 7546880 bytes = 7370.00k).
star: Total time 2.119sec (3478 kBytes/sec)

n.b.:sx is an alias

sx='/opt/schily/bin/star -x -z -xdir -xdot -U -fs=32m -fifostats -time file= '

Jorg Schillings star can extract anything from anything :-)

$ mv pcre-8.31 pcre-8.31_sparcv9_002

$ ./configure --enable-dependency-tracking --enable-pcre16 --enable-utf \
> --enable-shared --enable-static --with-link-size=4 \
> --disable-stack-for-recursion --enable-pcregrep-libz --enable-pcregrep-libbz2 \
> --with-pcregrep-bufsize=64K --enable-pcretest-libreadline --without-gnu-ld

checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gcc... /opt/SUNWspro/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking for /opt/SUNWspro/bin/cc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /opt/SUNWspro/bin/cc... dashXmstdout
checking whether we are using the GNU C++ compiler... no
checking whether /opt/SUNWspro/bin/CC accepts -g... yes
checking dependency style of /opt/SUNWspro/bin/CC... dashXmstdout
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for int64_t... yes
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for fgrep... /usr/xpg4/bin/grep -F
checking for non-GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... no
checking whether the shell understands "+="... no
checking how to convert sparc-sun-solaris2.10 file names to
sparc-sun-solaris2.10 format... func_convert_file_noop
checking how to convert sparc-sun-solaris2.10 file names to toolchain format...
func_convert_file_noop
checking for /usr/ccs/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/xpg4/bin/nm -p output from /opt/SUNWspro/bin/cc
object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking for /opt/SUNWspro/bin/cc option to produce PIC... -KPIC -DPIC
checking if /opt/SUNWspro/bin/cc PIC flag -KPIC -DPIC works... yes
checking if /opt/SUNWspro/bin/cc static flag -Bstatic works... no
checking if /opt/SUNWspro/bin/cc supports -c -o file.o... yes
checking if /opt/SUNWspro/bin/cc supports -c -o file.o... (cached) yes
checking whether the /opt/SUNWspro/bin/cc linker (/usr/ccs/bin/ld -64) supports
shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... /opt/SUNWspro/bin/CC -E
checking whether the /opt/SUNWspro/bin/CC linker (/usr/ccs/bin/ld -64) supports
shared libraries... yes
checking for /opt/SUNWspro/bin/CC option to produce PIC... -KPIC -DPIC
checking if /opt/SUNWspro/bin/CC PIC flag -KPIC -DPIC works... yes
checking if /opt/SUNWspro/bin/CC static flag -Bstatic works... no
checking if /opt/SUNWspro/bin/CC supports -c -o file.o... yes
checking if /opt/SUNWspro/bin/CC supports -c -o file.o... (cached) yes
checking whether the /opt/SUNWspro/bin/CC linker (/usr/ccs/bin/ld -64) supports
shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether ln -s works... yes
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for alias support in the linker... no
checking for alias support in the linker... yes
checking string usability... yes
checking string presence... yes
checking for string... yes
checking bits/type_traits.h usability... no
checking bits/type_traits.h presence... no
checking for bits/type_traits.h... no
checking type_traits.h usability... no
checking type_traits.h presence... no
checking for type_traits.h... no
checking for strtoq... no
checking for strtoll... yes
checking for long long... yes
checking for unsigned long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for bcopy... yes
checking for memmove... yes
checking for strerror... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzopen in -lz... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking for bzlib.h... yes
checking for libbz2... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking for readline in -lreadline... no
checking for readline in -lreadline... no
checking for readline in -lreadline... yes
-lreadline needs -lcurses
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libpcre.pc
config.status: creating libpcre16.pc
config.status: creating libpcreposix.pc
config.status: creating libpcrecpp.pc
config.status: creating pcre-config
config.status: creating pcre.h
config.status: creating pcre_stringpiece.h
config.status: creating pcrecpparg.h
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing script-chmod commands
config.status: executing delete-old-chartables commands

pcre-8.31 configuration summary:

    Install prefix .................. : /usr/local
    C preprocessor .................. : /opt/SUNWspro/bin/cc -E
    C compiler ...................... : /opt/SUNWspro/bin/cc
    C++ preprocessor ................ : /opt/SUNWspro/bin/CC -E
    C++ compiler .................... : /opt/SUNWspro/bin/CC
    Linker .......................... : /usr/ccs/bin/ld -64
    C preprocessor flags ............ : -I/usr/local/include
-I/usr/local/include/readline
    C compiler flags ................ : -erroff -xstrconst -xildoff -m64
-xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs
-D_TS_ERRNO -ftrap=%none -Qy  -xbuiltin=%none -xdebugformat=dwarf -xunroll=1
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE
    C++ compiler flags .............. : -erroff -m64 -R/usr/local/lib
-L/usr/local/lib -mc -xO3 -xs -D_TS_ERRNO
    Linker flags .................... : 
    Extra libraries ................. : 


    Build 8 bit pcre library ........ : yes
    Build 16 bit pcre library ....... : yes
    Build C++ library ............... : yes
    Enable JIT compiling support .... : no
    Enable UTF-8/16 support ......... : yes
    Unicode properties .............. : no
    Newline char/sequence ........... : lf
    \R matches only ANYCRLF ......... : no
    EBCDIC coding ................... : no
    Rebuild char tables ............. : no
    Use stack recursion ............. : no
    POSIX mem threshold ............. : 10
    Internal link size .............. : 4
    Match limit ..................... : 10000000
    Match limit recursion ........... : MATCH_LIMIT
    Build shared libs ............... : yes
    Build static libs ............... : yes
    Use JIT in pcregrep ............. : no
    Buffer size for pcregrep ........ : 8192
    Link pcregrep with libz ......... : yes
    Link pcregrep with libbz2 ....... : yes
    Link pcretest with libedit ...... : no
    Link pcretest with libreadline .. : yes



$ which gmake 
/usr/local/bin/gmake
$ 
$ gmake --version 
GNU Make 3.82
Built for sparc-sun-solaris2.10
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ 
$ gmake 
rm -f pcre_chartables.c
ln -s ./pcre_chartables.c.dist pcre_chartables.c
gmake  all-am
gmake[1]: Entering directory `/usr/local/build/pcre-8.31_sparcv9_002'
  CC     pcre_byte_order.lo
  CC     pcre_compile.lo
  CC     pcre_config.lo
  CC     pcre_dfa_exec.lo
  CC     pcre_exec.lo
  CC     pcre_fullinfo.lo
  CC     pcre_get.lo
  CC     pcre_globals.lo
  CC     pcre_jit_compile.lo
  CC     pcre_maketables.lo
  CC     pcre_newline.lo
  CC     pcre_ord2utf8.lo
  CC     pcre_refcount.lo
  CC     pcre_string_utils.lo
  CC     pcre_study.lo
  CC     pcre_tables.lo
  CC     pcre_ucd.lo
  CC     pcre_valid_utf8.lo
  CC     pcre_version.lo
  CC     pcre_xclass.lo
  CC     pcre_chartables.lo
  CCLD   libpcre.la
ld: warning: option -Q appears more than once, first setting taken
  CC     pcre16_byte_order.lo
  CC     pcre16_chartables.lo
  CC     pcre16_compile.lo
  CC     pcre16_config.lo
  CC     pcre16_dfa_exec.lo
  CC     pcre16_exec.lo
  CC     pcre16_fullinfo.lo
  CC     pcre16_get.lo
  CC     pcre16_globals.lo
  CC     pcre16_jit_compile.lo
  CC     pcre16_maketables.lo
  CC     pcre16_newline.lo
  CC     pcre16_ord2utf16.lo
  CC     pcre16_refcount.lo
  CC     pcre16_string_utils.lo
  CC     pcre16_study.lo
  CC     pcre16_tables.lo
  CC     pcre16_ucd.lo
  CC     pcre16_utf16_utils.lo
  CC     pcre16_valid_utf16.lo
  CC     pcre16_version.lo
  CC     pcre16_xclass.lo
  CCLD   libpcre16.la
ld: warning: option -Q appears more than once, first setting taken
  CC     pcreposix.lo
  CCLD   libpcreposix.la
ld: warning: option -Q appears more than once, first setting taken
  CXX    pcrecpp.lo
  CXX    pcre_scanner.lo
  CXX    pcre_stringpiece.lo
  CXXLD  libpcrecpp.la
ld: fatal: unrecognized option '-_'
ld: fatal: unrecognized option '-_'
ld: fatal: unrecognized option '-Z'
ld: fatal: use the -z help option for usage information
gmake[1]: *** [libpcrecpp.la] Error 1
gmake[1]: Leaving directory `/usr/local/build/pcre-8.31_sparcv9_002'
gmake: *** [all] Error 2
$ 


If you wonder why the "option -Q appears more than once" warnings then that is
due to :

$ echo $LD_OPTIONS
-Qy -L/usr/local/lib


Harmless as it simply adds a line in the .comment section of the ELF output and
from manpage we see :

     -Q y | n


         Under -Q y, an ident string is  added  to  the  .comment
         section  of  the output file. This string identifies the
         version of the ld used to create the file. This  results
         in  multiple  ld  idents  when  there have been multiple
         linking steps, such as when using ld -r. This  identifi-
         cation  is  identical  with the default action of the cc
         command. -Q n suppresses version  identification.  .com-
         ment sections can be manipulated by the mcs(1) utility.


Thus in the Solaris world we get helpful data like this :

$ mcs -p pcre_stringpiece.o
pcre_stringpiece.o:

@(#)stddef.h    1.18    04/09/28 SMI
@(#)isa_defs.h  1.30    11/03/31 SMI
@(#)stddef_iso.h        1.2     03/03/06 SMI
@(#)stdarg.h    1.47    04/09/28 SMI
@(#)stdarg_iso.h        1.4     04/11/19 SMI
@(#)va_impl.h   1.1     04/11/19 SMI
@(#)va_list.h   1.15    04/11/19 SMI
@(#)stdarg_c99.h        1.2     04/09/28 SMI
@(#)feature_tests.h     1.26    11/04/12 SMI
@(#)ccompile.h  1.2     04/11/08 SMI
@(#)string.h    1.27    07/01/14 SMI
@(#)string_iso.h        1.5     04/06/18 SMI
@(#)ctype.h     1.35    04/09/28 SMI
@(#)ctype_iso.h 1.3     04/09/28 SMI
@(#)ctype_c99.h 1.2     04/09/28 SMI
@(#)wchar.h     1.37    03/12/04 SMI
@(#)wchar_iso.h 1.8     04/09/28 SMI
@(#)stdio_tag.h 1.4     04/09/28 SMI
@(#)wchar_impl.h        1.3     99/07/26 SMI
@(#)time_iso.h  1.4     04/09/07 SMI
@(#)wchar_c99.h 1.3     04/03/29 SMI
@(#)wctype.h    1.19    03/12/04 SMI
@(#)wctype_iso.h        1.2     03/12/04 SMI
@(#)wctype_c99.h        1.1     03/12/04 SMI
@(#)stdlib.h    1.51    04/06/30 SMI
@(#)stdlib_iso.h        1.9     04/09/28 SMI
@(#)stdlib_c99.h        1.2     04/03/29 SMI
@(#)limits.h    1.60    11/04/12 SMI
@(#)limits_iso.h        1.2     03/12/04 SMI
@(#)int_limits.h        1.9     04/09/28 SMI
@(#)pthread.h   1.37    04/09/28 SMI
@(#)types.h     1.87    10/10/07 SMI
@(#)machtypes.h 1.13    99/05/04 SMI
@(#)int_types.h 1.10    04/09/28 SMI
@(#)select.h    1.19    04/01/28 SMI
@(#)time_impl.h 1.11    05/05/19 SMI
@(#)time.h      2.78    12/02/01 SMI
@(#)time.h      1.45    08/01/09 SMI
@(#)sched.h     1.10    03/03/06 SMI
@(#)stdio.h     1.85    11/01/07 SMI
@(#)stdio_iso.h 1.8     05/08/16 SMI
@(#)stdio_impl.h        1.15    07/03/05 SMI
@(#)stdio_c99.h 1.2     04/03/29 SMI
@(#)math.h      2.25    09/05/19 SMI
@(#)math_iso.h  1.9     04/10/23 SMI
@(#)math_c99.h  1.10    09/05/19 SMI
@(#)float.h     1.22    04/09/28 SMI


The linkage failure for libpcrecpp.la seems to be caused by this bizarre bit in
the Makefile :

EXTRA_LIBPCRE16_LDFLAGS =                          -version-info 0:1:0
EXTRA_LIBPCRECPP_LDFLAGS =  -Wl,-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE 
                          -version-info 0:0:
0
EXTRA_LIBPCREPOSIX_LDFLAGS =                               -version-info 0:1:0
EXTRA_LIBPCRE_LDFLAGS =                          -version-info 1:1:0


whatever that is, it looks horrific.

Cleaning out all the whitespace I get :

EXTRA_LIBPCRE16_LDFLAGS = -version-info 0:1:0
EXTRA_LIBPCRECPP_LDFLAGS = -Wl,-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE
-version-info 0:0:0                           
EXTRA_LIBPCREPOSIX_LDFLAGS = -version-info 0:1:0
EXTRA_LIBPCRE_LDFLAGS = -version-info 1:1:0



It looks as if we are trying ot pass the ( mildly scary )
argument '-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE' to the link
editor ld.

The first problem here is that the option -i does not mean very much to
the Solaris linker ld. The other issue is that even on GNU Linux the
-i option not be what we want.

I am going to make a guess and hope that what we are trying to do is set
the name ofthe entry point in the ELF executable or shared object to
either _ZN7pcrecpp6no_argE or maybe _ZN7pcrecpp2RE6no_argE ? I was
hoping for "_init" but who knows.

Now then what is this "-version-info " noise? That looks to be something
for libtool.

I would say that somehow the pcre makefile has junmped the shark out of
the POSIX UNIX waters and into GNU Linux land and on Solaris that simply
will not fly.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email