mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
sanity: Refactor "C++ toolchain support this flag" check
This can be use to check for other flags. (From OE-Core rev: 42d012e8414736d89618422fb6f9bce9e4a2a391) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
07563ec1b5
commit
503ff92f45
@@ -607,9 +607,9 @@ def drop_v14_cross_builds(d):
|
|||||||
bb.utils.remove(stamp + "*")
|
bb.utils.remove(stamp + "*")
|
||||||
bb.utils.remove(workdir, recurse = True)
|
bb.utils.remove(workdir, recurse = True)
|
||||||
|
|
||||||
def check_cpp_toolchain(d):
|
def check_cpp_toolchain_flag(d, flag, error_message=None):
|
||||||
"""
|
"""
|
||||||
it checks if the c++ compiling and linking to libstdc++ works properly in the native system
|
Checks if the C++ toolchain support the given flag
|
||||||
"""
|
"""
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -622,12 +622,12 @@ def check_cpp_toolchain(d):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cmd = shlex.split(d.getVar("BUILD_CXX")) + ["-x", "c++","-", "-o", "/dev/null", "-lstdc++"]
|
cmd = shlex.split(d.getVar("BUILD_CXX")) + ["-x", "c++","-", "-o", "/dev/null", flag]
|
||||||
try:
|
try:
|
||||||
subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True)
|
subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True)
|
||||||
return None
|
return None
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
return f"An unexpected issue occurred during the C++ toolchain check: {str(e)}"
|
return error_message or f"An unexpected issue occurred during the C++ toolchain check: {str(e)}"
|
||||||
|
|
||||||
def sanity_handle_abichanges(status, d):
|
def sanity_handle_abichanges(status, d):
|
||||||
#
|
#
|
||||||
@@ -802,7 +802,7 @@ def check_sanity_version_change(status, d):
|
|||||||
status.addresult(check_case_sensitive(tmpdir, "TMPDIR"))
|
status.addresult(check_case_sensitive(tmpdir, "TMPDIR"))
|
||||||
|
|
||||||
# Check if linking with lstdc++ is failing
|
# Check if linking with lstdc++ is failing
|
||||||
status.addresult(check_cpp_toolchain(d))
|
status.addresult(check_cpp_toolchain_flag(d, "-lstdc++"))
|
||||||
|
|
||||||
def sanity_check_locale(d):
|
def sanity_check_locale(d):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user