-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple cross compile mechanism for flisp/libsupport (+ dependencies) #30526
Conversation
5a0bbad
to
44d3854
Compare
Is there a way we could run the full barrage of buildbots on this branch? There's a good number of mechanism changes here and I'd like to make sure I don't break anything. |
Yes. Go to this page, login by authentication through github in the top right, then cmd-click on each builder name starting with I've gone ahead and done this for you; here are the in-progress builds.
This makes me miss @jlbuild. :'( |
That was secretly one of the goals of that work—I'm glad to see it's finally getting put to its intended use :) I've only reviewed fairly briefly, but the general direction of all of the changes looked good to me. Could we avoid most of the MAYBE_HOST changes to |
Ok, done. |
deps/tools/common.mk
Outdated
$$(build_prefix)/manifest/$(strip $1): $$(build_staging)/$2.tgz | $(build_prefix)/manifest | ||
mkdir -p $$(build_prefix) | ||
$$(build_prefix)/manifest/$(strip $1): $$(build_staging)/$2.tgz | ||
mkdir -p $$(build_prefix)/manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unnecessary? We usually use the gmake extention to do mkdir, instead of each separate recipe being involved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't work for me for some reason. Is there something special I need to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears to have been working for everyone else
$(BUILDDIR)/flisp.boot: flisp.boot | $(BUILDDIR) | ||
$(BUILDDIR)/host/Makefile: | ||
mkdir -p $(BUILDDIR)/host | ||
@# add Makefiles to the build directories for convenience (pointing back to the source location of each) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the right file source in the comment. Is it worth trying to use the existing code to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing the comment. I don't think it's worth trying to deduplicate, esp since this adds a couple extra lines.
$(LLT_release): $(LLTSRCDIR)/*.h $(LLTSRCDIR)/*.c | ||
$(MAKE) -C $(NATIVE_BUILDDIR)/$(LLTDIR) $(subst $(abspath $(NATIVE_BUILDDIR)/$(LLTDIR))/,,$(abspath $(LLT_release))) | ||
$(LLT_debug): $(LLTSRCDIR)/*.h $(LLTSRCDIR)/*.c | ||
$(MAKE) -C $(NATIVE_BUILDDIR)/$(LLTDIR) $(subst $(abspath $(NATIVE_BUILDDIR)/$(LLTDIR))/,,$(abspath $(LLT_debug))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn’t this slightly conflicted? The directory seems to be for native, but the subst looks for a slightly different prefix? Maybe we should add the abspath rule to the LLT Makefile, so we can remove the subst from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's much to be gained. Keeping the targets appropriately relative seems simplest to me. This just turns the absolute path back into a relative path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, just seemed like it wasn't relative to anything obviously meaningful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's just "relative" to the LLT build dir, which seems reasonably meaningful.
src/support/Makefile
Outdated
$(MAKE) -C $(BUILDDIR)/host libsupport.a | ||
|
||
$(BUILDDIR)/host/libsupport-debug.a: $(BUILDDIR)/host/Makefile | ||
$(MAKE) -C $(BUILDDIR)/host libsupport.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-debug
This makes some incremental progress towards #30338 in the build system. In particular, it allows compiling a separate boostrap version of flisp and its dependencies for an architecture different from the target. The immediate use case here is to build libjulia for wasm. Of course, there's still the enormous problem of building the system image itself, but luckily wasm is largely memory-layout-identical to linux32, so doing that limited bootstrap is fairly easy after this change (though the subject of a different PR). The mechanism here is to use the out-of-tree build support to create separate host/ subdirectories for the build directories of interest. These have a special make variable set that tell it to include a different Make.user (or in the absence thereof use the host defaults).
Rebased and addressed review comments (as separate commits for easier review - will squash down to merge). |
@staticfloat why did the buildbots not show up to CI this? Is it because the PR was created before those were a thing? Will the show up if I close and re-open? |
$(BUILDDIR)/host/$(EXENAME): $(BUILDDIR)/host/Makefile | ||
make -C $(BUILDDIR)/host $(EXENAME) | ||
|
||
ifneq ($(BUILDDIR)$(BUILDING_HOST_TOOLS),.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this change may have introdced a minor build error?
make[2]: Circular /data/vtjnash/julia/src/flisp/flisp.boot <- /data/vtjnash/julia/src/flisp/flisp.boot dependency dropped.
This makes some incremental progress towards #30338 in the build system.
In particular, it allows compiling a separate boostrap version of flisp
and its dependencies for an architecture different from the target.
The immediate use case here is to build libjulia for wasm. Of course,
there's still the enormous problem of building the system image itself,
but luckily wasm is largely memory-layout-identical to linux32, so doing
that limited bootstrap is fairly easy after this change (though the subject
of a different PR).
The mechanism here is to use the out-of-tree build support to create
separate host/ subdirectories for the build directories of interest.
These have a special make variable set that tell it to include a
different Make.user (or in the absence thereof use the host defaults).
cc @SimonDanisch
Needs a bit more testing, but seems to do what I need it to in preliminary evaluation.