Skip to content

Commit

Permalink
Use -fPIC always.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Oct 19, 2024
1 parent bc558d6 commit 170aef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC=gcc
CFLAGS=-Wall -Wextra -O3 $(XCFLAGS)
CFLAGS=-Wall -Wextra -O3 -fPIC $(XCFLAGS)
#CFLAGS=-Wall -Wextra -ggdb3 -O $(XCFLAGS)
ANALYZE=-fanalyzer
LIB=libscary.so
Expand All @@ -16,7 +16,7 @@ testlib.o scary.o: scary.h
$(CC) $(CFLAGS) -S -c $<

%.so:
$(CC) $(CFLAGS) -shared -fPIC $^ -o $@
$(CC) $(CFLAGS) -shared $^ -o $@

test: testlib
env LD_LIBRARY_PATH=. ./$<
Expand Down

0 comments on commit 170aef6

Please sign in to comment.