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

windows: luajit: Enable LuaJIT on ARM64 Windows #9051

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Jul 5, 2024

After merged #9044, ARM64 Windows support is imported.
However, the additional works are still needed to provide LuaJIT for ARM64 Windows.
This PR enables LuaJIT on ARM64 Windows.

Additionally, we also need to revise luajit-cmake module to adopt MSVC ARM64 cross compilation.
Because there is no native ARM64 native compilers for ARM64 Windows.
Currently, they are all working on Prism emulator which translates from a x86_64 executable to an arm64 one.

Also, I sent a PR to adopt amd64_arm64 compilation with MSVC: zhaozg/luajit-cmake#10


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
        flush 1
        daemon off
        log_level debug

[INPUT]
        Name random
        Tag test
        Samples 10

[FILTER]
        Name Lua
        Match *
        call append_tag
        code function append_tag(tag, timestamp, record) new_record = record new_record["tag"] = tag return 1, timestamp, new_record end

[OUTPUT]
        Name stdout
        Match *
  • Debug log output from testing the change
Fluent Bit v3.1.0
* Copyright (C) 2015-2024 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

___________.__                        __    __________.__  __          ________
\_   _____/|  |  __ __   ____   _____/  |_  \______   \__|/  |_  ___  _\_____  \
 |    __)  |  | |  |  \_/ __ \ /    \   __\  |    |  _/  \   __\ \  \/ / _(__  <
 |     \   |  |_|  |  /\  ___/|   |  \  |    |    |   \  ||  |    \   / /       \
 \___  /   |____/____/  \___  >___|  /__|    |______  /__||__|     \_/ /______  /
     \/                     \/     \/               \/                        \/

[2024/07/05 17:39:37] [ info] Configuration:
[2024/07/05 17:39:37] [ info]  flush time     | 1.000000 seconds
[2024/07/05 17:39:37] [ info]  grace          | 5 seconds
[2024/07/05 17:39:37] [ info]  daemon         | 0
[2024/07/05 17:39:37] [ info] ___________
[2024/07/05 17:39:37] [ info]  inputs:
[2024/07/05 17:39:37] [ info]      random
[2024/07/05 17:39:37] [ info] ___________
[2024/07/05 17:39:37] [ info]  filters:
[2024/07/05 17:39:37] [ info]      lua.0
[2024/07/05 17:39:37] [ info] ___________
[2024/07/05 17:39:37] [ info]  outputs:
[2024/07/05 17:39:37] [ info]      stdout.0
[2024/07/05 17:39:37] [ info] ___________
[2024/07/05 17:39:37] [ info]  collectors:
[2024/07/05 17:39:37] [ info] [fluent bit] version=3.1.0, commit=dcb38b4808, pid=30120
[2024/07/05 17:39:37] [debug] [engine] coroutine stack size: 98302 bytes (96.0K)
[2024/07/05 17:39:37] [ info] [storage] ver=1.5.2, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/07/05 17:39:37] [ info] [cmetrics] version=0.9.1
[2024/07/05 17:39:37] [ info] [ctraces ] version=0.5.1
[2024/07/05 17:39:37] [ info] [input:random:random.0] initializing
[2024/07/05 17:39:37] [ info] [input:random:random.0] storage_strategy='memory' (memory only)
[2024/07/05 17:39:37] [debug] [random:random.0] created event channels: read=772 write=776
[2024/07/05 17:39:37] [debug] [input:random:random.0] interval_sec=1 interval_nsec=0
[2024/07/05 17:39:37] [debug] [stdout:stdout.0] created event channels: read=788 write=792
[2024/07/05 17:39:37] [ info] [sp] stream processor started
[2024/07/05 17:39:37] [ info] [output:stdout:stdout.0] worker #0 started
[2024/07/05 17:39:39] [debug] [task] created task=000001FB7614E280 id=0 OK
[2024/07/05 17:39:39] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] test: [[1720168778.962351083, {}], {"tag"=>"test", "rand_value"=>9223372036854775807}]
[2024/07/05 17:39:39] [debug] [out flush] cb_destroy coro_id=0
[2024/07/05 17:39:39] [debug] [task] destroy task=000001FB7614E280 (task_id=0)
[2024/07/05 17:39:40] [debug] [task] created task=000001FB7614D9C0 id=0 OK
[2024/07/05 17:39:40] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] test: [[1720168779.949239492, {}], {"tag"=>"test", "rand_value"=>9223372036854775807}]
[2024/07/05 17:39:40] [debug] [out flush] cb_destroy coro_id=1
[2024/07/05 17:39:40] [debug] [task] destroy task=000001FB7614D9C0 (task_id=0)
[2024/07/05 17:39:41] [debug] [task] created task=000001FB7614E140 id=0 OK
[0] test: [[1720168780.971567630, {}], {"tag"=>"test", "rand_value"=>9223372036854775807}]
[2024/07/05 17:39:41] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[2024/07/05 17:39:41] [debug] [task] destroy task=000001FB7614E140 (task_id=0)
[2024/07/05 17:39:41] [debug] [out flush] cb_destroy coro_id=2
[2024/07/05 17:39:42] [engine] caught signal (SIGINT)
[2024/07/05 17:39:42] [debug] [task] created task=000001FB7614D100 id=0 OK
[0] test: [[[2024/07/05 17:39:42] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
1720168781.967020273, {}], {"tag"=>"test", "rand_value"=>3113138047542337536}]
[2024/07/05 17:39:42] [debug] [out flush] cb_destroy coro_id=3
[2024/07/05 17:39:42] [debug] [task] destroy task=000001FB7614D100 (task_id=0)
[2024/07/05 17:39:42] [debug] [task] created task=000001FB7614D1A0 id=0 OK
[0] test: [[1720168782.957337379, [2024/07/05 17:39:42] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
{}], {"[2024/07/05 17:39:42] [ warn] [engine] service will shutdown in max 5 seconds
tag"=>"test", "rand_value"=>2246210563568206848}]
[2024/07/05 17:39:42] [ info] [input] pausing random.0
[2024/07/05 17:39:42] [debug] [out flush] cb_destroy coro_id=4
[2024/07/05 17:39:42] [debug] [task] destroy task=000001FB7614D1A0 (task_id=0)
[2024/07/05 17:39:43] [ info] [engine] service has stopped (0 pending tasks)
[2024/07/05 17:39:43] [ info] [input] pausing random.0
[2024/07/05 17:39:43] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2024/07/05 17:39:43] [ info] [output:stdout:stdout.0] thread worker #0 stopped
PS> dumpbin /headers bin/fluent-bit.exe
Microsoft (R) COFF/PE Dumper Version 14.40.33811.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file bin\fluent-bit.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
            AA64 machine (ARM64)
               6 number of sections
        668822BA time date stamp Sat Jul  6 01:43:38 2024
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
              22 characteristics
                   Executable
                   Application can handle large (>2GB) addresses

  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
…vm correctly

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@edsiper edsiper merged commit 6bee0c0 into master Jul 5, 2024
43 of 44 checks passed
@edsiper edsiper deleted the cosmo0920-enable-luajit-on-arm64-windows branch July 5, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants