firebase / firebase/firebase-cpp-sdk

[FR] Support LLVM toolchain on Windows in prebuilt SDK

Đang mở
#793 10 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: auth type: feature request
Ngôn ngữ chính
C++
Star
326
Fork
137
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### [REQUIRED] Please fill in the following fields:

* Pre-built SDK from the [website](https://firebase.google.com/download/cpp) or open-source from this repo: pre-built from website
* Firebase C++ SDK version: 8.8.0
* Problematic Firebase Component: App, Auth
* Other Firebase Components in use: –
* Platform you are using the C++ SDK on: Windows
* Platform you are targeting: Windows

### [REQUIRED] Please describe the issue here:

Using the LLVM toolchain (specifically lld-link) instead of MSVC (link.exe) results in linker errors "relocation against symbol in discarded section: ..." from lld-link (see logs below).

Using link.exe instead of lld-link works fine, and it does not matter whether the source was built with MSVC or clang-cl.

As we have technical requirements to use lld-link in our projects and this is blocking us from using the Firebase C++ SDK.

#### Steps to reproduce with sample project:

1. Download Visual Studio sample project: [FirebaseCppTest.zip](https://github.com/firebase/firebase-cpp-sdk/files/7717600/FirebaseCppTest.zip)
2. Build app

#### Steps to reproduce manually:

1. Create new C++ project in Visual Studio
2. Select "LLVM (clang-cl)" as Platform Toolset in project settings
3. Link against at least firebase_app.lib and optionally firebase_auth.lib (linking both results in more errors of the same kind)
4. Add some minimal code to reference these projects, e.g.
```
App *app = App::Create();
if (app) {
Auth *auth = Auth::GetAuth(app);
printf("Created auth: %p", auth);
}
```
5. Build app

#### Error Logs

```
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_auth_request.obj):(__catch$??$_Emplace_reallocate@AEBQEAUNamespace@f_b_flatbuffers@@@?$vector@PEAUNamespace@f_b_flatbuffers@@V?$allocator@PEAUNamespace@f_b_flatbuffers@@@std@@@std@@QEAAPEAPEAUNamespace@f_b_flatbuffers@@QEAPEAU23@AEBQEAU23@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):(__catch$??$_Emplace_reallocate@AEBQEAUNamespace@f_b_flatbuffers@@@?$vector@PEAUNamespace@f_b_flatbuffers@@V?$allocator@PEAUNamespace@f_b_flatbuffers@@@std@@@std@@QEAAPEAPEAUNamespace@f_b_flatbuffers@@QEAPEAU23@AEBQEAU23@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_set_account_info_result.obj):(__catch$??$_Emplace_reallocate@AEBUUserInfoImpl@auth@firebase@@@?$vector@UUserInfoImpl@auth@firebase@@V?$allocator@UUserInfoImpl@auth@firebase@@@std@@@std@@QEAAPEAUUserInfoImpl@auth@firebase@@QEAU234@AEBU234@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN36
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:1050
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):($LN34)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN9
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xtree:1679
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_get_additional_user_info.obj):(__catch$??$_Copy_nodes@U_Copy_tag@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@IEAAPEAU?$_Tree_node@U?$pair@$$CBVVariant@firebase@@V12@@std@@PEAX@1@PEAU21@0U_Copy_tag@01@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN9
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xtree:1679
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_auth_util.obj):(__catch$??$_Copy_nodes@U_Copy_tag@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@IEAAPEAU?$_Tree_node@U?$pair@$$CBVVariant@firebase@@V12@@std@@PEAX@1@PEAU21@0U_Copy_tag@01@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN9
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xtree:1679
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_authentication_result.obj):(__catch$??$_Copy_nodes@U_Copy_tag@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@IEAAPEAU?$_Tree_node@U?$pair@$$CBVVariant@firebase@@V12@@std@@PEAX@1@PEAU21@0U_Copy_tag@01@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_set_account_info_request.obj):(__catch$??$_Emplace_reallocate@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@QEAV21@$$QEAV21@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_get_account_info_result.obj):(__catch$??$_Emplace_reallocate@AEBUUserInfoImpl@auth@firebase@@@?$vector@UUserInfoImpl@auth@firebase@@V?$allocator@UUserInfoImpl@auth@firebase@@@std@@@std@@QEAAPEAUUserInfoImpl@auth@firebase@@QEAU234@AEBU234@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):(__catch$??$_Emplace_reallocate@AEBUValue@Builder@f_b_flexbuffers@@@?$vector@UValue@Builder@f_b_flexbuffers@@V?$allocator@UValue@Builder@f_b_flexbuffers@@@std@@@std@@QEAAPEAUValue@Builder@f_b_flexbuffers@@QEAU234@AEBU234@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_app.lib(d7017cfa2b4147331b16a451ec58c76c_firebase_rest_lib.dir_Debug_response.obj):(__catch$??$_Emplace_reallocate@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@QEAV21@AEBV21@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN9
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xtree:1679
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant.obj):(__catch$??$_Copy_nodes@U_Copy_tag@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@IEAAPEAU?$_Tree_node@U?$pair@$$CBVVariant@firebase@@V12@@std@@PEAX@1@PEAU21@0U_Copy_tag@01@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_sign_in_flow.obj):(__catch$??$_Emplace_reallocate@AEBQEAUNamespace@f_b_flatbuffers@@@?$vector@PEAUNamespace@f_b_flatbuffers@@V?$allocator@PEAUNamespace@f_b_flatbuffers@@@std@@@std@@QEAAPEAPEAUNamespace@f_b_flatbuffers@@QEAPEAU23@AEBQEAU23@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):(__catch$??$_Emplace_reallocate@E@?$vector@EV?$allocator@E@std@@@std@@QEAAPEAEQEAE$$QEAE@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):(__catch$??$_Emplace_reallocate@UValue@Builder@f_b_flexbuffers@@@?$vector@UValue@Builder@f_b_flexbuffers@@V?$allocator@UValue@Builder@f_b_flexbuffers@@@std@@@std@@QEAAPEAUValue@Builder@f_b_flexbuffers@@QEAU234@$$QEAU234@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN9
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xtree:1679
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_auth_desktop.obj):(__catch$??$_Copy_nodes@U_Copy_tag@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@@?$_Tree@V?$_Tmap_traits@VVariant@firebase@@V12@U?$less@VVariant@firebase@@@std@@V?$allocator@U?$pair@$$CBVVariant@firebase@@V12@@std@@@4@$0A@@std@@@std@@IEAAPEAU?$_Tree_node@U?$pair@$$CBVVariant@firebase@@V12@@std@@PEAX@1@PEAU21@0U_Copy_tag@01@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN8
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:1252
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_auth_desktop.obj):(__catch$??$_Resize_reallocate@U_Value_init_tag@std@@@?$vector@V?$unique_ptr@UUserT@fbs@auth@firebase@@U?$default_delete@UUserT@fbs@auth@firebase@@@std@@@std@@V?$allocator@V?$unique_ptr@UUserT@fbs@auth@firebase@@U?$default_delete@UUserT@fbs@auth@firebase@@@std@@@std@@@2@@std@@AEAAX_KAEBU_Value_init_tag@1@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN28
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:993
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):(__catch$??$_Insert_range@PEBE@?$vector@EV?$allocator@E@std@@@std@@AEAAXV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@E@std@@@std@@@1@PEBE1Uforward_iterator_tag@1@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN10
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:803
1>>>> firebase_auth.lib(a9003852461049443285ecfe94112265_firebase_auth.dir_Debug_user_desktop.obj):(__catch$??$_Emplace_reallocate@AEBQEAUNamespace@f_b_flatbuffers@@@?$vector@PEAUNamespace@f_b_flatbuffers@@V?$allocator@PEAUNamespace@f_b_flatbuffers@@@std@@@std@@QEAAPEAPEAUNamespace@f_b_flatbuffers@@QEAPEAU23@AEBQEAU23@@Z$0)
1>
1>lld-link : error : relocation against symbol in discarded section: $LN32
1>>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector:1026
1>>>> firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_variant_util.obj):($LN30)
1>
1>lld-link : error : too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
```

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

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

Đánh giá

Issue này chưa được đánh giá.

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.