mirror of
https://github.com/decompme/decomp.me.git
synced 2026-04-24 16:08:49 -05:00
[WIP] Add Borland 3.1 compiler to MS-DOS platform (#1419)
* Add Borland 3.1 compiler to MS-DOS platform * Fix formatting * Remove useless "rm" * Update asm-differ
This commit is contained in:
@@ -58,7 +58,9 @@ jobs:
|
||||
- name: Install msdos assembler
|
||||
run: |-
|
||||
wget https://github.com/OmniBlade/binutils-gdb/releases/download/omf-build/omftools.tar.gz
|
||||
sudo tar xvzf omftools.tar.gz -C /usr/bin jwasm omf-nm omf-objdump
|
||||
sudo tar xvzf omftools.tar.gz -C /usr/bin jwasm
|
||||
wget https://github.com/sillyc0n/binutils-gdb/releases/download/2.42-build7/omftools-2.42-build7-linux-x86_64.tar.gz
|
||||
sudo tar xvzf omftools-2.42-build7-linux-x86_64.tar.gz -C /usr/bin omf-nm omf-objdump
|
||||
- name: Install mips PS2 binutils
|
||||
run: |-
|
||||
wget https://github.com/decompals/binutils-mips-ps2-decompals/releases/download/v0.4/binutils-mips-ps2-decompals-linux-x86-64.tar.gz
|
||||
|
||||
+5
-2
@@ -100,8 +100,11 @@ RUN if [ "${ENABLE_PS2_SUPPORT}" = "YES" ] || [ "${ENABLE_PSP_SUPPORT}" = "YES"
|
||||
# msdos specific
|
||||
RUN if [ "${ENABLE_MSDOS_SUPPORT}" = "YES" ]; then \
|
||||
wget "https://github.com/OmniBlade/binutils-gdb/releases/download/omf-build/omftools.tar.gz" && \
|
||||
tar xvzf omftools.tar.gz -C /usr/bin jwasm omf-nm omf-objdump && \
|
||||
rm omftools.tar.gz; \
|
||||
tar xvzf omftools.tar.gz -C /usr/bin jwasm && \
|
||||
rm omftools.tar.gz && \
|
||||
wget "https://github.com/sillyc0n/binutils-gdb/releases/download/2.42-build7/omftools-2.42-build7-linux-x86_64.tar.gz" && \
|
||||
tar xvzf omftools-2.42-build7-linux-x86_64.tar.gz -C /usr/bin omf-nm omf-objdump && \
|
||||
rm omftools-2.42-build7-linux-x86_64.tar.gz; \
|
||||
fi
|
||||
|
||||
# Patched PowerPC binutils
|
||||
|
||||
@@ -186,6 +186,7 @@ msdos:
|
||||
- wcc10.5a
|
||||
- wcc10.6
|
||||
- wcc11.0
|
||||
- bcc3.1
|
||||
|
||||
win32:
|
||||
- msvc4.0
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
.386P
|
||||
.model FLAT
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ from coreapp.flags import (
|
||||
COMMON_MWCC_PSP_FLAGS,
|
||||
COMMON_MWCC_WII_GC_FLAGS,
|
||||
COMMON_WATCOM_FLAGS,
|
||||
COMMON_BORLAND_FLAGS,
|
||||
Flags,
|
||||
Language,
|
||||
)
|
||||
@@ -184,6 +185,12 @@ class WatcomCompiler(Compiler):
|
||||
library_include_flag: str = "/IZ:"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BorlandCompiler(Compiler):
|
||||
flags: ClassVar[Flags] = COMMON_BORLAND_FLAGS
|
||||
library_include_flag: str = ""
|
||||
|
||||
|
||||
def from_id(compiler_id: str) -> Compiler:
|
||||
if compiler_id not in _compilers:
|
||||
raise APIException(
|
||||
@@ -1472,6 +1479,19 @@ WATCOM_110_CPP = WatcomCompiler(
|
||||
cc=WATCOM_CXX,
|
||||
)
|
||||
|
||||
BORLAND_MSDOS_CC = (
|
||||
'cat "$INPUT" | unix2dos > dos_src.c && '
|
||||
"echo \"\$_hdimage = '+0 ${COMPILER_DIR} +1'\" > .dosemurc && "
|
||||
'(HOME="." /usr/bin/dosemu -quiet -dumb -f .dosemurc -K . -E "D:\\bin\\bcc.exe -ID:\\include ${COMPILER_FLAGS} -c -oout.o dos_src.c") && '
|
||||
'cp out.o "$OUTPUT"'
|
||||
)
|
||||
|
||||
BORLAND_31_C = BorlandCompiler(
|
||||
id="bcc3.1",
|
||||
platform=MSDOS,
|
||||
cc=BORLAND_MSDOS_CC,
|
||||
)
|
||||
|
||||
_all_compilers: List[Compiler] = [
|
||||
DUMMY,
|
||||
DUMMY_LONGRUNNING,
|
||||
@@ -1682,6 +1702,8 @@ _all_compilers: List[Compiler] = [
|
||||
WATCOM_106_CPP,
|
||||
WATCOM_110_C,
|
||||
WATCOM_110_CPP,
|
||||
# Borland, DOS
|
||||
BORLAND_31_C,
|
||||
]
|
||||
|
||||
_compilers = OrderedDict({c.id: c for c in _all_compilers if c.available()})
|
||||
|
||||
@@ -133,7 +133,7 @@ class DiffWrapper:
|
||||
|
||||
@staticmethod
|
||||
def parse_objdump_flags(diff_flags: List[str]) -> List[str]:
|
||||
known_objdump_flags = ["-Mno-aliases"]
|
||||
known_objdump_flags = ["-Mno-aliases", "--reloc"]
|
||||
known_objdump_flag_prefixes = ["-Mreg-names=", "--disassemble="]
|
||||
ret = []
|
||||
|
||||
|
||||
@@ -323,3 +323,7 @@ COMMON_WATCOM_FLAGS: Flags = [
|
||||
Checkbox("watcom_signedchar", "-j"),
|
||||
Checkbox("watcom_fpu", "-fpi87"),
|
||||
]
|
||||
|
||||
COMMON_MSDOS_DIFF_FLAGS: Flags = [Checkbox("diff_reloc", "--reloc")]
|
||||
|
||||
COMMON_BORLAND_FLAGS: Flags = []
|
||||
|
||||
@@ -4,7 +4,12 @@ from typing import Any, Dict, OrderedDict
|
||||
from pathlib import Path
|
||||
import functools
|
||||
|
||||
from coreapp.flags import COMMON_DIFF_FLAGS, COMMON_MIPS_DIFF_FLAGS, Flags
|
||||
from coreapp.flags import (
|
||||
COMMON_DIFF_FLAGS,
|
||||
COMMON_MIPS_DIFF_FLAGS,
|
||||
COMMON_MSDOS_DIFF_FLAGS,
|
||||
Flags,
|
||||
)
|
||||
from coreapp.models.preset import Preset
|
||||
from coreapp.models.scratch import Scratch
|
||||
from rest_framework.exceptions import APIException
|
||||
@@ -78,10 +83,12 @@ MSDOS = Platform(
|
||||
id="msdos",
|
||||
name="Microsoft DOS",
|
||||
description="x86",
|
||||
arch="i686",
|
||||
arch="x86",
|
||||
assemble_cmd='jwasm -c -Fo"$OUTPUT" -Fi"$PRELUDE" "$INPUT"',
|
||||
objdump_cmd="omf-objdump",
|
||||
nm_cmd="omf-nm",
|
||||
supports_objdump_disassemble=True,
|
||||
diff_flags=COMMON_DIFF_FLAGS + COMMON_MSDOS_DIFF_FLAGS,
|
||||
)
|
||||
|
||||
WIN32 = Platform(
|
||||
|
||||
Generated
+1
-1
@@ -51,7 +51,7 @@ watchdog = "^4.0.1"
|
||||
type = "git"
|
||||
url = "https://github.com/simonlindholm/asm-differ.git"
|
||||
reference = "HEAD"
|
||||
resolved_reference = "89e9c7044039ed18117ea45b6e1f551da49172cc"
|
||||
resolved_reference = "eba951ece61461ce03d1b49a6f065532a87b52f6"
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
|
||||
@@ -219,6 +219,8 @@
|
||||
"wcc11.0": "Watcom Optimizing C i386 Compiler 11.0",
|
||||
"wpp11.0": "Watcom Optimizing C++ i386 Compiler 11.0",
|
||||
|
||||
"bcc3.1": "Borland C i386 Compiler 3.1",
|
||||
|
||||
"cygnus-2.7-96Q3": "cygnus-2.7-96Q3 SOA-960904",
|
||||
|
||||
"armcc_opt_level": "Optimization level",
|
||||
@@ -458,6 +460,7 @@
|
||||
"mno_aliases": "Disable pseudo instructions",
|
||||
"no_show_rodata_refs": "Hide rodata refs in diff, e.g. jtbl labels",
|
||||
"diff_function_symbols": "Include function labels in diff",
|
||||
"diff_reloc": "Diff relocation",
|
||||
|
||||
"diff_algorithm": "Diff algorithm",
|
||||
"diff_algorithm.-DIFFlevenshtein": "Levenshtein",
|
||||
|
||||
Reference in New Issue
Block a user