arsv/perl-cross

t/io/sem.t fails with perl-cross 0.9

Closed this issue · 10 comments

this test fails:

$ ./perl io/sem.t
1..7
ok 1 - acquired semaphore
semctl not implemented at io/sem.t line 50.
semctl not implemented at io/sem.t line 27.

my config.sh contains

d_sem='define'

and my config.h contains

#define HAS_SEM
arsv commented

Can you check the values for d_semctl_semid_ds and d_semctl_semun?
If both are undef, that's the reason why semctl is not built.

These values are hinted in cnf/hints/linux-gnu, otherwise they require runtime tests to check.

both undef

d_sem='define'
d_semctl='define'
d_semctl_semid_ds='undef'
d_semctl_semun='undef'
d_semget='define'
d_semop='define'
  1. perl 5.18.2 with perl-cross 0.8.5 gives the same config values
  2. t/io/sem.t is a new file in perl 5.20.0
  3. perl 5.20.0 / linux gives usually these values :
d_sem='define'
d_semctl='define'
d_semctl_semid_ds='define'
d_semctl_semun='define'
d_semget='define'
d_semop='define'

For me, looks like the values in cnf/hints/linux-gnu need to be fixed

arsv commented

Ok, agreed, hints updated.

with the head of perl-cross and perl-5.20.0, I still have in config.sh

d_sem='define'
d_semctl='define'
d_semctl_semid_ds='undef'
d_semctl_semun='undef'
d_semget='define'
d_semop='define'

the output of the configure contains

Checking which hints to use
    using cnf/hints/default
    using cnf/hints/linux
    using cnf/hints/linux-gnu

But looks like, cnf/hints/linux-gnu was not used.

arsv commented

By any chance, was that "Checking which hints to use" output from miniperl configure?
linux-gnu sets the values unconditionally, and there's nothing else to override them.

If possible, can you attach full config.log?

arsv commented

Ok, I see it right away: the target is arm-buildroot-linux-gnueabi, which means it doesn't even try to load linux-gnu hints, it tries (nonexistant) linux-gnueabi instead.

A quick fix is to copy hints/linux-gnu to hints/linux-gnueabi
I'm trying to figure out how to handle it the right way.

I added this fix in http://git.buildroot.net/buildroot/tree/package/perl/perl.mk

define PERL_FIX_ISSUE3
    (cd $(@D)/cnf/hints; cp linux-gnu linux-gnueabi)
endef
PERL_PRE_CONFIGURE_HOOKS += PERL_FIX_ISSUE3

config.sh is correct and the test io/sem.t pass.

arsv commented

Ok, that's good.

I moved those hints from "linux-gnu" to "linux", I thought union semun comes from libc but it turns out it's from kernel headers. So starting with the next version there should be no need in PERL_FIX_ISSUE3.