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
4949 WIN32_O = $(I386_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
5050 WIN64_O = $(X86_64_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
5151
52+# build TCC runtime library to contain PIC code, so it can be linked
53+# into shared libraries
54+PICFLAGS = -fPIC
55+
5256 ifeq "$(TARGET)" "i386-win32"
5357 OBJ = $(addprefix $(DIR)/,$(WIN32_O))
5458 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
@@ -83,7 +87,7 @@ endif · 28 unmodified lines
8387 endif
8488 endif
8589
86−XFLAGS = $(CPPFLAGS) $(CFLAGS) $(TGT)
90+XFLAGS = $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) $(TGT)
8791
8892 ifeq ($(TARGETOS),Darwin)
8993 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