Skip to content

Commit

Permalink
WhitleyOpenBoardPkg/Build: Fix GCC build issues
Browse files Browse the repository at this point in the history
Fix build warning in PlatformInfo.c.
Fix script invocation issues in build_board.py for AML
content build in WilsonCityRvp and JunctionCity.

Cc: Nate DeSimone <[email protected]>
Cc: Chasel Chiu <[email protected]>
Signed-off-by: Isaac Oram <[email protected]>
Reviewed-by: Nate DeSimone <[email protected]>
  • Loading branch information
iworam committed May 2, 2022
1 parent 38855c5 commit 6b05b8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
11 changes: 8 additions & 3 deletions Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def pre_build_ex(config, functions):

execute_script = functions.get("execute_script")

command = ["build", "-D", "MAX_SOCKET=" + config["MAX_SOCKET"]]
# AML offset arch is X64, not sure if it matters.
command = ["build", "-a", "X64", "-t", config["TOOL_CHAIN_TAG"], "-D", "MAX_SOCKET=" + config["MAX_SOCKET"]]

if config["EXT_BUILD_FLAGS"] and config["EXT_BUILD_FLAGS"] != "":
ext_build_flags = config["EXT_BUILD_FLAGS"].split(" ")
Expand All @@ -79,7 +80,11 @@ def pre_build_ex(config, functions):
command.append(os.path.join(config["WORKSPACE"], "PreBuildReport.txt"))
command.append("--log=" + os.path.join(config["WORKSPACE"], "PreBuild.log"))

_, _, _, code = execute_script(command, config)
shell = True
if os.name == "posix": # linux
shell = False

_, _, _, code = execute_script(command, config, shell=shell)
if code != 0:
print(" ".join(command))
print("Error re-generating PlatformOffset header files")
Expand Down Expand Up @@ -109,7 +114,7 @@ def pre_build_ex(config, functions):
os.path.join(config["BUILD_X64"], aml_offsets_split[0], aml_offsets_split[1], aml_offsets_split[1], "OUTPUT", os.path.dirname(relative_dsdt_file_path), dsdt_file_root_ext[0] + ".offset.h")]

# execute the command
_, _, _, code = execute_script(command, config)
_, _, _, code = execute_script(command, config, shell=shell)
if code != 0:
print(" ".join(command))
print("Error re-generating PlatformOffset header files")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ PdrGetPlatformInfo (
return Status;
}

if ((PlatformInfoHob->BoardId >= TypePlatformMin) && (PlatformInfoHob->BoardId <= TypePlatformMax) ||
(PlatformInfoHob->BoardId >= TypePlatformVendorMin) && (PlatformInfoHob->BoardId <= TypePlatformVendorMax)) {
if (((PlatformInfoHob->BoardId >= TypePlatformMin) && (PlatformInfoHob->BoardId <= TypePlatformMax)) ||
((PlatformInfoHob->BoardId >= TypePlatformVendorMin) && (PlatformInfoHob->BoardId <= TypePlatformVendorMax))) {
//
// Valid Platform Identified
//
Expand Down
11 changes: 8 additions & 3 deletions Platform/Intel/WhitleyOpenBoardPkg/WilsonCityRvp/build_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def pre_build_ex(config, functions):

execute_script = functions.get("execute_script")

command = ["build", "-D", "MAX_SOCKET=" + config["MAX_SOCKET"]]
# AML offset arch is X64, not sure if it matters.
command = ["build", "-a", "X64", "-t", config["TOOL_CHAIN_TAG"], "-D", "MAX_SOCKET=" + config["MAX_SOCKET"]]

if config["EXT_BUILD_FLAGS"] and config["EXT_BUILD_FLAGS"] != "":
ext_build_flags = config["EXT_BUILD_FLAGS"].split(" ")
Expand All @@ -77,7 +78,11 @@ def pre_build_ex(config, functions):
command.append(os.path.join(config["WORKSPACE"], "PreBuildReport.txt"))
command.append("--log=" + os.path.join(config["WORKSPACE"], "PreBuild.log"))

_, _, _, code = execute_script(command, config)
shell = True
if os.name == "posix": # linux
shell = False

_, _, _, code = execute_script(command, config, shell=shell)
if code != 0:
print(" ".join(command))
print("Error re-generating PlatformOffset header files")
Expand Down Expand Up @@ -107,7 +112,7 @@ def pre_build_ex(config, functions):
os.path.join(config["BUILD_X64"], aml_offsets_split[0], aml_offsets_split[1], aml_offsets_split[1], "OUTPUT", os.path.dirname(relative_dsdt_file_path), dsdt_file_root_ext[0] + ".offset.h")]

# execute the command
_, _, _, code = execute_script(command, config)
_, _, _, code = execute_script(command, config, shell=shell)
if code != 0:
print(" ".join(command))
print("Error re-generating PlatformOffset header files")
Expand Down

0 comments on commit 6b05b8a

Please sign in to comment.