Set FLEXDIR
when bootstrapping flexlink
#13723
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #13494. When linking,
flexlink
needs one of its system-specific support objects (e.g.flexdll_mingw64.o
). Whenflexlink.exe
is bootstrapped with OCaml, these objects are installed in%PREFIX%\lib\ocaml\flexdll
and the compiler automatically adds-I +flexdll
. During the build, however, we currently rely onflexlink
's historical default, which is to look for these objects inFilename.dirname Sys.executable_name
. In the build, this just means the objects get copied to bothbyte/bin/
andopt/bin/
and it Just Works™ (full mechanism described in #12278). However,opt/bin/flexlink.exe
is now capable of being a symlink to../../flexlink.opt.exe
, and the root directory doesn't contain the objects.This PR simplifies things by instead setting the
FLEXDIR
environment variable (which, if set, is used byflexlink
instead ofFilename.dirname Sys.executable_name
). That change is fairly simple - it's made slightly more complicated by cross-compilation, since the root directory path has to be run viacygpath
, but only if we're building on MSYS2 / Cygwin.