-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-101525: Skip test_gdb if the binary is relocated by BOLT. #118572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8755316
973abd6
83d879c
af9c391
e9ec9b9
2d6d05a
b854706
c0bd894
ea13917
0e9d019
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -866,6 +866,17 @@ def check_cflags_pgo(): | |
return any(option in cflags_nodist for option in pgo_options) | ||
|
||
|
||
def check_bolt_optimized(): | ||
# BOLTed binary can be checked based on ELF information. | ||
# link: https://github.com/llvm/llvm-project/issues/60253 | ||
binary_path = sys.executable | ||
with open(binary_path, 'rb') as f: | ||
binary = f.read() | ||
if b'.note.bolt_info' in binary: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also think it will be the best way to handle this issue. But I am not sure it will be okay to call external binary for this. I may need to get opinions from @vstinner and @erlend-aasland WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not checking sysconfig? This check looks slow and not reliable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do you have any recommendation points? CFLAG does not guarantee the build is BOLTed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe test:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only put the code in test_gdb if you're worried that the the test is not reliable. And add a comment to explain it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well then there is no way to display the optimization information but okay got it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We call external binaries in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
AFAIK, it's part of binutils: https://sourceware.org/binutils/docs/binutils/readelf.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks. |
||
return True | ||
return False | ||
|
||
|
||
Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED')) | ||
|
||
def requires_gil_enabled(msg="needs the GIL enabled"): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Skip test_gdb if the binary is BOLTed. Patch by Donghee Na. | ||
|
Uh oh!
There was an error while loading. Please reload this page.