shared libs: Build libtcc1.a with -fPIC

TCCs runtime library must be compiled as position independend code,
so it can be linked into shared libraries.
master
Michael Matz 2014-04-02 21:27:22 +02:00
parent 3e56584223
commit ea2805f097
1 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,10 @@ ARM_O = libtcc1.o armeabi.o
WIN32_O = $(I386_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
WIN64_O = $(X86_64_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
# build TCC runtime library to contain PIC code, so it can be linked
# into shared libraries
PICFLAGS = -fPIC
ifeq "$(TARGET)" "i386-win32"
OBJ = $(addprefix $(DIR)/,$(WIN32_O))
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
@ -83,7 +87,7 @@ endif
endif
endif
XFLAGS = $(CPPFLAGS) $(CFLAGS) $(TGT)
XFLAGS = $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) $(TGT)
ifeq ($(TARGETOS),Darwin)
XAR = $(DIR)/tiny_libmaker$(EXESUF)