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

Docker build for FreeBSD aarch64 #642

Merged
merged 2 commits into from
Aug 19, 2021
Merged

Conversation

gotson
Copy link
Collaborator

@gotson gotson commented Aug 14, 2021

https://github.com/MrDOS/freebsd-cross-build uses gcc and only builds for x86 and x86_64. I tried modifying that container to build for aarch64, to no avail.

https://github.com/SpectraLogic/freebsd-cross-build recently switched to using clang instead of gcc for cross-compilation. clang cannot build very early FreeBSD versions (doesn't work before 11.x), i think because of some dependencies on standard libraries.

I managed to modify https://github.com/SpectraLogic/freebsd-cross-build to build for aarch64.

It seems that building with clang does not provide the right ELF headers though, but it seems it's not important.

Comparison:

The file built in #491

aarch64/libsqlitejdbc.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (FreeBSD), dynamically linked, stripped

The file built with my container:

aarch64/libsqlitejdbc.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, stripped

@unrelentingtech would you be able to confirm this works fine on a FreeBSD aarch64 system?


Supersedes #491

@valpackett
Copy link

Can you post a binary to test?

(BTW if you'd like to test yourself, you can use EC2)

Old versions shouldn't be supported anymore, I recommend still building 11.x for amd64 for now, but aarch64 would be fine to start with 12.x.

I also have a docker thing I made a while ago https://github.com/unrelentingtech/docker-freebsd-cross haven't updated for aarch64 though.

@gotson
Copy link
Collaborator Author

gotson commented Aug 14, 2021

Can you post a binary to test?

You can pull that PR and do a make freebsd-arm64 to build locally.

(BTW if you'd like to test yourself, you can use EC2)

Thanks, cool trick! I know nothing about freebsd though 😅

@valpackett
Copy link

I don't exactly have a permanent Linux box to run Docker on, building my own would take extra effort ;) Though I should work on updating my own docker cross build image anyway…

@gotson
Copy link
Collaborator Author

gotson commented Aug 14, 2021

I don't exactly have a permanent Linux box to run Docker on, building my own would take extra effort ;) Though I should work on updating my own docker cross build image anyway…

I added the compiled native library in the PR :)

I guess you could pull the PR and try to run mvn test to perform a basic test on FreeBSD ARM64.

@gotson
Copy link
Collaborator Author

gotson commented Aug 19, 2021

@unrelentingtech did you had any chance to give this a try? 🙏🏻

@valpackett
Copy link

Tests run: 307, Failures: 0, Errors: 0, Skipped: 2

@gotson
Copy link
Collaborator Author

gotson commented Aug 19, 2021

@xerial this one should be good to go also 👍🏻

@xerial xerial merged commit 43bf32d into xerial:master Aug 19, 2021
@xerial
Copy link
Owner

xerial commented Aug 19, 2021

Great work! Merged

@gotson gotson deleted the freebsd-aarch64 branch August 19, 2021 23:56
@gotson gotson mentioned this pull request Aug 20, 2021
@klaus4
Copy link

klaus4 commented Aug 21, 2021

could you do the same switch as here to https://github.com/SpectraLogic/freebsd-cross-build
for FreeBSD amd64 instead of #639 ?
thanks in advance
( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257962 )
only did a quick look onto the issue and `hope, I got it right(sorry if not)

@gotson
Copy link
Collaborator Author

gotson commented Aug 21, 2021

could you do the same switch as here to https://github.com/SpectraLogic/freebsd-cross-build
for FreeBSD amd64 instead of #639 ?
thanks in advance
( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257962 )
only did a quick look onto the issue and `hope, I got it right(sorry if not)

I am sorry, I don't quite understand what is the problem with this one. Could you provide more details? That bug report doesn't explain what's wrong, just provide an arbitrary solution.

CC @michael-o which answered on the ticket there and knows quite well what's going on on this project.

@klaus4
Copy link

klaus4 commented Aug 21, 2021

from the stacktrace ( https://bugs.freebsd.org/bugzilla/attachment.cgi?id=227339) :
--...Event: 34.841 Loaded shared library /tmp/sqlite-3.34.0-c8b10b78-595a-47b8-8c97-c88cc41a3e0a-libsqlitejdbc.so ...--
so my guess is that if you would cross-compile with clang also on amd64 like here on aarch64 it would solve the issue... but O.K., let's ask e.g. @michael-o or the fbsd-ports-maintainer for a test-run with https://github.com/SpectraLogic/freebsd-cross-build...
thanks for looking into the issue !

@gotson
Copy link
Collaborator Author

gotson commented Aug 21, 2021

from the stacktrace ( https://bugs.freebsd.org/bugzilla/attachment.cgi?id=227339) :
--...Event: 34.841 Loaded shared library /tmp/sqlite-3.34.0-c8b10b78-595a-47b8-8c97-c88cc41a3e0a-libsqlitejdbc.so ...--
so my guess is that if you would cross-compile with clang also on amd64 like here on aarch64 it would solve the issue... but O.K., let's ask e.g. @michael-o or the fbsd-ports-maintainer for a test-run with https://github.com/SpectraLogic/freebsd-cross-build...
thanks for looking into the issue !

in order not to pollute this already merged PR, can you create a new issue, and provide all of the necessary information, including which version of sqlite-jdbc you used? Thanks.

@michael-o
Copy link
Contributor

#646 (comment)

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.

5 participants