Skip to content

Commit 3ff6c7d

Browse files
committed
ld.lld changes
Work in progress to support ld.lld as linker
1 parent 5cf9624 commit 3ff6c7d

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

templates/bmake.mpd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ STARTUP_BITS = <%startup_bits%>
2424
LINK = <%link%>
2525
COMMON_LIBS = <%common_libs%>
2626
TLIB = <%tlib%>
27+
DLLFLAGS = <%dllflags%>
2728
<%if(pch)%>PCH = 1<%endif%>
2829
!else
2930
<%endfor%>
@@ -56,6 +57,13 @@ POSTLINKRM = <%postlinkrmext%>
5657
<%if(exename)%>
5758
EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\
5859
<%endif%>
60+
<%if(objectsearchpath)%>
61+
OBJECTSEARCHPATH = \
62+
<%foreach(libpaths)%>
63+
-j"<%libpath%>"
64+
<%fornotlast(" \\")%>
65+
<%endfor%>
66+
<%endif%>
5967
!else
6068
<%endfor%>
6169
!error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%>
@@ -79,7 +87,6 @@ CG_LIB = cg32.lib
7987
DLL_EXT = <%dll_ext%>
8088
EXE_EXT = <%exe_ext%>
8189
RC = <%rc%>
82-
DLLFLAGS = <%dllflags%>
8390
LIBFLAGS = <%libflags%>
8491
EXEFLAGS = <%exeflags%>
8592
CCFLAGS = $(CC_CFLAGS)<%if(type_is_binary)%> $(BINARY_FLAGS)<%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>
@@ -134,8 +141,9 @@ LFLAGS = \
134141
-v<%if(libpaths)%> \<%endif%>
135142
<%endif%>
136143
<%foreach(libpaths)%>
137-
-L"<%libpath%>" -j"<%libpath%>"<%fornotlast(" \\")%>
144+
-L"<%libpath%>" \
138145
<%endfor%>
146+
$(OBJECTSEARCHPATH)
139147
<%endif%>
140148

141149
LIBFILES = \

templates/bmakecommon.mpt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ unicode_exe_modifier = u
1212
dll_ext = .dll
1313
exe_ext = .exe
1414
rc = brcc32
15-
dllflags = -Tpd -Gi -x -Gn -w-dup
1615
libflags = /C
1716
exeflags = -Tpe -x -Gn
1817

@@ -33,7 +32,12 @@ link = ilink32
3332
common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT) $(CG_LIB)
3433
tlib = tlib
3534
pch = 1
35+
<<<<<<< Updated upstream
3636
ccflags = -q
37+
=======
38+
dllflags = -Tpd -Gi -x -Gn -w-dup
39+
object_search_path = 1
40+
>>>>>>> Stashed changes
3741
}
3842

3943
bcc32c {
@@ -52,7 +56,12 @@ startup_bits = 32
5256
link = ilink32
5357
common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT)
5458
tlib = tlib
59+
<<<<<<< Updated upstream
5560
ccflags = -q
61+
=======
62+
dllflags = -Tpd -Gi -x -Gn -w-dup
63+
object_search_path = 1
64+
>>>>>>> Stashed changes
5665
}
5766

5867
bcc64 {
@@ -71,7 +80,12 @@ startup_bits = 64
7180
link = ilink64
7281
common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT)
7382
tlib = tlib64
83+
<<<<<<< Updated upstream
7484
ccflags = -q
85+
=======
86+
dllflags = -Tpd -Gi -x -Gn -w-dup
87+
object_search_path = 1
88+
>>>>>>> Stashed changes
7589
}
7690

7791
bcc64x {
@@ -87,8 +101,16 @@ common_flags =
87101
obj_ext = .o
88102
linker_paths = -L\"$(BDS)\lib\win64x\debug\" -L\"$(BDS)\lib\win64x\release\"
89103
startup_bits = 64
104+
<<<<<<< Updated upstream
90105
link = bcc64x
91106
common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT)
92107
tlib = tlib64
93108
ccflags =
109+
=======
110+
link = ld.lld
111+
common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT)
112+
tlib = tlib64
113+
dllflags = -m i386pep -shared --Bstatic --entry DllMainCRTStartup --enable-auto-image-base
114+
object_search_path = 0
115+
>>>>>>> Stashed changes
94116
}

0 commit comments

Comments
 (0)