From 3ff6c7d60b20fe7d5177c29a8e80ae220fafebb4 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 15 Apr 2024 13:55:32 +0200 Subject: [PATCH] ld.lld changes Work in progress to support ld.lld as linker --- templates/bmake.mpd | 12 ++++++++++-- templates/bmakecommon.mpt | 24 +++++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/templates/bmake.mpd b/templates/bmake.mpd index 63adda70..25320172 100644 --- a/templates/bmake.mpd +++ b/templates/bmake.mpd @@ -24,6 +24,7 @@ STARTUP_BITS = <%startup_bits%> LINK = <%link%> COMMON_LIBS = <%common_libs%> TLIB = <%tlib%> +DLLFLAGS = <%dllflags%> <%if(pch)%>PCH = 1<%endif%> !else <%endfor%> @@ -56,6 +57,13 @@ POSTLINKRM = <%postlinkrmext%> <%if(exename)%> EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\ <%endif%> +<%if(objectsearchpath)%> +OBJECTSEARCHPATH = \ +<%foreach(libpaths)%> + -j"<%libpath%>" +<%fornotlast(" \\")%> +<%endfor%> +<%endif%> !else <%endfor%> !error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%> @@ -79,7 +87,6 @@ CG_LIB = cg32.lib DLL_EXT = <%dll_ext%> EXE_EXT = <%exe_ext%> RC = <%rc%> -DLLFLAGS = <%dllflags%> LIBFLAGS = <%libflags%> EXEFLAGS = <%exeflags%> CCFLAGS = $(CC_CFLAGS)<%if(type_is_binary)%> $(BINARY_FLAGS)<%endif%><%if(compile_flags)%> <%compile_flags%><%endif%> @@ -134,8 +141,9 @@ LFLAGS = \ -v<%if(libpaths)%> \<%endif%> <%endif%> <%foreach(libpaths)%> - -L"<%libpath%>" -j"<%libpath%>"<%fornotlast(" \\")%> + -L"<%libpath%>" \ <%endfor%> + $(OBJECTSEARCHPATH) <%endif%> LIBFILES = \ diff --git a/templates/bmakecommon.mpt b/templates/bmakecommon.mpt index 8e50cdef..b7898ce8 100644 --- a/templates/bmakecommon.mpt +++ b/templates/bmakecommon.mpt @@ -12,7 +12,6 @@ unicode_exe_modifier = u dll_ext = .dll exe_ext = .exe rc = brcc32 -dllflags = -Tpd -Gi -x -Gn -w-dup libflags = /C exeflags = -Tpe -x -Gn @@ -33,7 +32,12 @@ link = ilink32 common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT) $(CG_LIB) tlib = tlib pch = 1 +<<<<<<< Updated upstream ccflags = -q +======= +dllflags = -Tpd -Gi -x -Gn -w-dup +object_search_path = 1 +>>>>>>> Stashed changes } bcc32c { @@ -52,7 +56,12 @@ startup_bits = 32 link = ilink32 common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT) tlib = tlib +<<<<<<< Updated upstream ccflags = -q +======= +dllflags = -Tpd -Gi -x -Gn -w-dup +object_search_path = 1 +>>>>>>> Stashed changes } bcc64 { @@ -71,7 +80,12 @@ startup_bits = 64 link = ilink64 common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT) tlib = tlib64 +<<<<<<< Updated upstream ccflags = -q +======= +dllflags = -Tpd -Gi -x -Gn -w-dup +object_search_path = 1 +>>>>>>> Stashed changes } bcc64x { @@ -87,8 +101,16 @@ common_flags = obj_ext = .o linker_paths = -L\"$(BDS)\lib\win64x\debug\" -L\"$(BDS)\lib\win64x\release\" startup_bits = 64 +<<<<<<< Updated upstream link = bcc64x common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT) tlib = tlib64 ccflags = +======= +link = ld.lld +common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT) +tlib = tlib64 +dllflags = -m i386pep -shared --Bstatic --entry DllMainCRTStartup --enable-auto-image-base +object_search_path = 0 +>>>>>>> Stashed changes } -- 2.11.4.GIT