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

[Architecture] OLS compilation for ARM #253

Closed
wiz64 opened this issue Jul 1, 2021 · 18 comments
Closed

[Architecture] OLS compilation for ARM #253

wiz64 opened this issue Jul 1, 2021 · 18 comments

Comments

@wiz64
Copy link

wiz64 commented Jul 1, 2021

Hello guys,
Me and my friend really need to host a few sites on Raspberry Pis with Ubuntu 20.04 focal aarch64 (ARM)
OLS isn't available pre-compiled, but it can be compiled for ARM
Previous issues regarding the same are outdated. We are looking for ARM version of OLS.
Please provide us instructions to compile for ARM and if possible, a pre compiled binary that should work with it.

@litespeedtech
Copy link
Owner

You can try run build.sh in a ARM linux server. see how it goes.
May need a little more powerful server than Raspberry Pis, as it need to compile all the dependency libraries.

@istiak101
Copy link
Contributor

istiak101 commented Jul 3, 2021

@litespeedtech can you take a look what went wrong? First time everything compiled perfect but I didn't document what I did and destroyed everything.

My build config: Qemu 4 vcpu, 4GB ram, Virt 5.8, Almalinux 8.4 aarch64

https://files.istiak.com/ols/logs/build-log.txt
https://files.istiak.com/ols/logs/build-log1.txt

@litespeedtech
Copy link
Owner

Please try the latest v1_7 branch, some old code cleaning up. It should take care of this compiling error.

@litespeedtech
Copy link
Owner

Release 1.7.12 should have addressed this.

@istiak101
Copy link
Contributor

Sorry for being late, forgot about this. Just wanted to mention lsquic/src/lshpack wasn't copied to src folder that leads to compilation error. This should be addressed in build script. Maybe 1.7.13 can address this.

@litespeedtech
Copy link
Owner

build.sh should have taken care of it with
preparelibquic()
it check out lsquic git repo, then did git submodule update --init --recursive, should checkout a copy of lshpack.
I not sure what causes the problem in your environment.

@istiak101
Copy link
Contributor

On early versions of preparelibquic() it was copied to src folder
d713c6e#diff-4d2a8eefdf2a9783512a35da4dc7676a66404b6f3826a8af9aad038722da6823

Also another thing is libstdc++.a file have another name on RHEL 8 packages libstdc++fs.a
https://centos.pkgs.org/8-stream/centos-appstream-aarch64/libstdc++-devel-8.4.1-1.el8.aarch64.rpm.html

STDC_LIB=`g++ -print-file-name='libstdc++.a'`

@litespeedtech
Copy link
Owner

You can try the latest v1_7 branch,
Added a fixed symbolic link for src/lshpack,
Updated build.sh, try libstdc++fs.a if libstdc++.a is not available.

@istiak101
Copy link
Contributor

Do you have any plan on building ARM aarch64 lsphp binaries for webadmin and other usage? As currently you don't provide any ARM binaries, adding litespeed.repo in aarch64 breaks yum/dnf.
https://github.com/litespeedtech/openlitespeed/blob/v1_7/dist/install.sh

@litespeedtech
Copy link
Owner

No plan to build the ARM repo.
we can host the ARM lsphp binary for webadmin if some provide it.

@istiak101
Copy link
Contributor

No problem. I would try to build lsphp binaries. If my resource allows I will surely provide lsphp binary on each release once I get used to it.

@istiak101
Copy link
Contributor

istiak101 commented Jul 9, 2021

@litespeedtech
Copy link
Owner

Please try the latest v1_7 branch.

@istiak101
Copy link
Contributor

Now having issues with PSOL library. As ARM is pretty much newer than x86/AMD64 older versions of libraries don't have support for ARM architecture. Newer libraries support those.

https://github.com/chromium/chromium/blob/master/build/build_config.h

I am pretty much lost as I don't have any dedicated machines to build those and such long compilation time is making this hard. Any suggestions is highly appreciated.

logs:
https://files.istiak.com/ols/psol.txt
https://files.istiak.com/ols/psol-short.txt

@litespeedtech
Copy link
Owner

PSOL support wont be available for ARM as the pre-built binary is not available. It is very hard to compile it from source.
Made some adjustment to the build script. you can try the latest v1_7 branch.
If you keep the third-party/ created during previous run of build.sh, it will skip build those libraries again, can save some time.

@istiak101
Copy link
Contributor

istiak101 commented Jul 13, 2021

Got an executable binary at last.

[root@localhost bin]# file openlitespeed
openlitespeed: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=6e584b23f7f7eb18c40da551126f3163ebaefb10, with debug_info, not stripped, too many notes (256)

Still need to compile lsphp binary to check if everything is working correctly. Thank you very much for you time and patience.
Would you please take a look at this issue? litespeedtech/third-party#3

Logs:
https://files.istiak.com/ols/libcurl.txt

@litespeedtech
Copy link
Owner

litespeedtech/third-party@1769072
should take care of the libcurl problem with mod_security.
Just pull third-party project, then run scripts/build_curl.sh

@istiak101
Copy link
Contributor

OLS is constantly crashing. This is core dump.

Process 15114 (litespeed) of user 0 dumped core.

                                                           Stack trace of thread 15114:
                                                           #0  0x000000000048a2fc ls_atomic_spin_unlock (openlitespeed)
                                                           #1  0x0000000000484284 _ZN10CacheStore11initManagerEv (openlitespeed)
                                                           #2  0x000000000047cd60 verifyStoreReady (openlitespeed)
                                                           #3  0x000000000047e108 ParseConfig (openlitespeed)
                                                           #4  0x0000000000497788 _ZN12ModuleConfig11parseConfigEPK7XmlNodeP12lsi_module_sPS_iPKc (openlitespeed)
                                                           #5  0x00000000004978c8 _ZN12ModuleConfig15parseConfigListEPK11XmlNodeListPS_iPKc (openlitespeed)
                                                           #6  0x00000000004a58b8 _ZN14HttpServerImpl13configModulesEPK7XmlNode (openlitespeed)
                                                           #7  0x00000000004ad1e8 _ZN14HttpServerImpl12configServerEiP7XmlNode (openlitespeed)
                                                           #8  0x00000000004ad864 _ZN14HttpServerImpl10initServerEP7XmlNodeRii (openlitespeed)
                                                           #9  0x000000000049b968 _ZN11LshttpdMain6configEv (openlitespeed)
                                                           #10 0x000000000049ebc8 _ZN11LshttpdMain4initEiPPc (openlitespeed)
                                                           #11 0x000000000047bc7c _ZN11LshttpdMain4mainEiPPc (openlitespeed)
                                                           #12 0x000000000047bb98 main (openlitespeed)
                                                           #13 0x0000ffff8bcf0de4 __libc_start_main (libc.so.6)
                                                           #14 0x000000000047c6d8 .annobin_pthread_atfork.c_end.startup (openlitespeed)
                                                           #15 0x000000000047c6d8 .annobin_pthread_atfork.c_end.startup (openlitespeed)

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

No branches or pull requests

3 participants