Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 542 forks source link

HP-UX aCC (C++) compiler: XS (swig-generated) code that compiles with 5.8.6 does not compile with 5.8.8 #9020

Closed p5pRT closed 16 years ago

p5pRT commented 17 years ago

Migrated from rt.perl.org#45199 (status was 'rejected')

Searchable as RT45199$

p5pRT commented 17 years ago

From Petr.Novotny@amdocs.com

Our swig-generated XS code compiles fine with HP-UX aCC and Perl 5.8.6. It fails to compile with 5.8.8.

The problem is collision of the symbol "seed". In version 5.8.6\, embed.h defines "seed" only if PERL_CORE is defined\, and therefore it is invisible in XS code. However\, in 5.8.8\, the protection is missing and "seed" is visible throughout the code. It collides with use of "seed" function in Rogue Wave STL implementation that is part of the aCC distribution (in particular\, in algorithm.cc header).

With 5.8.6 - successful compile. With 5.8.8 - error messages​: Warning 134​: "/opt/aCC/include_std/rw/random.h"\, line 73 # Expected 0 arguments for macro 'seed'.   seed (__seed);   ^^^^
Warning 134​: "/opt/aCC/include_std/rw/random.h"\, line 76 # Expected 0 arguments for macro 'seed'.   void seed (unsigned long __seed);   ^^^^
Error 20​: "/opt/aCC/include_std/rw/random.h"\, line 76 # '\' expected before '('.   void seed (unsigned long __seed);   ^^^^
Error 20​: "/opt/aCC/include_std/rw/random.h"\, line 76 # '[' expected before 'pthread_getspecific'.   void seed (unsigned long __seed);   ^^^^
Error 20​: "/opt/aCC/include_std/rw/random.h"\, line 76 # ']' expected before ')'.   void seed (unsigned long __seed);   ^^^^
Error 176​: "/opt/aCC/include_std/rw/random.h"\, line 76 # Size of array must be an integral constant expression of value greater than 0.   void seed (unsigned long __seed);   ^^^^

A workaround is to #undef seed after including Perl headers\, that gives us successful compilation. However\, I believe the workaround shouldn't be necessary.

-- This perlbug was built using Perl v5.8.8 - Mon Mar 20 20​:48​:34 PST 2006 It is being executed now by Perl v5.8.8 - Mon Mar 20 20​:40​:53 PST 2006.

Site configuration information for perl v5.8.8​:

Configured by ActiveState at Mon Mar 20 20​:40​:53 PST 2006.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:   Platform​:   osname=hpux\, osvers=11.00\, archname=PA-RISC2.0-thread-multi-LP64   uname='hp-ux bertha b.11.00 u 9000800 136901587 unlimited-user license '   config_args='-ders -Dcc=cc -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duse64bitall -Dd_attribut=undef -Dd_attribute_warn_unused_result=undef -Dd_u32align=define -Aprepend​:libswanted=cl -Dvendorprefix=/opt/perl_64 -Doptimize=+O2 +Onolimit +Opromote_indirect_calls -Accflags=+Z -Accflags=-DUSE_SITECUSTOMIZE -Duselargefiles -Accflags=-DNO_HASH_SEED -Dinc_version_list=5.8.7/$archname 5.8.7 5.8.6/$archname 5.8.6 5.8.4/$archname 5.8.4 5.8.3/$archname 5.8.3 5.8.2/$archname 5.8.2 5.8.1/$archname 5.8.1 5.8.0/$archname 5.8.0 -Dconfig_heavy=Config_static.pl -Dprefix=/opt/perl_64 -Dcf_by=ActiveState -Dcf_email=support@​ActiveState.com'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=define use5005threads=undef useithreads=define usemultiplicity=define   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=define use64bitall=define uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='cc'\, ccflags =' -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl\,+vnocompatwarnings +DD64 +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 '\,   optimize='+O2 +Onolimit +Opromote_indirect_calls '\,   cppflags='-Aa -D__STDC_EXT__ -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -Wl\,+vnocompatwarnings +DD64 +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED'   ccversion='B.11.X.32509-32512.GP'\, gccversion=''\, gccosandvers=''   intsize=4\, longsize=8\, ptrsize=8\, doublesize=8\, byteorder=87654321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=8\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='/usr/bin/ld'\, ldflags =' +DD64 -L/lib/pa20_64'   libpth=/lib/pa20_64 /lib /usr/lib /usr/ccs/lib /usr/local/lib   libs=-lcl -lcres -lnsl -lnm -ldl -ldld -lm -lsec -lpthread -lc   perllibs=-lcl -lcres -lnsl -lnm -ldl -ldld -lm -lsec -lpthread -lc   libc=/lib/pa20_64/libc.sl\, so=sl\, useshrplib=false\, libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_hpux.xs\, dlext=sl\, d_dlsymun=undef\, ccdlflags='-Wl\,-E -Wl\,-B\,deferred '   cccdlflags='+Z'\, lddlflags='-b +vnocompatwarnings -L/lib/pa20_64'

Locally applied patches​:   ACTIVEPERL_LOCAL_PATCHES_ENTRY   Iin_load_module moved for compatibility with build 806   Avoid signal flag SA_RESTART for older versions of HP-UX   PerlEx support in CGI​::Carp   Less verbose ExtUtils​::Install and Pod​::Find   Patch for CAN-2005-0448 from Debian with modifications   Partly reverted 24733 to preserve binary compatibilty   27528 win32_pclose() error exit doesn't unlock mutex   27527 win32_async_check() can loop indefinitely   27515 ignore directories when searching @​INC   27359 Fix -d​:Foo=bar syntax   27210 Fix quote typo in c2ph   27203 Allow compiling swigged C++ code   27200 Make stat() on Windows handle trailing slashes correctly   27194 Get perl_fini() running on HP-UX again   27133 Initialise lastparen in the regexp structure   27034 Avoid \"Prototype mismatch\" warnings with autouse   26970 Make Passive mode the default for Net​::FTP   26921 Avoid getprotobyname/number calls in IO​::Socket​::INET   26897\,26903 Make common IPPROTO_* constants always available   26670 Make '-s' on the shebang line parse -foo=bar switches   26379 Fix alarm() for Windows 2003   26087 Storable 0.1 compatibility   25861 IO​::File performace issue   25084 long groups entry could cause memory exhaustion   24699 ICMP_UNREACHABLE handling in Net​::Ping


@​INC for perl v5.8.8​:   /opt/perl_64/lib/5.8.8/PA-RISC2.0-thread-multi-LP64   /opt/perl_64/lib/5.8.8   /opt/perl_64/lib/site_perl/5.8.8/PA-RISC2.0-thread-multi-LP64   /opt/perl_64/lib/site_perl/5.8.8   /opt/perl_64/lib/site_perl   /opt/perl_64/lib/vendor_perl/5.8.8/PA-RISC2.0-thread-multi-LP64   /opt/perl_64/lib/vendor_perl/5.8.8   /opt/perl_64/lib/vendor_perl   .


Environment for perl v5.8.8​:   HOME=/pnnamdusr/pnn/test/amdwrk3   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/pnnamdusr/pnn/test/amdwrk3/appbin​:/pnnamdusr/pnn/test/amdwrk3/tlg_home/opbin​:/pnnamdusr/pnn/test/amdwrk3/appbin​:/pnnamdusr/pnn/test/amdwrk3/tlg_home/appbin​:/pnnamdusr/pnn/test/amdwrk3/tlg_home/bin​:/usr/local/bin​:/usr/bin​:/opt/ansic/bin​:/usr/ccs/bin​:/usr/contrib/bin​:/opt/hparray/bin​:/opt/nettladm/bin​:/opt/upgrade/bin​:/opt/fcms/bin​:/opt/pd/bin​:/opt/resmon/bin​:/opt/scr/bin​:/usr/bin/X11​:/usr/contrib/bin/X11​:/usr/sbin/stm/uut/bin/progs​:/opt/langtools/bin​:/opt/perf/bin​:/opt/cobol/bin​:/opt/imake/bin​:/opt/ignite/bin​:/opt/hpnp//bin​:/opt/ftam/bin​:/opt/ftam/lbin​:/opt/OV/bin/OpC​:/opt/networker/bin​:/opt/ipf/bin​:/opt/graphics/common/bin​:/opt/OpenSource/bin​:/opt/perl/bin​:/opt/sec_mgmt/spc/bin​:/opt/prospect/bin​:/opt/cadvise/bin​:/opt/aCC/bin​:/usr/vue/bin​:/bin​:.​:/oravl01/oracle/9.2.0/bin​:/pnnamdusr/pnn/test/amdwrk3/tlg_home/bin​:./​:/opt/qsel160/bin​:/opt/cobol.40/cobdir/bin​:/opt/foc68​:/opt/maestro7/maestro/bin​:/opt/plat/platinum/fuo/bin​:/opt/syncsort34/bin​:/opt/java1.3/bin   PERL_BADLANG (unset)   SHELL=/bin/ksh

-- Petr Novotný Prague Development Center\, AMDOCS +420266773112\, +420608711517 "No mercy for him who is without knowledge." - Ami ben Nathan\, Berakhot 33a

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement\, you may review at http​://www.amdocs.com/email_disclaimer.asp

p5pRT commented 17 years ago

From @jimc

Petr Novotny (via RT) wrote​:

# New Ticket Created by "Petr Novotny" # Please include the string​: [perl #45199] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=45199 >

Our swig-generated XS code compiles fine with HP-UX aCC and Perl 5.8.6. It fails to compile with 5.8.8.

The problem is collision of the symbol "seed". In version 5.8.6\, embed.h defines "seed" only if PERL_CORE is defined\, and therefore it is invisible in XS code. However\, in 5.8.8\, the protection is missing and "seed" is visible throughout the code. It collides with use of "seed" function in Rogue Wave STL implementation that is part of the aCC distribution (in particular\, in algorithm.cc header).

FWIW\, this was not accidental.

Change 26069 by steveh@​mugwump on 2005/11/10 08​:41​:53

  Make Perl_seed public  
  Fixes Win32 linker error in List​::Util introduced by change #26054

p5pRT commented 17 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 16 years ago

p5p@spam.wizbit.be - Status changed from 'open' to 'rejected'