Crosscompile - #27
Open
judovana wants to merge 3 commits into
Open
Conversation
By default, both profiles are activated. (nothig == -Pjava,natives You can run -Pjava if you wish to build only java part (eg call from make) -Pnatives can not be run alone. I had left headers generation in java part for several reasons: - it is javac call - it would require duplication of maven-compile rplugin declaration (move of javc -h configuration) - once the crosscompilation is added, that would require another triplication f maven compiler plugin and duplication of java -h configuration
This is intentional separate chnage, otherwise the refactoring form previous commit will be unreadable
Default mvn run is not changed, the mvn -Pjava,crosscompile, will create (on properly set up system, documented) crosscompiled natives for criu-able arches. Thus instead of libJigawatts.so, there appeare libJigawatts_aarch64.so, libJigawatts_ppc64le.so and libJigawatts_x86_64.so. Library loading schema was adapted toconsider this. On long run, all direct gcc calls have to be replaced by confiure and make calls for both native and crosscompile profiles. Eg: ./configure --build x86_64-pc-linux-gnu --host aarch64-linux-gnu CC=aarch64-linux-gnu-gcc LDFLAGS="-static" CFLAGS="--sysroot=/var/lib/mock/fedora-35-aarch64/root/" for aarch64c static cross compile or ./configure && make for dynamic local build The exact cross compler is necessary, otherwise configure may fallback to direct gcc *without* proper crosscompiler set up.
This was referenced Sep 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pr is possible way to proper upstream binary release.
It is capable to create jar, which contains several crosscompiled .so files (aarch64, ppc64le and x86_64).
Originally I first wanted to implement #25 But I found that current autotools is unable of proper cross-compilation and to fix it overcommed my autotools expertise (#26) and @gnu-andrew will need to help.
The first two commits "Reformated pom.xml to acomodate profile indentation" and "Separated native and java profiles in pom.xml" can go in, they can do no harm, and are necessary to fix #25
The last - the crosscompilation itself -commit is buggy as it is - See commented out "-static" from gcc call, so it obviously fail to run later. I had failed to crosscompile and even compile agaisnt criulib staticaally. @chflood does it evenhave sense? Is it possible in current criu setup? is it possibl eat all?