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'); $nm = $this->resolveExecutable('nm');
$auditor->assertUndefinedSymbols( /* Native objects may deliberately provide an OS ABI to one another.
$project->target, * The linked artifact is the actual host-capability boundary. */
$this->runCapture([$nm, '-u', ...$objects], dirname($project->file)),
);
$auditor->assertUndefinedSymbols( $auditor->assertUndefinedSymbols(
$project->target, $project->target,
$this->runCapture( $this->runCapture(

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

Loading…
Cancel
Save