Skip to content

Commit c6d0427

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2674 from diffblue/msvc-link
Microsoft LINK personality
2 parents 318474f + c63030f commit c6d0427

File tree

8 files changed

+555
-10
lines changed

8 files changed

+555
-10
lines changed

regression/goto-cl/Fo/link.desc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE goto-link
2+
3+
/ERRORREPORT:QUEUE /OUT:linked.exe /INCREMENTAL /NOLOGO /LIBPATH:..\foo\bar x.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"bla.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"bla.lib" /MACHINE:X86 /SAFESEH:NO dir/main1.obj dir/main2.obj
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/goto-cl/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
default: tests.log
22

33
test:
4-
@../test.pl -p -c ../../../src/goto-cc/goto-cl
4+
@../test.pl -p -c ../../../src/goto-cc/goto-cl -X goto-link
5+
@cp ../../src/goto-cc/goto-cl.exe ../../src/goto-cc/goto-link.exe
6+
@../test.pl -p -c ../../../src/goto-cc/goto-link -I goto-link
57

68
tests.log: ../test.pl
7-
@../test.pl -p -c ../../../src/goto-cc/goto-cl
9+
@../test.pl -p -c ../../../src/goto-cc/goto-cl -X goto-link
10+
@cp ../../src/goto-cc/goto-cl.exe ../../src/goto-cc/goto-link.exe
11+
@../test.pl -p -c ../../../src/goto-cc/goto-link -I goto-link
812

913
show:
1014
@for dir in *; do \
@@ -17,5 +21,6 @@ clean:
1721
find -name '*.out' -execdir $(RM) '{}' \;
1822
find -name '*.gb' -execdir $(RM) '{}' \;
1923
find -name '*.obj' -execdir $(RM) '{}' \;
24+
find -name '*.exe' -execdir $(RM) '{}' \;
2025
find -name '*.goto-cc-saved' -execdir $(RM) '{}' \;
2126
$(RM) tests.log

src/goto-cc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ SRC = armcc_cmdline.cpp \
1919
linker_script_merge.cpp \
2020
ms_cl_cmdline.cpp \
2121
ms_cl_mode.cpp \
22+
ms_link_cmdline.cpp \
23+
ms_link_mode.cpp \
2224
# Empty last line
2325

2426
OBJ += ../big-int/big-int$(LIBEXT) \

src/goto-cc/goto_cc_main.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ Date: May 2006
1717
#include <util/unicode.h>
1818
#include <util/get_base_name.h>
1919

20-
#include "gcc_cmdline.h"
2120
#include "armcc_cmdline.h"
22-
#include "ms_cl_cmdline.h"
23-
#include "ld_cmdline.h"
24-
#include "bcc_cmdline.h"
25-
#include "as_cmdline.h"
2621
#include "as86_cmdline.h"
22+
#include "as_cmdline.h"
23+
#include "bcc_cmdline.h"
24+
#include "gcc_cmdline.h"
25+
#include "ld_cmdline.h"
26+
#include "ms_cl_cmdline.h"
27+
#include "ms_link_cmdline.h"
2728

2829
#include "armcc_mode.h"
2930
#include "as_mode.h"
3031
#include "cw_mode.h"
3132
#include "gcc_mode.h"
3233
#include "ld_mode.h"
3334
#include "ms_cl_mode.h"
35+
#include "ms_link_mode.h"
3436

3537
std::string to_lower_string(const std::string &s)
3638
{
@@ -65,15 +67,21 @@ int main(int argc, const char **argv)
6567
std::string base_name=get_base_name(argv[0], false);
6668
#endif
6769

68-
if(base_name=="goto-link" || base_name=="link" ||
69-
base_name=="goto-cl" || base_name=="cl")
70+
if(base_name == "goto-cl" || base_name == "cl")
7071
{
71-
// this is the Visual Studio personality
72+
// this is the Visual Studio CL personality
7273
ms_cl_cmdlinet cmdline;
7374
cmdline.parse_env();
7475
ms_cl_modet ms_cl_mode(cmdline, base_name);
7576
return ms_cl_mode.main(argc, argv);
7677
}
78+
else if(base_name == "goto-link" || base_name == "link")
79+
{
80+
// this is the Visual Studio LINK personality
81+
ms_link_cmdlinet cmdline;
82+
ms_link_modet ms_link_mode(cmdline);
83+
return ms_link_mode.main(argc, argv);
84+
}
7785
else if(base_name=="goto-cw" ||
7886
base_name=="goto-cw-link")
7987
{

0 commit comments

Comments
 (0)