Skip to content

Commit

Permalink
Merge pull request #36 from jserv/build-version-script
Browse files Browse the repository at this point in the history
Hide non-public symbols with LD version script
  • Loading branch information
WEI, CHEN committed Mar 25, 2018
2 parents d559a7d + 3ea1ab0 commit 41eb093
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ OUT ?= ./build
SRC := src

CFLAGS = -Wall -fPIC
LDFLAGS = -lpthread
LDFLAGS = \
-lpthread

UNAME_S := $(shell uname -s)
ifneq ($(UNAME_S),Darwin)
# GNU ld specific options
LDFLAGS += \
-Wl,--gc-sections \
-Wl,--as-needed \
-Wl,--version-script=./mk/libdcurl.version
endif

-include $(OUT)/local.mk

Expand Down
14 changes: 14 additions & 0 deletions mk/libdcurl.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CODEABI_1.0 {
global:
/* core */
dcurl_*;

/* compat */
ccurl_*;

/* JNI */
Java_com_iota_iri_hash_PearlDiver*;

local: *;
};

0 comments on commit 41eb093

Please sign in to comment.