Remove the shared object before attempting to create
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 20 Nov 2000 22:02:16 +0000 (22:02 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 20 Nov 2000 22:02:16 +0000 (22:02 +0000)
(by linking) a new one.  E.g. in AIX not removing
becomes quite painful if one tries to do more than one
build in the same tree (an interrupted build, for example),
since the AIX' shared dynaloader seemingly keeps the shared
objects open and therefore 'busy' for quite a while, even when
nobody is using the objects, leading into link failures.

p4raw-id: //depot/perl@7782

lib/ExtUtils/MM_Unix.pm

index f538818..31aa122 100644 (file)
@@ -1074,6 +1074,14 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
     $ldrun = qq{-rpath "$self->{LD_RUN_PATH}"}
        if ($^O eq 'irix' && $self->{LD_RUN_PATH});
 
+    # For example in AIX the shared objects/libraries from previous builds
+    # linger quite a while in the shared dynalinker cache even when nobody
+    # is using them.  This is painful if one for instance tries to restart
+    # a failed build because the link command will fail unnecessarily 'cos
+    # the shared object/library is 'busy'.
+    push(@m,'  $(RM_F) $@
+');
+
     push(@m,'  LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ '.$ldrun.' $(LDDLFLAGS) '.$ldfrom.
                ' $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(EXPORT_LIST)');
     push @m, '