
mhx-perl at gmx
Nov 7, 2009, 4:58 PM
Post #5 of 10
(284 views)
Permalink
|
|
Re: [PATCH] buildperl.pl: allow older perl to compile with newer gcc
[In reply to]
|
|
Hi Philippe, On 2009-11-08, at 01:01:14 +0100, Philippe Bruhat (BooK) wrote: > On Sat, Nov 07, 2009 at 07:26:00AM +0100, Marcus Holland-Moritz wrote: > > > > > > diff --git a/cpan/Devel-PPPort/devel/buildperl.pl b/cpan/Devel-PPPort/devel/buildperl.pl > > > index 49b7fbb..fefd480 100644 > > > --- a/cpan/Devel-PPPort/devel/buildperl.pl > > > +++ b/cpan/Devel-PPPort/devel/buildperl.pl > > > @@ -99,7 +99,7 @@ my @patch = ( > > > }, > > > { > > > perl => [ > > > - qr/^5\.004_0[1234]$/, > > > + qr/^5\.004_0[12345]$/, > > > ], > > > subs => [ > > > [ \&patch_doio ], > > > > any special reason why you added 5.005_05 for the doio patch? > > My patch is for 5.004_05, not 5.005_05. Yes. My bad. I meant 5.004_05, but my fingers dared not to follow my brain ;) > > While this might sound like a dumb question at first -- I guess > > you added it because it didn't compile for you -- I'd be glad > > for some details, as *with* your change, it doesn't compile for > > me... > > Indeed, I added that because it didn't compile for me. > > First of all, I create the archives using > > git archive --format=tar --prefix=$tag/ $tag^{tree} \ > | gzip > /tmp/perl/source/$tag.tar.gz > > With $tag being perl-5.004_05 in this case. > > Maybe this tag doesn't generate the same archive as the one you're using? Can you compare yours against the one from CPAN (which is what I'm using): http://www.cpan.org/src/perl5.004_05.tar.gz > > `sh cflags libperl.a doio.o` doio.c > > CCCMD = cc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -DDEBUGGING -g > > doio.c:86: error: redefinition of 'union semun' > > make: *** [doio.o] Error 1 > > The error I get *without* my change is: > > `sh cflags libperl.a doio.o` doio.c > CCCMD = cc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -I/usr/local/include -O2 > doio.c: In function ‘Perl_nextargv’: > doio.c:505: attention : ignoring return value of ‘fchown’, declared with attribute warn_unused_result > doio.c: In function ‘Perl_do_ipcctl’: > doio.c:1445: erreur: storage size of ‘unsemds’ isn’t known > doio.c:1486: erreur: storage size of ‘semun’ isn’t known > make: *** [doio.o] Erreur 1 > make all: 512 > > > ...which is because this piece of code had been added between > > 5.005_04 and 5.005_05 in perl.h... > > > > # ifndef HAS_UNION_SEMUN /* Provide the union semun. */ > > union semun { > > int val; > > struct semid_ds *buf; > > unsigned short *array; > > }; > > # endif > > > > ...which was precisely why I excluded 5.004_05 from the doio > > patch. So, maybe you can provide me with some details on why > > exactly it doesn't work for you so we can find a solution > > that works for both systems. > > When looking at the logs in the git tree, it seems that the patch > you're talking about was added in bd89102fe7784367e3eeddc7cefae29defae903a: > > $ git log -n1 -p bd89102fe7784367e3eeddc7cefae29defae903a -- perl.h > commit bd89102fe7784367e3eeddc7cefae29defae903a > Author: Andy Dougherty <doughera [at] lafayette> > Date: Thu May 28 09:27:25 1998 -0400 > > [PATCH 5.004_65] Config_65-02-03.diff: SunOS and Solaris hints > Date: Thu, 28 May 1998 13:27:25 -0400 (EDT) > Subject: [PATCH 5.004_65] Config_65-03-04.diff: semctl probing > Date: Thu, 28 May 1998 13:28:21 -0400 (EDT) > > p4raw-id: //depot/perl [at] 104 > > diff --git a/perl.h b/perl.h > index fc96064..8645c39 100644 > --- a/perl.h > +++ b/perl.h > @@ -2090,6 +2090,26 @@ enum { > UNLOCK_SV_MUTEX; \ > } while (0) > > +#ifdef HAS_SEM > +# include <sys/ipc.h> > +# include <sys/sem.h> > +# ifndef HAS_UNION_SEMUN /* Provide the union semun. */ > + union semun { > + int val; > + struct semid_ds *buf; > + unsigned short *array; > + }; > +# endif > +# ifdef USE_SEMCTL_SEMUN > +# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun) > +# else > +# ifdef USE_SEMCTL_SEMID_DS > +# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun.buf) > +# endif > +# endif > +# ifndef Semctl /* Place our bets on the semun horse. */ > +# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun) > +# endif > +#endif > > #endif /* Include guard */ > - > > What worries me is that this patch is for Perl 5.004_65. > But the only 5.004_xx tags in the git tree are: > > $ git tag -l 'perl-5.004*' > perl-5.004 > perl-5.004_01 > perl-5.004_02 > perl-5.004_03 > perl-5.004_04 > perl-5.004_05 > > Since the versions I see in the log messages go up to 5.004_71, it seems > that some tags are missing... IIRC, 5.004_50 and onwards were development releases (just like 5.(7|9|11).x today). And just as 5.8.9 was released after 5.9.5, for example, 5.004_05 was most probably released after 5.004_65. (Indeed, checking in the APC I can see a 5.004_65 tarball from 1998-05-15 while 5.004_05 is from 1999-04-29.) The question is whether the 5.004_05 tag in the repo is correct. I'd say it should match the contents of the tarball that's available from CPAN. > The best way to go with my patch is probably to ignore the parts related > to 5.004_05, as obviously I didn't know what I was doing. I indeed changed the behaviour of the doio patch back to *not* patching 5.004_05. With this, I can build all perls on my box. Thanks for your work! Cheers, Marcus -- Computer programmers do it byte by byte.
|