[llvm-bugs] [Bug 47925] New: [ASan] -fno-common generates a comdat with asan options

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 20 13:56:02 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47925

            Bug ID: 47925
           Summary: [ASan] -fno-common generates a comdat with asan
                    options
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Wolfgang_Pieb at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The following trivial source generates a comdat for 'bar' when using ASan:

/*==================*/
char bar;
/*==================*/


clang -emit-llvm -S -fsanitize=address -fdata-sections
-fsanitize-address-globals-dead-stripping -c bar.c

bar.ll:

<snip>
@bar = dso_local global { i8, [63 x i8] } zeroinitializer, comdat, align 32
<snip>

Without either -fsanitize-address-globals-dead-stripping or -fdata-sections no
comdat is generated.

The consequence is that we don't find some ODR violations at link time with
these options.

Note that commit
https://github.com/llvm/llvm-project/commit/3d9a0445cce368b55dc3a573bc91fe902bbb977f
changed the default to -fno-common. Before, you would have to give -fno-common
on the command line to trigger this behaviour.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201020/d5202b1e/attachment.html>


More information about the llvm-bugs mailing list