Skip to content

Commit

Permalink
Fix script so that GIMPLE and arm-unknown are correctly handled.
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Poulhiès <[email protected]>
  • Loading branch information
dkm committed Sep 7, 2024
1 parent 2da18e9 commit 17566b4
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions check_and_update_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import subprocess
import argparse

LANGS = ["ADA", "D", "FORTRAN", "CXX", "GO", "C", "OBJC", "OBJCXX"]
LANGS = ["ADA", "D", "FORTRAN", "CXX", "GO", "C", "OBJC", "OBJCXX", "GIMPLE"]

CT_LANGS = {
"ADA": "ADA",
Expand Down Expand Up @@ -116,6 +116,21 @@
""",
"OBJC": "int f(void){return 0;} int main (){return f();}",
"OBJCXX": "int f(void){return 0;} int main (){return f();}",
"GIMPLE": """
int __GIMPLE (ssa)
square (int num)
{
int D_1916;
int _2;
__BB(2):
_2 = num_1(D) * num_1(D);
goto __BB3;
__BB(3):
return _2;
}
""",
}


Expand Down Expand Up @@ -259,6 +274,7 @@ def parse_file(file: str):
"GO": "gccgo{arch}{version}",
"OBJC": "objc{arch}g{version}",
"OBJCXX": "objcpp{arch}g{version}",
"GIMPLE": "gimple{arch}g{version}",
}

COMPILER_ID_PATTERN["riscv64"] = {
Expand All @@ -270,6 +286,7 @@ def parse_file(file: str):
"GO": "gccgo{arch}{version}",
"OBJC": "objcrv32g{version}",
"OBJCXX": "objcppgccrv64{version}",
"GIMPLE": "rv64-gimplegcc{version}",
}

COMPILER_ID_PATTERN["riscv32"] = {
Expand All @@ -281,6 +298,7 @@ def parse_file(file: str):
"GO": "gccgo{arch}{version}",
"OBJC": "objcrv32g{version}",
"OBJCXX": "objcppgccrv32{version}",
"GIMPLE": "rv32-gimplegcc{version}",
}

COMPILER_ID_PATTERN["arm-unknown"] = {
Expand All @@ -292,6 +310,7 @@ def parse_file(file: str):
"GO": "gccgo{arch}u{version}",
"OBJC": "objc{arch}ug{version}",
"OBJCXX": "objcpp{arch}ug{version}",
"GIMPLE": "gimple{arch}ug{version}",
}

ARCH_RENAMING_IN_CONFIG = {
Expand All @@ -312,6 +331,7 @@ def parse_file(file: str):
"GO": "go",
"OBJC": "objc",
"OBJCXX": "objc++",
"GIMPLE": "gimple",
}

COMPILER_SUFFIX = {
Expand All @@ -323,6 +343,7 @@ def parse_file(file: str):
"GO": "gccgo",
"OBJC": "gcc",
"OBJCXX": "g++",
"GIMPLE": "gcc",
}


Expand Down Expand Up @@ -408,13 +429,15 @@ def generateConfig(arch: str, lang: str, version: str, directory: str, name):


def findFile(arch: str, lang: str, version: str, directory: str, suffix: str):
target_dir = "{directory}/{arch}/gcc-{version}/**/*-{suffix}".format(
directory=directory, arch=arch, version=version, suffix=suffix
)
if arch == "arm-unknown":
target_dir = f"{directory}/arm/gcc-arm-unknown-{version}/**/*-{suffix}"
else:
target_dir = f"{directory}/{arch}/gcc-{version}/**/*-{suffix}"

print("search in {}".format(target_dir))
for f in glob.glob(target_dir, recursive=True):
return abspath(f)
raise Woops("Can't find '{target_dir}, something's wrong")
raise Woops(f"Can't find '{target_dir}, something's wrong")


def findCompiler(arch: str, lang: str, version: str, directory: str):
Expand Down Expand Up @@ -657,7 +680,8 @@ def parse_previous_version(version, arch, lang, guess_previous, parsed_conf):
def check_lang_enabled_in_ctng(args, lang):

## You can't disable C \_o<
if lang == "C":
## GIMPLE is not enabled in CTNG, it's builtin GCC now.
if lang == "C" or lang == "GIMPLE":
return True

ct_ng_config = join("build", "latest", f"{args.arch}-{args.version}.config")
Expand Down

0 comments on commit 17566b4

Please sign in to comment.