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

Avoid an assertion failure in alias.asm #2738

Merged
merged 3 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ set(IMPLIB_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/syserror_import_lib.cpp
${CMAKE_CURRENT_LIST_DIR}/src/vector_algorithms.cpp
${CMAKE_CURRENT_LIST_DIR}/src/xonce2.cpp
${CMAKE_CURRENT_LIST_DIR}/src/alias.asm
${CMAKE_CURRENT_LIST_DIR}/src/alias_init_once_begin_initialize.asm
${CMAKE_CURRENT_LIST_DIR}/src/alias_init_once_complete.asm
)

# The following files are linked in msvcp140[d][_clr].dll.
Expand Down
3 changes: 2 additions & 1 deletion stl/msbuild/stl_base/stl.files.settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
<!-- Objs that exist in both libcpmt[d][01].lib and msvcprt[d].lib
(controlled by IncludeInLink and IncludeInImportLib). -->
<BuildFiles Include="
$(CrtRoot)\github\stl\src\alias.asm;
$(CrtRoot)\github\stl\src\alias_init_once_begin_initialize.asm;
$(CrtRoot)\github\stl\src\alias_init_once_complete.asm;
">
<BuildAs>asm</BuildAs>
<IncludeInLink>false</IncludeInLink>
Expand Down
53 changes: 0 additions & 53 deletions stl/src/alias.asm

This file was deleted.

26 changes: 26 additions & 0 deletions stl/src/alias_init_once_begin_initialize.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
; Copyright (c) Microsoft Corporation.
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

; weak symbol aliases

; This checks if we're in x64 mode (using ml64).
; Note that RAX isn't really an assembler symbol,
; and this check only works in the IFDEF direction.
; That is:
; IFDEF RAX
; meow
; ENDIF
; will expand to meow on only x64 systems, however:
; IFNDEF RAX
; meow
; ENDIF
; will expand to meow on _BOTH_ x64 and x86 systems.
IFDEF RAX
EXTERN __imp_InitOnceBeginInitialize : PROC
ALIAS <__imp___std_init_once_begin_initialize> = <__imp_InitOnceBeginInitialize>
ELSE
EXTERN __imp__InitOnceBeginInitialize@16 : PROC
ALIAS <__imp____std_init_once_begin_initialize@16> = <__imp__InitOnceBeginInitialize@16>
ENDIF

END
26 changes: 26 additions & 0 deletions stl/src/alias_init_once_complete.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
; Copyright (c) Microsoft Corporation.
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

; weak symbol aliases

; This checks if we're in x64 mode (using ml64).
; Note that RAX isn't really an assembler symbol,
; and this check only works in the IFDEF direction.
; That is:
; IFDEF RAX
; meow
; ENDIF
; will expand to meow on only x64 systems, however:
; IFNDEF RAX
; meow
; ENDIF
; will expand to meow on _BOTH_ x64 and x86 systems.
IFDEF RAX
EXTERN __imp_InitOnceComplete : PROC
ALIAS <__imp___std_init_once_complete> = <__imp_InitOnceComplete>
ELSE
EXTERN __imp__InitOnceComplete@12 : PROC
ALIAS <__imp____std_init_once_complete@12> = <__imp__InitOnceComplete@12>
ENDIF

END