History

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.

Michael Matz committed 12 years ago

Commit ea2805f1 parent 3e565841 file · +5 −1Browse files

Unified · Split

lib/Makefile+5−1
@@ -49,6 +49,10 @@ ARM_O = libtcc1.o armeabi.o · 48 unmodified lines
49WIN32_O = $(I386_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o49WIN32_O = $(I386_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
50WIN64_O = $(X86_64_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o50WIN64_O = $(X86_64_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
51 51
52# build TCC runtime library to contain PIC code, so it can be linked
53# into shared libraries
54PICFLAGS = -fPIC
55
52ifeq "$(TARGET)" "i386-win32"56ifeq "$(TARGET)" "i386-win32"
53 OBJ = $(addprefix $(DIR)/,$(WIN32_O))57 OBJ = $(addprefix $(DIR)/,$(WIN32_O))
54 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE58 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
@@ -83,7 +87,7 @@ endif · 28 unmodified lines
83endif87endif
84endif88endif
85 89
86XFLAGS = $(CPPFLAGS) $(CFLAGS) $(TGT)90XFLAGS = $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) $(TGT)
87 91
88ifeq ($(TARGETOS),Darwin)92ifeq ($(TARGETOS),Darwin)
89 XAR = $(DIR)/tiny_libmaker$(EXESUF)93 XAR = $(DIR)/tiny_libmaker$(EXESUF)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t