Skip to content
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

Crosscompile #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Crosscompile #27

wants to merge 3 commits into from

Conversation

judovana
Copy link
Collaborator

@judovana judovana commented Sep 13, 2021

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?

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

connect maven an autotools transparently
1 participant