Ticket #1058 (closed RFC: fixed)

Opened 5 years ago

Last modified 5 years ago

auto::funcptr: config step not needed if 'jitcapable' is never true

Reported by: jkeenan Owned by: jkeenan
Priority: normal Milestone:
Component: configure Version: 1.6.0
Severity: medium Keywords: jit funcptr
Cc: Language:
Patch status: applied Platform:

Description

Configuration step auto::funcptr is supposed to "[verify] that the compiler supports function pointer casts." It only does something meaningful if the value of jitcapable in the Parrot::Configure object is a true value.

sub runstep {
    my ( $self, $conf ) = @_;

    my $jitcapable = $conf->data->get('jitcapable');

    if ($jitcapable) {
        $conf->cc_gen('config/auto/funcptr/test_c.in');
        eval { $conf->cc_build(); };

        if ( $@ || $conf->cc_run() !~ /OK/ ) {
            _cast_void_pointers_msg();
            exit(-1);
        }
        $conf->cc_clean();
        $self->_set_positive_result($conf);
    }

    return 1;
}

However, with the recent removal of JIT code, jitcapable is now hard-coded to 0 in auto::jit. From config/auto/jit.pm:

    $conf->data->set(
[snip]
        jitcapable     => 0,
        execcapable    => 0,

Hence, config/auto/funcptr.pm does not currently do anything meaningful.

In principle, we could leave it in our configuration system for the time being, so that when JIT comes back to life, auto::funcptr is ready to do its thing.

However, I dislike having code in the config system that does nothing. I propose that we delete config/auto/funcptr.pm, the related C probes and the related test file.

Discussion? Please speak up, as otherwise I will delete these files in 7 days. Note that I am not proposing to delete the jitcapable element in the Parrot::Configure object's data structure, as that would adversely impact code in config/gen/config_h/config_h.in and config/gen/config_pm/myconfig.in.

Thank you very much.

kid51

Attachments

no.more.auto.funcptr.txt Download (8.3 KB) - added by jkeenan 5 years ago.
Removal of config step auto::funcptr and associated files

Change History

Changed 5 years ago by jkeenan

  • status changed from new to assigned

Side note: This was discovered through the joys of coverage analysis:

37    ***     39     50                     if ($jitcapable) {
38    ***      0                                $conf->cc_gen('config/auto/funcptr/test_c.in');
39    ***      0                                eval { $conf->cc_build(); };
      ***      0                        
40                                      
41    ***      0      0      0                  if ( $@ || $conf->cc_run() !~ /OK/ ) {
42    ***      0                                    _cast_void_pointers_msg();
43    ***      0                                    exit(-1);
44                                              }
45    ***      0                                $conf->cc_clean();
46    ***      0                                $self->_set_positive_result($conf);
47                                          }

Changed 5 years ago by jkeenan

Removal of config step auto::funcptr and associated files

Changed 5 years ago by jkeenan

  • patch set to applied

Accomplished in r41544. Will close ticket in 24 hours unless there are complaints.

Thank you very much.

kid51

Changed 5 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No complaints; closing ticket.

Note: See TracTickets for help on using tickets.