Skip to content

Commit

Permalink
allow compile on a Mac
Browse files Browse the repository at this point in the history
Apple's binutils ld ships with the default of `-undefined,error` so
it will error on link.
Also, it uses -install_name rather than -soname

I didn't change the name of the .so file. Might be a good idea to use
cmake to support cross-platform compilation.
  • Loading branch information
Gareth Davidson committed Jul 29, 2021
1 parent 2928a80 commit 266f08c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion _eSSP/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
LIBS=-lstdc++ -lpthread

UNAME := $(shell uname)

ifeq ($(UNAME), Darwin)
LINK = -Wl,-undefined,dynamic_lookup,-install_name,libessp.so.1
else
LINK = -Wl,-soname,libessp.so.1
endif

.PHONY: clean

libessp.so:
Expand All @@ -8,7 +16,7 @@ libessp.so:
$(CC) -c -fPIC -ggdb -g3 -o $@ $^

libessp.so: init.o ssp_helpers.o linux.o lib/bin/libitlssp.a
$(CC) -shared -fPIC -ggdb -g3 -Wl,-soname,libessp.so.1 -o $@ $^
$(CC) -shared -fPIC -ggdb -g3 $(LINK) -o $@ $^

lib/bin/libitlssp.a:
mkdir -p lib/bin/shared
Expand Down

0 comments on commit 266f08c

Please sign in to comment.