Remove the deprecated -ld_classic and -fembed-bitcode flags from the NativeScript target
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 66/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- ios, javascript
- Lĩnh vực
- build-system, mobile-dev
Hướng nghiên cứu
Mở v8ios.xcodeproj/project.pbxproj và kiểm tra các mục OTHER_LDFLAGS và OTHER_CFLAGS của target NativeScript cho Debug và Release tại các dòng được tham chiếu. Xóa các flag đã lỗi thời, sau đó build và link mọi slice iOS, simulator, Mac Catalyst và visionOS được liệt kê; hoàn tất có nghĩa là tất cả slice đều thành công, hoặc mọi ngoại lệ chỉ dành cho visionOS được giới hạn chặt chẽ và ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The NativeScript target carries two linker/compiler flags that Apple has already retired. One of them is on a deprecation clock and will become a hard build failure.
-ld_classic
OTHER_LDFLAGS on the NativeScript target, both Debug and Release (v8ios.xcodeproj/project.pbxproj:2899 and :2992). Every link emits:
ld: warning: -ld_classic is deprecated and will be removed in a future release
It forces the old linker. Apple has said it is going away; when it does, this stops being a warning and starts failing the build.
It was added in bb364f95 ("feat(visionos): support for xros platform", #235), so it was most likely a workaround for a new-linker bug on xros at that time rather than something iOS ever needed. Whatever that bug was, it is worth re-testing against a current Xcode.
-fembed-bitcode
OTHER_CFLAGS on the same two configurations (:2896, :2989). Bitcode was deprecated in Xcode 14 and App Store submission has not accepted it for years. The flag is dead weight.
What needs doing
Remove both, then confirm the framework still links on every slice — arm64-iphoneos, arm64-iphonesimulator, x86_64-iphonesimulator, arm64-maccatalyst, x86_64-maccatalyst, arm64-xros, arm64-xrsimulator. visionOS is the one that matters: it is the platform -ld_classic was introduced for, so if anything regresses it will be there, and a build that only checks iOS proves nothing.
If visionOS does still need the classic linker, the flag should at minimum be narrowed to the visionOS configurations only and carry a comment saying what breaks without it, so the next person is not left guessing.
Not to be confused with
The same links also emit ~174 copies of:
ld: warning: direct access in function '...' from file 'libv8_base_without_compiler.a(...)'
to global weak symbol 'std::__1::piecewise_construct' from file '...ModuleInternalCallbacks.o'
means the weak symbol cannot be overridden at runtime.
Those are benign and out of scope here. V8 is built with chromium's default -fvisibility=hidden while the framework's own translation units use Xcode's default visibility, so both sides emit the same libc++ weak symbol and V8's objects bind to ours directly. The symbol is an empty tag struct used only for compile-time dispatch:
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
It has no state and its address is never compared, so duplicate definitions are indistinguishable. The warning matters for typeinfo/vtable symbols (breaks dynamic_cast and cross-boundary catch) or operator new/delete (breaks allocator replacement) — a classification of a full Release-iphoneos link found all 174 to be the one tag constant and none of those. Matching visibility would silence them, but the framework has no EXPORTED_SYMBOLS_FILE, so -fvisibility=hidden would also hide the ObjC class symbols the public API needs.
- Ngôn ngữ chính
- JavaScript
- Star
- 150
- Fork
- 43
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 22
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NativeScript/ios
-
isImplementedInClass leaks the losing sample instance on re-entrant or racing cache population Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
NativeScript/ios#459 · 1 bình luận ·
-
worker.terminate() is a no-op during entry evaluation, and terminating there wedges teardown Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
NativeScript/ios#445 ·
-
question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 34/100
NativeScript/ios#364 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
NativeScript/ios#355 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
NativeScript/ios#292 · 9 bình luận ·
Tất cả issue của NativeScript/ios
Issue tương tự
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100