Skip to content

Commit 2879d8f

Browse files
author
Colin Robertson
committed
Add references to linkrepro topics
1 parent 88f6269 commit 2879d8f

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

docs/build/reference/linker-options.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: "MSVC Linker Options"
3-
ms.date: "08/20/2018"
2+
title: "MSVC Linker options"
3+
description: A list of the options supported by the Microsoft LINK linker.
4+
ms.date: "09/24/2019"
45
f1_keywords: ["link"]
56
helpviewer_keywords: ["linker [C++]", "linker [C++], options listed", "libraries [C++], linking to COFF", "LINK tool [C++], linker options"]
67
ms.assetid: c1d51b8a-bd23-416d-81e4-900e02b2c129
78
---
8-
# Linker Options
9+
# Linker options
910

1011
LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (.exe) file or a dynamic-link library (DLL).
1112

@@ -23,6 +24,8 @@ On the command line, linker options are not case-sensitive; for example, /base a
2324

2425
You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.
2526

27+
## Linker options listed alphabetically
28+
2629
|Option|Purpose|
2730
|------------|-------------|
2831
|[@](at-specify-a-linker-response-file.md)|Specifies a response file.|
@@ -73,6 +76,8 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
7376
|[/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)|Specifies a key or key pair to sign an assembly.|
7477
|[/LARGEADDRESSAWARE](largeaddressaware-handle-large-addresses.md)|Tells the compiler that the application supports addresses larger than two gigabytes|
7578
|[/LIBPATH](libpath-additional-libpath.md)|Specifies a path to search before the environmental library path.|
79+
|[/LINKREPRO](linkrepro.md)|Specifies a path to generate link repro artifacts in.|
80+
|[/LINKREPROTARGET](linkreprotarget.md)|Specifies a file name to use for generated link repro artifacts.|
7681
|[/LTCG](ltcg-link-time-code-generation.md)|Specifies link-time code generation.|
7782
|[/MACHINE](machine-specify-target-platform.md)|Specifies the target platform.|
7883
|[/MANIFEST](manifest-create-side-by-side-assembly-manifest.md)|Creates a side-by-side manifest file and optionally embeds it in the binary.|
@@ -125,5 +130,5 @@ For more information, see [Compiler-Controlled LINK Options](compiler-controlled
125130

126131
## See also
127132

128-
[C/C++ Building Reference](c-cpp-building-reference.md)<br/>
133+
[C/C++ Building Reference](c-cpp-building-reference.md)\
129134
[MSVC linker reference](linking.md)

docs/overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "How to report a problem with the Microsoft C++ toolset"
3-
ms.date: "06/21/2019"
3+
description: How to create a good problem report and repro information for the Microsoft C++ toolset.
4+
ms.date: "09/24/2019"
45
ms.technology: "cpp-ide"
56
author: "corob-msft"
67
ms.author: "corob"
@@ -311,19 +312,19 @@ Finally, attach the preprocessed repro files (*filename*.i and *modulename*.i) a
311312

312313
### Link repros
313314

314-
A *Link repro* is the linker-generated contents of a directory specified by the **link\_repro** environment variable. It contains build artifacts that collectively demonstrate a problem that occurs at link time. Examples include a backend crash involving Link-Time Code Generation (LTCG), or a linker crash. These build artifacts are the ones needed as linker input so that the problem can be reproduced. A Link repro can be created easily by using this environment variable. It enables the linker's built-in repro generation capability.
315+
A *link repro* is the linker-generated contents of a directory specified either by the **link\_repro** environment variable, or as an argument to the [/LINKREPRO](../build/reference/linkrepro.md) linker option. It contains build artifacts that collectively demonstrate a problem that occurs at link time. Examples include a backend crash involving Link-Time Code Generation (LTCG), or a linker crash. These build artifacts are the ones needed as linker input so the problem can be reproduced. A link repro can be created easily by using this environment variable. It enables the linker's built-in repro generation capability.
315316

316-
#### To generate a Link repro using the link_repro environment variable
317+
#### To generate a link repro using the link_repro environment variable
317318

318319
1. Capture the command-line arguments used to build your repro, as described in [To report the contents of the command line](#to-report-the-contents-of-the-command-line).
319320

320321
1. Open the **Developer Command Prompt** that matches the Visual Studio version and configuration architecture used to build your project.
321322

322323
1. In the developer command prompt console window, change to the directory that contains your repro project.
323324

324-
1. Enter **mkdir linkrepro** to create a directory for the Link repro.
325+
1. Enter **mkdir linkrepro** to create a directory named *linkrepro* for the link repro. You can use a different name to capture another link repro.
325326

326-
1. Enter the command **set link\_repro=linkrepro** to set the **link\_repro** environment variable to the directory you created. If your build is run from a different directory, as is often the case for more complex projects, then set **link\_repro** to the full path to your linkrepro directory instead.
327+
1. Enter the command **set link\_repro=linkrepro** to set the **link\_repro** environment variable to the directory you created. If your build is run from a different directory, as is often the case for more complex projects, then set **link\_repro** to the full path to your link repro directory instead.
327328

328329
1. To build the repro project in Visual Studio, in the developer command prompt console window, enter the command **devenv**. It ensures that the value of the **link\_repro** environment variable is visible to Visual Studio. To build the project at the command line, use the command-line arguments captured above to duplicate the repro build.
329330

@@ -333,17 +334,23 @@ A *Link repro* is the linker-generated contents of a directory specified by the
333334

334335
1. In the developer command prompt console window, enter the command **set link\_repro=** to clear the **link\_repro** environment variable.
335336

336-
#### To generate a Link repro using the /LINKREPRO linker option
337+
Finally, package the repro by compressing the entire linkrepro directory into a .zip file or similar, and attach it to your report.
337338

338-
The /LINKREPRO linker option has the same effect as the **link\_repro** environment variable. You can also use the /LINKREPROTARGET option to specify the name to use for the generated link repro. To use /LINKREPROTARGET, you must specify the /OUT option.
339+
The **/LINKREPRO** linker option has the same effect as the **link\_repro** environment variable. You can use the [/LINKREPROTARGET](../build/reference/linkreprotarget.md) option to specify the name to use for the generated link repro. To use **/LINKREPROTARGET**, you must also specify the **/OUT** linker option.
339340

340-
<!-- TODO TODO -->
341+
#### To generate a link repro using the /LINKREPRO option
341342

342-
Finally, package the repro by compressing the entire linkrepro directory into a .zip file or similar and attach it to your report.
343+
1. Create a directory to hold the link repro. We'll refer to the full directory path you create as _directory-path_. Use double quotes around the path if it includes spaces.
344+
345+
1. Add the **/LINKREPRO:**_directory-path_ command to the linker command line. In Visual Studio, open the **Property Pages** dialog for your project. Select the **Configuration Properties** > **Linker** > **Command Line** property page. Then, enter the **/LINKREPRO:**_directory-path_ option in the **Additional Options** box. Choose **OK** to save your changes.
346+
347+
1. Build your repro project, and confirm that the expected problem has occurred.
348+
349+
Finally, package the repro by compressing the entire _directory-path_ link repro directory into a .zip file or similar, and attach it to your report.
343350

344351
### Other repros
345352

346-
If you can't reduce the problem to a single source file or preprocessed repro, and the problem doesn't require a Link repro, we can investigate an IDE project. All the guidance on how to create a good repro still applies: The code ought to be minimal and self-contained. The problem should occur in our most recent tools, and if relevant, shouldn't be seen in other compilers.
353+
If you can't reduce the problem to a single source file or preprocessed repro, and the problem doesn't require a link repro, we can investigate an IDE project. All the guidance on how to create a good repro still applies: The code ought to be minimal and self-contained. The problem should occur in our most recent tools, and if relevant, shouldn't be seen in other compilers.
347354

348355
Create your repro as a minimal IDE project, then package it by compressing the entire directory structure into a .zip file or similar and attach it to your report.
349356

docs/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,10 @@
952952
href: build/reference/largeaddressaware-handle-large-addresses.md
953953
- name: /LIBPATH (Additional libpath)
954954
href: build/reference/libpath-additional-libpath.md
955+
- name: /LINKREPRO (Link repro directory name)
956+
href: build/reference/linkrepro.md
957+
- name: /LINKREPROTARGET (Link repro file name)
958+
href: build/reference/linkreprotarget.md
955959
- name: /LTCG (Link-time code generation)
956960
href: build/reference/ltcg-link-time-code-generation.md
957961
- name: /MACHINE (Specify target platform)

0 commit comments

Comments
 (0)