Menu

#95 gcc-ism -pedantic breaks other compilers

v1.0 (example)
closed-fixed
nobody
None
5
2014-10-02
2014-03-18
Mark
No

On Solaris 7, 8, 9, 10, 11 for both SPARC and i86pc, when using the Sun Studio 7, 11, 12 and 12.3 compilers, the use of the gcc-ism '-pedantic' will cause a compile error. It tries to trigger performance gathering.

You can test for '__SUNPRO_C' or better yet, test for gcc use before injecting it. It's now -Wpedantic anyway.

/usr/local/bin/bash ../libtool  --tag=CC   --mode=link cc -xtarget=ultra -xarch=v9 -xcode=pic32  -I/usr/local/include -pedantic -no-undefined -export-symbols exported.sym -R/usr/local/lib -L/usr/local/lib -o libcheck.la -rpath /libcheck/lib check.lo check_error.lo check_list.lo check_log.lo check_msg.lo check_pack.lo check_print.lo check_run.lo check_str.lo   ../lib/libcompat.la 
libtool: link: echo "local: *; };" >> .libs/libcheck.so.0.0.0.exp
libtool: link:  cc -xtarget=ultra -xarch=v9 -xcode=pic32 -G -z defs -M .libs/libcheck.so.0.0.0.exp -h libcheck.so.0 -o .libs/libcheck.so.0.0.0  .libs/check.o .libs/check_error.o .libs/check_list.o .libs/check_log.o .libs/check_msg.o .libs/check_pack.o .libs/check_print.o .libs/check_run.o .libs/check_str.o  -z allextract ../lib/.libs/libcompat.a -z defaultextract  -R/usr/local/lib -L/usr/local/lib -lc  -xtarget=ultra -xarch=v9  
Undefined                       first referenced
 symbol                             in file
floor                               .libs/check.o
mcount                              .libs/check.o
ld: fatal: Symbol referencing errors. No output written to .libs/libcheck.so.0.0.0
gmake[2]: *** [libcheck.la] Error 1
gmake[2]: Leaving directory `/var/tmp/check-0.9.12/src'
gmake[1]: *** [all-recursive] Error 1

References:
https://bugs.freedesktop.org/show_bug.cgi?id=27735

Related

Bugs: #95

Discussion

  • Branden Archer

    Branden Archer - 2014-03-19

    Mark,

    Thanks for reporting this issue. I've actually never run Solaris, and thus
    have never checked that Check works on Solaris.

    The -pedantic was actually removed in January for an unrelated reason. This
    has not been put into a release yet, but is available in the SVN trunk.
    This change will appear in the next Check release.

    Besides this flag, does everything else work on Solaris?

    On Mon, Mar 17, 2014 at 10:22 PM, Mark markatc@users.sf.net wrote:


    Status: open
    Group: v1.0 (example)
    Created: Tue Mar 18, 2014 02:22 AM UTC by Mark
    Last Updated: Tue Mar 18, 2014 02:22 AM UTC
    Owner: nobody

    On Solaris 7, 8, 9, 10, 11 for both SPARC and i86pc, when using the Sun
    Studio 7, 11, 12 and 12.3 compilers, the use of the gcc-ism '-pedantic'
    will cause a compile error. It tries to trigger performance gathering.

    You can test for '__SUNPRO_C' or better yet, test for gcc use before
    injecting it. It's now -Wpedantic anyway.

    /usr/local/bin/bash ../libtool --tag=CC --mode=link cc -xtarget=ultra -xarch=v9 -xcode=pic32 -I/usr/local/include -pedantic -no-undefined -export-symbols exported.sym -R/usr/local/lib -L/usr/local/lib -o libcheck.la -rpath /libcheck/lib check.lo check_error.lo check_list.lo check_log.lo check_msg.lo check_pack.lo check_print.lo check_run.lo check_str.lo ../lib/libcompat.la libtool: link: echo "local: *; };" >> .libs/libcheck.so.0.0.0.explibtool: link: cc -xtarget=ultra -xarch=v9 -xcode=pic32 -G -z defs -M .libs/libcheck.so.0.0.0.exp -h libcheck.so.0 -o .libs/libcheck.so.0.0.0 .libs/check.o .libs/check_error.o .libs/check_list.o .libs/check_log.o .libs/check_msg.o .libs/check_pack.o .libs/check_print.o .libs/check_run.o .libs/check_str.o -z allextract ../lib/.libs/libcompat.a -z defaultextract -R/usr/local/lib -L/usr/local/lib -lc -xtarget=ultra -xarch=v9 Undefined first referenced
    symbol in filefloor .libs/check.omcount .libs/check.old: fatal: Symbol referencing errors. No output written to .libs/libcheck.so.0.0.0gmake[2]: *** [libcheck.la] Error 1gmake[2]: Leaving directory `/var/tmp/check-0.9.12/src'gmake[1]: *** [all-recursive] Error 1

    References:
    https://bugs.freedesktop.org/show_bug.cgi?id=27735


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/check/bugs/95/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #95

  • Mark

    Mark - 2014-03-19

    Yup, pretty clean. I do have to diddle the src/Makefile.in to remove CK_EXPORT though. Here's the recipe:

    cd /var/tmp
    rm -rf check-0.9.12
    untgz /usr/local/src/utils/check-0.9.12.tar.gz
    cd check-0.9.12
    /bin/perl -pe "s%sed -n -e.*check.h.in%cat \@top_srcdir\@/src/check.h.in | grep CK_EXPORT | perl -pe 's/.*CK_EXPORT\\s+//' | perl -pe 's/(\\(|\\s+|\\;).*//' | uniq%" -i src/Makefile.in
    /bin/perl -pe 's# -pedantic##' -i configure
    ./configure --prefix=/usr/local
    gmake
    gmake install
    

    Packages are up at http://www.ibiblio.org/pub/packages/solaris/sparc/

     
  • Branden Archer

    Branden Archer - 2014-03-20
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB