-
Notifications
You must be signed in to change notification settings - Fork 1.4k
pass -fno-omit-frame-pointer in support of new backtracer #7042
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
Conversation
motivation: new backtracer relies on frame pointers. make sure we do not omit them. this can be removed once the backtracer uses DWARF instead of frame pointers changes: * intriduce new hidden "omitFramePointers" build option to explicit omit frame pointers * unless omitFramePointers is set to true (false by default), pass -fno-omit-frame-pointer to the compiler * adjust tests
cc @al45tair |
not sure if we want to do this on all platforms, but started with that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only concern would be that we are not doing any checking w.r.t. availability of the option, not sure if that gets us into trouble on any platforms.
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but also curious whether this should only be enabled for specific target platforms?
@swift-ci test windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a platform check. -fno-omit-frame-pointer
cannot be passed on all targets (e.g. armv7-unknown-windows-msvc
IIRC does object).
@swift-ci test |
this is now Linux specific unless users forces it |
@swift-ci test windows |
@compnerd ptal |
Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that @neonichu's idea to vend this as an enum is a great idea. It would avoid having the logic duplicated in multiple sites.
since optional bool already represents three states, we dont really need another enum. that said, moving the platform logic to BuildParameters::Debugging initializer is a good idea |
@swift-ci test |
@swift-ci test windows |
@@ -3511,18 +3538,68 @@ final class BuildPlanTests: XCTestCase { | |||
XCTAssertMatch(dep, [.anySequence, "-DDEP", .anySequence]) | |||
|
|||
let cbar = try result.target(for: "cbar").clangTarget().basicArguments(isCXX: false) | |||
XCTAssertMatch(cbar, [.anySequence, "-DCCC=2", "-I\(A.appending(components: "Sources", "cbar", "Sources", "headers"))", "-I\(A.appending(components: "Sources", "cbar", "Sources", "cppheaders"))", "-Icfoo", "-L", "cbar", "-Icxxfoo", "-L", "cxxbar", "-g", .end]) | |||
XCTAssertMatch(cbar, [.anySequence, "-DCCC=2", "-I\(A.appending(components: "Sources", "cbar", "Sources", "headers"))", "-I\(A.appending(components: "Sources", "cbar", "Sources", "cppheaders"))", "-Icfoo", "-L", "cbar", "-Icxxfoo", "-L", "cxxbar", "-g", "-fno-omit-frame-pointer", .end]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think so, why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for reference this is for .x86_64Linux
|
||
let exe = try result.target(for: "exe").swiftTarget().compileArguments() | ||
XCTAssertMatch(exe, [.anySequence, "-DFOO", "-g", "-Xcc", "-g", "-Xcc", "-fno-omit-frame-pointer", .end]) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I like that we're making these tests even more unmaintainable by copy-pasting two extra times, but I guess it's fine...
@swift-ci test macOS |
@@ -3059,7 +3083,7 @@ final class BuildPlanTests: XCTestCase { | |||
"-fblocks", "-fmodules", "-fmodule-name=lib", | |||
"-I", Pkg.appending(components: "Sources", "lib", "include").pathString, | |||
"-fmodules-cache-path=\(buildPath.appending(components: "ModuleCache"))", | |||
"-g", | |||
"-g" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the trailing ,
? It is convenient.
…7042) motivation: new backtracer relies on frame pointers. make sure we do not omit them. this can be removed once the backtracer uses DWARF instead of frame pointers changes: * introduce new hidden "omitFramePointers" build option to explicit omit frame pointers * unless user specifies omitFramePointers/noOmitFramePointers, pass -fno-omit-frame-pointer to the compiler on Linux only * add and adjust tests rdar://117578677
motivation: new backtracer relies on frame pointers. make sure we do not omit them. this can be removed once the backtracer uses DWARF instead of frame pointers
changes:
rdar://117578677