LuaLS / LuaLS/lua-language-server

[Build] Windows ARM64 build failure: undefined symbol __longjmp_wrapper in fast_setjmp_arm64.s

Đang mở
#3,337 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description:**
When attempting to compile lua-language-server on Windows on Arm using the MSVC toolchain (armasm64), the build fails during the assembly phase of the bee.lua dependency.

The assembler throws an error because the file 3rd/bee.lua/3rd/lua-patch/fast_setjmp_arm64.s attempts to export a symbol that is never defined in the text area, while also failing to export fast_longjmp.

**Environment:**
OS: Windows 11 (Arm64)
Compiler: MSVC (Host: ARM64, Target: ARM64)
Tool: armasm64.exe

**Error Logs:**
[1/125] Compile ASM build/obj/source_lua/fast_setjmp_arm64.obj
FAILED: build/obj/source_lua/fast_setjmp_arm64.obj
armasm64 -nologo -o build/obj/source_lua/fast_setjmp_arm64.obj 3rd/bee.lua/3rd/lua-patch/fast_setjmp_arm64.s
C:\Code\Tools\lua-language-server\3rd\bee.lua\3rd\lua-patch\fast_setjmp_arm64.s(40) : error A2023: undefined symbol: __longjmp_wrapper
END
[6/125] Compile C build/obj/source_lua/onelua.obj
C:\Code\Tools\lua-language-server\3rd\bee.lua\3rd\lua55\ldo.c(131): warning C4013: 'fast_longjmp' undefined; assuming extern returning int
C:\Code\Tools\lua-language-server\3rd\bee.lua\3rd\lua55\ldo.c(169): warning C4013: 'fast_setjmp' undefined; assuming extern returning int
[14/125] Compile C++ build/obj/source_bee/error.obj
ninja: build stopped: subcommand failed.

**Proposed Workaround / Fix:**
I was able to successfully generate the executable by modifying fast_setjmp_arm64.s as follows:
1. Removing the EXPORT __longjmp_wrapper line (as it has no corresponding label).
2. Adding EXPORT fast_longjmp to ensure the symbol is visible to the C code in ldo.c

**Modified Assembly Header:**
```assembly
EXPORT fast_setjmp
EXPORT fast_longjmp ; Added this
; EXPORT __longjmp_wrapper ; Removed this as it caused error A2023: undefined symbol: __longjmp_wrapper
```

**Questions/Concerns:**
While this allows the build to complete and the server to run, I am not 100% sure if:
1. `__longjmp_wrapper` was intended to be an alias for `fast_longjmp` for compatibility with specific Windows exception handling.
2. There is a specific reason `fast_longjmp` was omitted from the exports in the original ARM64 patch.

Could the maintainers verify if this is the correct way to align the ARM64 assembly with the Windows MSVC requirements?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Kiểm tra 3rd/bee.lua/3rd/lua-patch/fast_setjmp_arm64.s cùng với 3rd/bee.lua/3rd/lua55/ldo.c, tập trung vào các symbol được export và các tham chiếu Windows ARM64 của chúng. Chạy bản build MSVC armasm64, sau đó xác minh rằng giai đoạn assembly hoàn tất và executable tạo ra được link và chạy mà không thay đổi hành vi fast_setjmp hoặc fast_longjmp như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, lua
Lĩnh vực
build-system, operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.