[LLVMbugs] [Bug 3594] New: clang: ccc -fPIC/-DPIC not working on x86-64

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Feb 16 12:12:35 PST 2009


           Summary: clang: ccc -fPIC/-DPIC not working on x86-64
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Now that va-arg has been fixed on x86-64,  I've tested clang and got a linker
error, here's a reduced testcase:

$ ccc -fPIC -DPIC -c foo.c -o foo.o
$ ccc -shared foo.o -o foo.so
ccc: Unknown host 'linux', using generic host information.
/usr/bin/ld: foo.o: relocation R_X86_64_32S against `a' can not be used when
making a shared object; recompile with -fPIC
foo.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

That error message is what you usually get with gcc if you DON'T use PIC.
But I used PIC with ccc, and I still get the error.

/* foo.c */
int a;
int foo()
    return a;

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