[LLVMbugs] [Bug 14556] New: clang doesn't deal with inline functions properly; results in failures at link time

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 9 11:35:45 PST 2012


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

             Bug #: 14556
           Summary: clang doesn't deal with inline functions properly;
                    results in failures at link time
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: yanegomi at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9665
  --> http://llvm.org/bugs/attachment.cgi?id=9665
Inline test

I run into the following linker error when trying to compile the attached
program:

# clang -o /root/test_inline /root/test_inline.c
/tmp/test_inline-JRJ1GD.o: In function `foo':
/root/test_inline.c:(.text+0x36): undefined reference to `bar'
/root/test_inline.c:(.text+0x5f): undefined reference to `bar'
/root/test_inline.c:(.text+0x88): undefined reference to `bar'
/root/test_inline.c:(.text+0xb1): undefined reference to `bar'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# clang --version
FreeBSD clang version 3.2 (branches/release_32 168974) 20121130
Target: i386-unknown-freebsd10.0
Thread model: posix

Seems like clang is improperly handling the inline function.

gcc 4.2.1 on FreeBSD and gcc 4.7.2 on Fedora 17 doesn't have this issue. This
is the expected output:

# gcc -o /root/test_inline /root/test_inline.c
# /root/test_inline
-4: -1
41: -1
43: 43
85: -1

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list