mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-29 06:10:09 +08:00
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
@ -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…
Reference in New Issue
Block a user