Skip to content

Commit 9fda0fa

Browse files
author
quantum
committed
[WebAssembly] Lower ASan constructor priority on Emscripten
Summary: This change gives Emscripten the ability to use more than one constructor priorities that runs before ASan. By convention, constructor priorites 0-100 are reserved for use by the system. ASan on Emscripten now uses priority 50, leaving plenty of room for use by Emscripten before and after ASan. This change is done in response to: emscripten-core/emscripten#9076 (comment) Reviewers: kripken, tlively, aheejin Reviewed By: tlively Subscribers: cfe-commits, dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D65684 git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@368101 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e4d4585 commit 9fda0fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/CodeGen/asan-constructor.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fsanitize=address -emit-llvm -o - %s | FileCheck %s --check-prefix=EMSCRIPTEN
3+
4+
// CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }]
5+
// EMSCRIPTEN: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 50, void ()* @asan.module_ctor, i8* null }]

0 commit comments

Comments
 (0)