Skip to content

Commit

Permalink
fix(gcc): add -fPIC to mimalloc compilation
Browse files Browse the repository at this point in the history
Wasn't needed on clang, but is needed with gcc:

    /usr/bin/ld: mimalloc-override.o: relocation R_X86_64_TPOFF32
    against `recurse' can not be used when making a shared object;
    recompile with -fPIC
  • Loading branch information
wincent committed Sep 2, 2022
1 parent 2adeda7 commit 0938103
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/wincent/commandt/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $(eval $(call DEPEND_ON,CCFLAGS))
$(eval $(call DEPEND_ON,USE_MIMALLOC))

$(MIMALLOC_OVERRIDE): $(MIMALLOC_HDRS) $(MIMALLOC_SRCS) Makefile .make/CCFLAGS
$(CC) $(CCFLAGS) -I$(MIMALLOC_INCLUDE) -c -o $(MIMALLOC_OVERRIDE) $(MIMALLOC_SRC)/static.c
$(CC) $(CCFLAGS) -I$(MIMALLOC_INCLUDE) -c -fPIC -o $(MIMALLOC_OVERRIDE) $(MIMALLOC_SRC)/static.c

commandt.$(DLLEXT): $(HDRS) $(SRCS) $(MIMALLOC_OVERRIDE) Makefile .make/CCFLAGS .make/USE_MIMALLOC
$(CC) $(CCFLAGS) -shared -fPIC -o commandt.$(DLLEXT) $(MALLOC_OBJ) $(SRCS)
Expand Down

0 comments on commit 0938103

Please sign in to comment.