aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-07-30 00:40:20 -0700
committerJosh Triplett <josh@freedesktop.org>2007-07-30 00:40:20 -0700
commit0d4adf3564521f412a90b6267fe5e245d2a8258c (patch)
tree7f3cfd01e73b04af5df3bbd48c8866119d3cd152 /Makefile
parentAdd some missing dependencies in the Makefile (diff)
downloadsparse-0d4adf3564521f412a90b6267fe5e245d2a8258c.tar.gz
sparse-0d4adf3564521f412a90b6267fe5e245d2a8258c.tar.bz2
sparse-0d4adf3564521f412a90b6267fe5e245d2a8258c.zip
Drop -fpic; it hurts performance and we don't build libsparse.so by default
Sparse doesn't have a stable shared library interface, and doesn't build libsparse.so by default. However, it used -fpic, which incurred a noticeable performance hit. Remove -fpic from the default CFLAGS, and add a comment near the definition of LIBS about adding it back if building a shared library. You probably want to build Sparse twice if you want a shared library: once without -fpic to build the Sparse tools, and again with -fpic to build the shared library. Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 314453a..97bfe3b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ VERSION=0.3
OS=linux
CC=gcc
-CFLAGS=-O2 -finline-functions -g -Wall -Wwrite-strings -fpic
+CFLAGS=-O2 -finline-functions -g -Wall -Wwrite-strings
LDFLAGS=-g
AR=ar
@@ -44,6 +44,12 @@ LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
LIB_FILE= libsparse.a
SLIB_FILE= libsparse.so
+# If you add $(SLIB_FILE) to this, you also need to add -fpic to CFLAGS above.
+# Doing so incurs a noticeable performance hit, and Sparse does not have a
+# stable shared library interface, so this does not occur by default. If you
+# really want a shared library, you may want to build Sparse twice: once
+# without -fpic to get all the Sparse tools, and again with -fpic to get the
+# shared library.
LIBS=$(LIB_FILE)
#