Both comments predated the marker, and now neither does
This commit is contained in:
parent
64e4f6cc7e
commit
0251cf4aaa
43
lib/build.ml
43
lib/build.ml
@ -744,18 +744,20 @@ let executable ?(opts = default) ?(csrcs = []) ?(lflags = []) ?(pnames = [])
|
|||||||
by this backend — and the module that would redefine through them arrives
|
by this backend — and the module that would redefine through them arrives
|
||||||
with the lane that writes it.
|
with the lane that writes it.
|
||||||
|
|
||||||
That lane inherits one thing this comment should say out loud rather than
|
[X86.redefinition] is that lane, and it has landed, so the paragraph this
|
||||||
leave for it to find. [x86.ml]'s header licenses its own calling
|
comment used to end with — that no counterpart existed — is no longer
|
||||||
convention on the grounds that a dev build is compiled entirely by it and
|
true. What remains true is why it had to be written here rather than
|
||||||
a release build entirely by LLVM, so the two never meet in one process.
|
borrowed from LLVM. [x86.ml]'s header licenses its own calling convention
|
||||||
Publishing a cell an LLVM-built module can store into is the first thing
|
on the grounds that a dev build is compiled entirely by it and a release
|
||||||
that could make that false: the two conventions agree on scalars and
|
build entirely by LLVM, so the two never meet in one process. Publishing
|
||||||
disagree on every aggregate, so an [Emit.redefinition] module dlopened
|
a cell an LLVM-built module can store into is the first thing that could
|
||||||
into an [--x86] host would be correct until the first redefined function
|
make that false: the two conventions agree on scalars and disagree on
|
||||||
took or returned a struct. Nothing in the toolchain does that today —
|
every aggregate, so an [Emit.redefinition] module dlopened into an
|
||||||
[flan reload] and [flan dev] both build host and module through LLVM —
|
[--x86] host is correct until the first redefined function takes or
|
||||||
and the fix when something does is to emit the module through this
|
returns a struct. That pair is now refused at [dlopen] by a marker symbol
|
||||||
backend too, not to grow a classifier. *)
|
each backend defines and each backend's module references — see [shared]
|
||||||
|
below — rather than left to die at the call. The answer was to emit the
|
||||||
|
module through this backend too, and never to grow a classifier. *)
|
||||||
(* [--debug] used to be in this list too. It is not any more: [x86.ml] emits
|
(* [--debug] used to be in this list too. It is not any more: [x86.ml] emits
|
||||||
a compile unit, a subprogram per function and a line table, all written
|
a compile unit, a subprogram per function and a line table, all written
|
||||||
out as bytes because [.loc] cannot work against a file whose instructions
|
out as bytes because [.loc] cannot work against a file whose instructions
|
||||||
@ -911,12 +913,17 @@ let shared ?(opts = default) ~ir ~out () : timing =
|
|||||||
than it is is worse than none. It catches a caller holding one option
|
than it is is worse than none. It catches a caller holding one option
|
||||||
record and reaching for the wrong builder. It does not catch a caller
|
record and reaching for the wrong builder. It does not catch a caller
|
||||||
holding two and picking the wrong one — the crossed pair that was measured
|
holding two and picking the wrong one — the crossed pair that was measured
|
||||||
segfaulting passes this check and still segfaults, because it hands an
|
segfaulting passes this check, because it hands an LLVM record to the LLVM
|
||||||
LLVM record to the LLVM builder and simply loads the result into an x86
|
builder and simply loads the result into an x86 host. [flan reload] is
|
||||||
host. [flan reload] is precisely that caller. The complete answer is a
|
precisely that caller, and it is why this guard was never the whole
|
||||||
marker symbol the host defines and a module references, so the loader
|
answer. The whole answer is the marker symbol: a dev build defines
|
||||||
refuses the pair at dlopen rather than the processor refusing it at a
|
[flan.abi.x86] or [flan.abi.llvm] according to which backend emitted it,
|
||||||
call. See docs/handoffs/HANDOFF-x86-aggregates.md. *)
|
each backend's redefinition module holds a pointer to its own, and the
|
||||||
|
loader has to resolve that pointer while it maps the object — so a crossed
|
||||||
|
pair is refused at [dlopen], naming both backends, before any new body
|
||||||
|
runs. That landed; this check is the cheap first line rather than the only
|
||||||
|
one. See docs/handoffs/HANDOFF-x86-aggregates.md and
|
||||||
|
docs/handoffs/HANDOFF-x86-abi-marker.md. *)
|
||||||
if opts.x86 then
|
if opts.x86 then
|
||||||
failwith
|
failwith
|
||||||
"--x86: Build.shared is the LLVM redefinition path, and an --x86 host \
|
"--x86: Build.shared is the LLVM redefinition path, and an --x86 host \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user