Opened 10 years ago

Closed 10 years ago

#44647 closed defect (fixed)

p5.20-io-tty: fails to build on 10.6

Reported by: mojca (Mojca Miklavec) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard Cc:
Port: p5.20-io-tty

Description

/usr/bin/gcc-4.2 -c   -pipe -Os -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include -arch x86_64 -O3   -DVERSION=\"1.11\" -DXS_VERSION=\"1.11\"  "-I/opt/local/lib/perl5/5.20/darwin-thread-multi-2level/CORE"  -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_TERMIOS_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT -DHAVE_UTIL_H Tty.c
In file included from Tty.xs:61:
/opt/local/lib/perl5/5.20/darwin-thread-multi-2level/CORE/util.h:69: error: redefinition of typedef ‘perl_drand48_t’
/opt/local/lib/perl5/5.20/darwin-thread-multi-2level/CORE/util.h:69: error: previous declaration of ‘perl_drand48_t’ was here
make: *** [Tty.o] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-io-tty/p5.20-io-tty/work/IO-Tty-1.11'
Command failed:  cd "/opt/local/var/macports/build/_opt_mports_dports_perl_p5-io-tty/p5.20-io-tty/work/IO-Tty-1.11" && /usr/bin/make -j8 -w all
Exit code: 2

One might want to rebuild at least the following ports on 10.6 when the problem gets fixed:

  • p5.20-ipc-run
  • p5.20-graphviz
  • p5.20-module-signature
  • p5.20-panotools-script
  • p5.20-dbd-pg

Change History (8)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

comment:2 Changed 10 years ago by mojca (Mojca Miklavec)

Thank you very much for the pointer.

I would actually be more inclined towards fixing util.h in Perl itself. Looking at this:

it makes me suspect that the following definitions in util.h are not written properly / don't behave well with older compilers:

/* outside the core, perl.h undefs HAS_QUAD if IV isn't 64-bit
   We can't swap this to HAS_QUAD, because the logic here affects the type of
   perl_drand48_t below, and that is visible outside of the core.  */
#if defined(U64TYPE) && !defined(USING_MSVC6)
/* use a faster implementation when quads are available,
 * but not with VC6 on Windows */
#    define PERL_DRAND48_QUAD
#endif

#ifdef PERL_DRAND48_QUAD

/* U64 is only defined under PERL_CORE, but this needs to be visible
 * elsewhere so the definition of PerlInterpreter is complete.
 */
typedef U64TYPE perl_drand48_t; /* <-- ERROR */

#else

struct PERL_DRAND48_T {
    U16 seed[3];
};

typedef struct PERL_DRAND48_T perl_drand48_t;

#endif

#define PL_RANDOM_STATE_TYPE perl_drand48_t

#define Perl_drand48_init(seed) (Perl_drand48_init_r(&PL_random_state, (seed)))
#define Perl_drand48() (Perl_drand48_r(&PL_random_state))

but I'm not yet sure how to fix that either.

Other than that I don't see any reason not to switch to PERL_SUBVERSION etc. But it really makes more sense to me to fix Perl's headers.

The bug report for io-tty is here: https://rt.cpan.org/Public/Bug/Display.html?id=96710

Last edited 10 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:3 Changed 10 years ago by mojca (Mojca Miklavec)

It might also help to use a different/more recent compiler.

comment:4 in reply to:  2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to mojca@…:

I would actually be more inclined towards fixing util.h in Perl itself. Looking at this:

it makes me suspect that the following definitions in util.h are not written properly / don't behave well with older compilers:

Is there a perl bug report for this then?

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

I didn't submit one yet. I'm always confused by their interface and had problems submitting reports in the past. But in either case we would probably have a better change to get it fixed if we manage to find some patch.

comment:6 Changed 10 years ago by mojca (Mojca Miklavec)

Here is how they fixed the problem: https://github.com/toddr/IO-Tty/commit/b59e8e2b6f001a135d49cb8f10a9ca4d49a1d5c5

  • Tty.xs

    old new typedef FILE * InOutStream; 
    5858#endif /* HAVE_UTIL_H */
    5959
    6060#ifdef HAVE_UTIL_H
    61 # include <util.h>
     61# if ((PATCHLEVEL < 19) && (SUBVERSION < 4))
     62#  include <util.h>
     63# endif
    6264#endif /* HAVE_UTIL_H */
    6365
    6466#ifdef HAVE_PTY_H

I'm still convinced that util.h needs patching though.

I updated the port to 1.12 in r130002.

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

This also seems a bit suspicious patch to me. It looks as if util.h won't be included with Perl 5.18.6.

comment:8 Changed 10 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

I also updated ports or committed trivial whitespace changes on the rest of the ports that were previously failing because of broken io-tty.

Note: See TracTickets for help on using tickets.