refactor(build): remove undefined symbols assertion for native objects

- Remove nm command execution for checking undefined symbols during build
- Add explanatory comment about native objects providing OS ABI to each other
- Update translator to only check undefined symbols in final ELF target
- Clarify that only unresolved imports in final executable cross host boundary
- Maintain auditor checks while removing intermediate object file validation
master
韩天峰 4 weeks ago
parent ce4bcdda4f
commit fc826df3d7
  1. 6
      src/Build/NativeSourceProjectBuilder.php
  2. 7
      src/Translator.php

@ -414,10 +414,8 @@ final class NativeSourceProjectBuilder
}
$nm = $this->resolveExecutable('nm');
$auditor->assertUndefinedSymbols(
$project->target,
$this->runCapture([$nm, '-u', ...$objects], dirname($project->file)),
);
/* Native objects may deliberately provide an OS ABI to one another.
* The linked artifact is the actual host-capability boundary. */
$auditor->assertUndefinedSymbols(
$project->target,
$this->runCapture(

@ -2297,10 +2297,9 @@ CODE;
);
return;
}
$auditor->assertUndefinedSymbols(
'native',
$this->captureNativeCommand(['nm', '-u', ...$objectFiles]),
);
/* Native objects may deliberately provide an OS ABI to one another
* (for example a freestanding syscall shim). Only unresolved imports
* in the final ELF cross the host-capability boundary. */
$auditor->assertUndefinedSymbols(
'native',
$this->captureNativeCommand(['nm', '-u', $targetFile]),

Loading…
Cancel
Save