Skip to content

[SYCL][DeviceSanitizer] Use -asan-constructor-kind=none to disable ctor/dtor #13259

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

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Apr 3, 2024

The removed code fails to prevent ctor/dtor generation.

…or/dtor

The removed code fails to prevent ctor/dtor generation.
Copy link
Contributor

@AllanZyne AllanZyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1151,6 +1151,9 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
CmdArgs.push_back("-mllvm");
CmdArgs.push_back("-asan-instrumentation-with-call-threshold=0");

CmdArgs.push_back("-mllvm");
CmdArgs.push_back("-asan-constructor-kind=none");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update clang/test/Driver/sycl-device-sanitizer.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// RUN: %clangxx -fsycl-device-only -fno-sycl-early-optimizations -Xarch_device -fsanitize=address -emit-llvm %s -S -o %t.ll
// RUN: FileCheck %s --input-file %t.ll

// CHECK-NOT: asan.module_ctor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining why we want that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@wenju-he
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge, thanks.

@ldrumm
Copy link
Contributor

ldrumm commented Apr 11, 2024

@intel/llvm-gatekeepers please merge, thanks.

We still need @intel/dpcpp-clang-driver-reviewers

Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenju-he
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge, thanks

@sommerlukas sommerlukas merged commit 4b14d70 into intel:sycl Apr 16, 2024
@wenju-he wenju-he deleted the asan-constructor-kind=none branch April 17, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants