Skip to content

Relocation error on x86_64 #9975

@oroppas

Description

@oroppas
Bugzilla Link 9603
Resolution FIXED
Resolved on Apr 01, 2011 18:12
Version trunk
OS Linux
CC @oscarfv

Extended Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacmakeBuild system in general and CMake in particular

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions