[clang] [clang-tools-extra] [libcxx] Reland "[clang] Enable sized deallocation by default in C++14 onwards" (PR #90373)

Mike Hommey via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 17:28:04 PDT 2024


glandium wrote:

There is something wrong going on with cmake:
STR:
- Download [testcase.zip](https://github.com/user-attachments/files/15597940/testcase.zip)
- Unzip it (it contains ClangRepl.cpp.obj and exports.def.objs)
- Run `cmake -E __create_def exports.def exports.def.objs --nm=/path/to/llvm-nm`

When running this with cmake on Windows, taking one of the symbols the lld-link was saying were missing:
```
	__profc_??$_Emplace_reallocate 	 DATA
	__profd_??$_Emplace_reallocate 	 DATA
	__profvp_??$_Emplace_reallocate 	 DATA
	??$_Emplace_reallocate at AEBI@?$vector at IV?$allocator at I@std@@@std@@AEAAPEAIQEAIAEBI at Z
	??$_Emplace_reallocate at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@AEAAPEAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1 at QEAV21@AEBV21@@Z
	??$_Emplace_reallocate at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@?$vector at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@V?$allocator at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@std@@@std@@AEAAPEAU?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@QEAU234@$$QEAU234@@Z
	??$_Emplace_reallocate at UCompletion@LineEditor at llvm@@@?$vector at UCompletion@LineEditor at llvm@@V?$allocator at UCompletion@LineEditor at llvm@@@std@@@std@@AEAAPEAUCompletion at LineEditor@llvm@@QEAU234@$$QEAU234@@Z
	??$_Emplace_reallocate at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@?$vector at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@V?$allocator at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@2@@std@@AEAAPEAV?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@1 at QEAV21@$$QEAV21@@Z
```
Doing the same on Linux:
```
	__profc_??$_Emplace_reallocate at AEBI@?$vector at IV?$allocator at I@std@@@std@@AEAAPEAIQEAIAEBI at Z.140565309351188016 	 DATA
	__profc_??$_Emplace_reallocate at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@AEAAPEAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1 at QEAV21@AEBV21@@Z.166520529307557042 	 DATA
	__profc_??$_Emplace_reallocate at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@?$vector at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@V?$allocator at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@std@@@std@@AEAAPEAU?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@QEAU234@$$QEAU234@@Z.940266886021390796 	 DATA
	__profc_??$_Emplace_reallocate at UCompletion@LineEditor at llvm@@@?$vector at UCompletion@LineEditor at llvm@@V?$allocator at UCompletion@LineEditor at llvm@@@std@@@std@@AEAAPEAUCompletion at LineEditor@llvm@@QEAU234@$$QEAU234@@Z.928018419188693000 	 DATA
	__profc_??$_Emplace_reallocate at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@?$vector at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@V?$allocator at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@2@@std@@AEAAPEAV?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@1 at QEAV21@$$QEAV21@@Z.1073799611620789089 	 DATA
	__profd_??$_Emplace_reallocate at AEBI@?$vector at IV?$allocator at I@std@@@std@@AEAAPEAIQEAIAEBI at Z.140565309351188016 	 DATA
	__profd_??$_Emplace_reallocate at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@AEAAPEAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1 at QEAV21@AEBV21@@Z.166520529307557042 	 DATA
	__profd_??$_Emplace_reallocate at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@?$vector at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@V?$allocator at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@std@@@std@@AEAAPEAU?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@QEAU234@$$QEAU234@@Z.940266886021390796 	 DATA
	__profd_??$_Emplace_reallocate at UCompletion@LineEditor at llvm@@@?$vector at UCompletion@LineEditor at llvm@@V?$allocator at UCompletion@LineEditor at llvm@@@std@@@std@@AEAAPEAUCompletion at LineEditor@llvm@@QEAU234@$$QEAU234@@Z.928018419188693000 	 DATA
	__profd_??$_Emplace_reallocate at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@?$vector at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@V?$allocator at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@2@@std@@AEAAPEAV?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@1 at QEAV21@$$QEAV21@@Z.1073799611620789089 	 DATA
	__profvp_??$_Emplace_reallocate at AEBI@?$vector at IV?$allocator at I@std@@@std@@AEAAPEAIQEAIAEBI at Z.140565309351188016 	 DATA
	__profvp_??$_Emplace_reallocate at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@AEAAPEAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1 at QEAV21@AEBV21@@Z.166520529307557042 	 DATA
	__profvp_??$_Emplace_reallocate at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@?$vector at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@V?$allocator at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@2@@std@@AEAAPEAV?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@1 at QEAV21@$$QEAV21@@Z.1073799611620789089 	 DATA
	??$_Emplace_reallocate at AEBI@?$vector at IV?$allocator at I@std@@@std@@AEAAPEAIQEAIAEBI at Z
	??$_Emplace_reallocate at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@AEAAPEAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1 at QEAV21@AEBV21@@Z
	??$_Emplace_reallocate at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@?$vector at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@V?$allocator at U?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@@std@@@std@@AEAAPEAU?$OptionValue at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@cl at llvm@@QEAU234@$$QEAU234@@Z
	??$_Emplace_reallocate at UCompletion@LineEditor at llvm@@@?$vector at UCompletion@LineEditor at llvm@@V?$allocator at UCompletion@LineEditor at llvm@@@std@@@std@@AEAAPEAUCompletion at LineEditor@llvm@@QEAU234@$$QEAU234@@Z
	??$_Emplace_reallocate at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@?$vector at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@V?$allocator at V?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@std@@@2@@std@@AEAAPEAV?$unique_ptr at VErrorInfoBase@llvm@@U?$default_delete at VErrorInfoBase@llvm@@@std@@@1 at QEAV21@$$QEAV21@@Z
```

To produce this output, cmake runs `llvm-nm --no-weak --defined-only --format=posix` on Linux, but ... does its own thing on Windows, ignoring the --nm flag it gave itself.

I will file a bug against cmake.

https://github.com/llvm/llvm-project/pull/90373


More information about the cfe-commits mailing list