Skip to content

Commit

Permalink
Merge pull request #203 from jwillemsen/bcc64xlld
Browse files Browse the repository at this point in the history
Improve support for bcc64x as Embarcadero C++ Builder compiler
  • Loading branch information
jwillemsen authored Apr 17, 2024
2 parents 5cf9624 + 5955da2 commit 94a3d7e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 13 deletions.
21 changes: 16 additions & 5 deletions templates/bmake.mpd
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ LINKER_PATHS = <%linker_paths%>
STARTUP_BITS = <%startup_bits%>
LINK = <%link%>
COMMON_LIBS = <%common_libs%>
DLLLIBS = <%dll_libs%>
EXELIBS = <%exe_libs%>
TLIB = <%tlib%>
DLLFLAGS = <%dllflags%>
<%if(pch)%>PCH = 1<%endif%>
<%if(objectsearchpath)%>
OBJECTSEARCHPATH = \
<%foreach(libpaths)%>
-j"<%libpath%>"<%fornotlast(" \\")%>
<%endfor%>
<%endif%>
EXEFLAGS = <%exeflags%>
LINKER_DLL_ARGUMENTS = <%linker_dll_arguments%>
LINKER_EXE_ARGUMENTS = <%linker_exe_arguments%>
!else
<%endfor%>
!error You must select one of these compilers:<%foreach(compilers)%> <%normalize(uc(compiler))%><%endfor%>
Expand Down Expand Up @@ -79,9 +91,7 @@ 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%>

<%if(use_vcl)%>
Expand Down Expand Up @@ -134,8 +144,9 @@ LFLAGS = \
-v<%if(libpaths)%> \<%endif%>
<%endif%>
<%foreach(libpaths)%>
-L"<%libpath%>" -j"<%libpath%>"<%fornotlast(" \\")%>
-L"<%libpath%>" \
<%endfor%>
$(OBJECTSEARCHPATH)
<%endif%>

LIBFILES = \
Expand Down Expand Up @@ -202,7 +213,7 @@ $(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE)
<%eval(prelink)%>
<%endif%>
$(LINK) @&&!
$(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
$(LINKER_EXE_ARGUMENTS)
!

<%endif%>
Expand All @@ -217,7 +228,7 @@ $(OUTPUTDIR)$(NAME)$(DLL_EXT): $(OBJFILES) $(RESOURCE)
<%eval(prelink)%>
<%endif%>
$(LINK) @&&!
$(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
$(LINKER_DLL_ARGUMENTS)
!
!endif

Expand Down
36 changes: 28 additions & 8 deletions templates/bmakecommon.mpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ 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

bcc32 {
debug_flags = -v -y -Od -vi- -k
Expand All @@ -34,6 +32,11 @@ common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT) $(CG_LIB)
tlib = tlib
pch = 1
ccflags = -q
dllflags = -Tpd -Gi -x -Gn -w-dup
object_search_path = 1
exeflags = -Tpe -x -Gn
linker_dll_arguments = $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
linker_exe_arguments = $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
}

bcc32c {
Expand All @@ -53,6 +56,11 @@ link = ilink32
common_libs = ws2_32$(LIB_EXT) import32$(LIB_EXT) cw32mti$(LIB_EXT)
tlib = tlib
ccflags = -q
dllflags = -Tpd -Gi -x -Gn -w-dup
object_search_path = 1
exeflags = -Tpe -x -Gn
linker_dll_arguments = $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
linker_exe_arguments = $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
}

bcc64 {
Expand All @@ -72,6 +80,11 @@ link = ilink64
common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT)
tlib = tlib64
ccflags = -q
dllflags = -Tpd -Gi -x -Gn -w-dup
exeflags = -Tpe -x -Gn
object_search_path = 1
linker_dll_arguments = $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
linker_exe_arguments = $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
}

bcc64x {
Expand All @@ -81,14 +94,21 @@ warn_flags =
cc = bcc64x
binary_flags = -tR -tD
thr_flags = -tM
lib_ext = .a
lib_ext = .lib
common_defines = WIN32 _WINDOWS WIN64
common_flags =
common_flags = -Qunused-arguments
obj_ext = .o
linker_paths = -L\"$(BDS)\lib\win64x\debug\" -L\"$(BDS)\lib\win64x\release\"
linker_paths = -L\"$(BDS)\lib\win64x\debug\" -L\"$(BDS)\lib\win64x\release\" -L\"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64\" -L\"$(BDS)\x86_64-w64-mingw32\lib\" -L\"$(BDS)\lib\clang\15.0.7\lib\windows\"
startup_bits = 64
link = bcc64x
common_libs = ws2_32$(LIB_EXT) import64$(LIB_EXT) cw64mti$(LIB_EXT)
ccflags = -q
link = ld.lld
common_libs = crtbegin.o ws2_32$(LIB_EXT) -lmoldname -lucrt -lmingw32 -lmingwex -l\"c++\" -lunwind -lmingwthrd -l:import64$(LIB_EXT) libclang_rt.builtins-x86_64.a
dll_libs = dllcrt2.o
exe_libs = crt2.o
tlib = tlib64
ccflags =
dllflags = -m i386pep -shared --Bstatic --enable-auto-image-base
exeflags = -m i386pep --Bstatic
object_search_path = 0
linker_dll_arguments = $(DLLFLAGS) $(LFLAGS) $(OBJFILES) -o $(OUTPUTDIR)$(NAME)$(DLL_EXT) --out-implib $(OUTPUTDIR)$(NAME).lib $(DLLLIBS) $(LIBFILES) $(RESOURCE)
linker_exe_arguments = $(EXEFLAGS) $(LFLAGS) $(OBJFILES) -o $(OUTPUTDIR)$(NAME).exe $(EXELIBS) $(LIBFILES) $(RESOURCE)
}

0 comments on commit 94a3d7e

Please sign in to comment.