FAQ
Solaris 10, x86; gcc 3.3.2
While building perl, I'v got:

toke.c: In function `Perl_yylex':
toke.c:2558: error: cast to union type from type not present in union

Help me anybody.
Thanks.

Search Discussions

  • Andrew Dougherty at Dec 16, 2004 at 3:59 pm

    On Thu, 16 Dec 2004, Alex wrote:

    Solaris 10, x86; gcc 3.3.2
    While building perl, I'v got:

    toke.c: In function `Perl_yylex':
    toke.c:2558: error: cast to union type from type not present in union
    I can't reproduce this on Solaris 8, SPARC, with gcc 3.4.1. Here's line
    2558:

    bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);

    It's possible your gcc would be happier with an extra pair of parentheses
    around the righthand side of the '=' sign.

    You can also try

    make toke.i

    to see what that line expands to for your system. For me, it gave

    bof = Perl_PerlIO_tell(PL_rsfp) == (off64_t)((XPV*) (PL_linestr)->sv_any)->xpv_cur;

    which looks fine.

    If you suspect your compiler, you can tell it not to optimize (toke.c is
    the most tortuous file to optimize) with

    rm toke.o
    make toke.o OPTIMIZE=

    to turn off the optimizer for that file.

    For comparison, here's the output of my ./myconfig:

    Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
    Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos xxx 5.8 generic_117350-02 sun4u sparc sunw,ultra-5_10 '
    config_args='-Dcc=/opt/gcc/bin/gcc -Dprefix=/opt/perl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='/opt/gcc/bin/gcc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.1', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
    Linker and Libraries:
    ld='/opt/gcc/bin/gcc', ldflags ='-L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


    --
    Andy Dougherty doughera@lafayette.edu
  • Alex at Dec 17, 2004 at 4:21 am
    Hello.
    I'm not experienced in C, to my regret ...

    "Andrew Dougherty" wrote:
    I can't reproduce this on Solaris 8, SPARC, with gcc 3.4.1. Here's line 2558:
    bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);
    It's possible your gcc would be happier with an extra pair of parentheses
    around the righthand side of the '=' sign.
    It doesn't help unfortunatly.
    You can also try
    make toke.i
    It gave me the following:
    bof = Perl_PerlIO_tell(my_perl, (my_perl->Irsfp)) == (off_t)((XPV*)
    ((my_perl->Ilinestr))->sv_any)->xpv_cur;
    If you suspect your compiler, you can tell it not to optimize (toke.c is
    the most tortuous file to optimize) with
    make toke.o OPTIMIZE=
    It doesn't help also.
    For comparison, here's the output of my ./myconfig:
    And here is my, if it can help:

    Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
    Platform:
    osname=solaris, osvers=2.10, archname=i86pc-solaris-thread-multi
    uname='sunos postoffice.psu.ru 5.10 s10_55 i86pc i386 i86pc '
    config_args='-de -Dusethreads -Dcc=gcc -B/usr/ccs/bin/'
    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=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='gcc -B/usr/ccs/bin/', ccflags
    ='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_
    SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.3.2', gccosandvers='solaris2.10'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
    lseeksize=8
    alignbytes=4, prototype=define
    Linker and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lpthread -lc
    perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

    Regards,
    Alex.
  • H.Merijn Brand at Dec 17, 2004 at 11:27 am

    On Fri 17 Dec 2004 05:20, "Alex" wrote:
    Hello.
    I'm not experienced in C, to my regret ...

    "Andrew Dougherty" wrote:
    I can't reproduce this on Solaris 8, SPARC, with gcc 3.4.1. Here's line 2558:
    bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);
    It's possible your gcc would be happier with an extra pair of parentheses
    around the righthand side of the '=' sign.
    It doesn't help unfortunatly.
    Then double them, because the output of toke.i still does not have them


    bof = (PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr));
    ^ ^

    should then give you

    bof = (Perl_PerlIO_tell(my_perl, (my_perl->Irsfp)) == (off_t)((XPV*)((my_perl->Ilinestr))->sv_any)->xpv_cur);
    ^ ^

    so if it does not, try

    bof = ((PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr)));
    You can also try
    make toke.i
    It gave me the following:
    bof = Perl_PerlIO_tell(my_perl, (my_perl->Irsfp)) == (off_t)((XPV*)
    ((my_perl->Ilinestr))->sv_any)->xpv_cur;
    --
    H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
    using perl-5.6.1, 5.8.5, & 5.9.x, and 809 on HP-UX 10.20 & 11.00, 11i,
    AIX 4.3, AIX 5.2, SuSE 9.1, and Win2k. http://www.cmve.net/~merijn/
    http://archives.develooper.com/daily-build@perl.org/ perl-qa@perl.org
    send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org
  • Alex at Dec 17, 2004 at 6:22 am
    Hello.

    I found out the problem. It is - large file support.
    When I switch it off, it goes good.
    Exact trouble is "-D_FILE_OFFSET_BITS=64" flag.


    p.s. I don't know what is the global problem, but will try not to use large
    files :-)

    Regards,
    Alex.
  • H.Merijn Brand at Dec 17, 2004 at 11:29 am

    On Fri 17 Dec 2004 07:20, "Alex" wrote:
    Hello.

    I found out the problem. It is - large file support.
    When I switch it off, it goes good.
    Exact trouble is "-D_FILE_OFFSET_BITS=64" flag.
    Just for my own curiousity

    When you've got everything working and installed, could you try me to build a
    64bit perl please?

    # Configure -Duse64bitall -des
    p.s. I don't know what is the global problem, but will try not to use large
    files :-)

    Regards,
    Alex.
    --
    H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
    using perl-5.6.1, 5.8.5, & 5.9.x, and 809 on HP-UX 10.20 & 11.00, 11i,
    AIX 4.3, AIX 5.2, SuSE 9.1, and Win2k. http://www.cmve.net/~merijn/
    http://archives.develooper.com/daily-build@perl.org/ perl-qa@perl.org
    send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org
  • Andrew Dougherty at Dec 17, 2004 at 1:55 pm

    On Fri, 17 Dec 2004, Alex wrote:

    Hello.

    I found out the problem. It is - large file support.
    When I switch it off, it goes good.
    Exact trouble is "-D_FILE_OFFSET_BITS=64" flag.

    p.s. I don't know what is the global problem, but will try not to use large
    files :-)
    I still suspect the compiler. I note you're using gcc-3.3.2, which is
    over a year old on Solaris 10, which is brand new. Before worrying too
    much about this particular problem, I'd consider upgrading gcc.

    --
    Andy Dougherty doughera@lafayette.edu
  • Alex at Dec 21, 2004 at 8:29 am

    "Andrew Dougherty" wrote:

    I still suspect the compiler. I note you're using gcc-3.3.2, which is
    over a year old on Solaris 10, which is brand new. Before worrying too
    much about this particular problem, I'd consider upgrading gcc.
    Thank U very much!
    It really was compiler.
    I did compile gcc-3.4.2, then compiled perl without any problems.

    Regards,
    Alex.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-build @
categoriesperl
postedDec 16, '04 at 6:57a
activeDec 21, '04 at 8:29a
posts8
users3
websiteperl.org

People

Translate

site design / logo © 2019 Grokbase