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.
This commit is contained in:
parent
3e56584223
commit
ea2805f097
1 changed files with 5 additions and 1 deletions
|
|
@ -49,6 +49,10 @@ ARM_O = libtcc1.o armeabi.o
|
||||||
WIN32_O = $(I386_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.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
|
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"
|
ifeq "$(TARGET)" "i386-win32"
|
||||||
OBJ = $(addprefix $(DIR)/,$(WIN32_O))
|
OBJ = $(addprefix $(DIR)/,$(WIN32_O))
|
||||||
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
|
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
|
||||||
|
|
@ -83,7 +87,7 @@ endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
XFLAGS = $(CPPFLAGS) $(CFLAGS) $(TGT)
|
XFLAGS = $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) $(TGT)
|
||||||
|
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue