[llvm-bugs] [Bug 35277] New: clang-4.0.1 introduces randomness into binaries

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 10 12:51:32 PST 2017


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

            Bug ID: 35277
           Summary: clang-4.0.1 introduces randomness into binaries
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvmbmw at lsmod.de
                CC: llvm-bugs at lists.llvm.org

Originally filed at
https://bugzilla.opensuse.org/show_bug.cgi?id=1067478

When working on making openSUSE Linux package builds reproducible,
I found that our gnustep-libobjc2 differed across builds because
libobjc2-1.8.1 contains an arc.m that produces 8 different .o files when
compiled with clang-4.0.1, unless ASLR is disabled.

>From that I condensed this standalone minimal reproducer:

cat > test.m <<EOF
typedef id (*IMP)(id, ...);
static Class c1;
void f1(void)
{
   @selector(f2);
   IMP v1 = @selector(f3);
}
EOF
for i in $(seq 15) ; do 
  clang -c test.m -o /dev/stdout 2>/dev/null | md5sum ; done |
  sort | uniq -c | wc -l

Actual Result: 2
Expected Result: 1

Same result with clang-5.0.0

-- 
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/20171110/6bc3cb32/attachment.html>


More information about the llvm-bugs mailing list