Skip to content

clang annotation are not removed from binary in release builds #26216

@sbc100

Description

@sbc100

For example:

$ cat test.c 
[[clang::annotate("foobar")]]
int main() {
  return 0;
}
$ emcc -Oz test.c 
$ llvm-objdump -h a.out.wasm 

a.out.wasm:	file format wasm

Sections:
Idx Name                           Size     VMA      Type
  0 TYPE                           0000000a 0000000a 
  1 FUNCTION                       00000003 00000016 
  2 MEMORY                         00000006 0000001b 
  3 EXPORT                         0000000d 00000023 
  4 CODE                           00000009 00000032 TEXT
  5 llvm.func_attr.annotate.foobar 00000004 0000003d 

Here you can see the foobar custom section in the final binary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions