[LLVMbugs] [Bug 16330] New: __attirbute__ ((common)) has no expected effect when compiling for iOS or iOS Simulator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 14 04:46:34 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16330

            Bug ID: 16330
           Summary: __attirbute__ ((common)) has no expected effect when
                    compiling for iOS or iOS Simulator
           Product: dragonegg
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: New Bugs
          Assignee: baldrick at free.fr
          Reporter: petr.lefner at aponia.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Hello,
had someone ever used Clang's extensions inside ObjC++ file, namely the
__attribute__ ((common)) ?

For me, there's a problem with that, LLVM Linker reports 'duplicit symbol'
error if I declare a variable with same name in .mm file and one or more .m or
.cpp files:

/* foo_A.m */

__attribute__ ((common)) int foo;

/* foo_B.m */

__attribute__ ((common)) int foo;

/* foo_C.mm */

__attribute__ ((common)) int foo;


Gives linker error.

However, everything is fine, once I obey the use of 'foo' in the 'foo_C.mm', or
just rename the variable - linker feels happy.

Is this behavior expected?

Reported clang version:
clang++ --version
Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

LLVM version:
llvm-g++-4.2 --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)
(LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
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/20130614/04006075/attachment.html>


More information about the llvm-bugs mailing list