[LLVMbugs] [Bug 9603] New: Relocation error on x86_64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 31 19:17:29 PDT 2011


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

           Summary: Relocation error on x86_64
           Product: dragonegg
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: New Bugs
        AssignedTo: baldrick at free.fr
        ReportedBy: oroppas at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Hi, when I compiled dragonegg on 64-bit version of Linux I got:

Linking dragonegg.so
/usr/bin/ld: cache.o: relocation R_X86_64_32 against `ggc_free' can not be used
when making a shared object; recompile with -fPIC
cache.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

I wonder if anyone can replicate the issue.

In my case, adding -fPIC to both CLFAGS ans CXXFLAGS fixed the problem.

Index: Makefile
===================================================================
--- Makefile    (revision 128542)
+++ Makefile    (working copy)
@@ -21,6 +21,11 @@
 CFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cflags)
 CXXFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags)

+ifeq ($(shell uname -m),x86_64)
+CFLAGS+=-fPIC
+CXXFLAGS+=-fPIC
+endif
+
 ifeq ($(shell uname),Darwin)
 LOADABLE_MODULE_OPTIONS=-bundle -undefined dynamic_lookup
 else

Cheers,

Ryuta

-- 
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