Skip to content

Commit 36f712a

Browse files
committed
Adjusted Makefile to prevent SQLite calls hitting the system libs which prevents Unity editor crashes in Linux
1 parent 2851fb5 commit 36f712a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Plugins/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ lib/windows/%/gilzoide-sqlite-net.dll: lib/windows/%/sqlite3.o~ | lib/windows/%
3939

4040
# Linux
4141
lib/linux/%/libgilzoide-sqlite-net.so: CFLAGS += -fPIC
42-
lib/linux/%/libgilzoide-sqlite-net.so: LINKFLAGS += -shared -lm
42+
43+
# Note: The line "-Wl,-Bsymbolic" prevents the dynamic linker from interposing the plugin’s calls to its
44+
# own exported symbols with identically-named symbols in other loaded libraries (like /usr/lib/libsqlite3.so.0).
45+
# And the line "-Wl,-rpath,'$$ORIGIN'" ensures the loader finds the .so’s dependencies (if any) in the same
46+
# folder as the plugin itself. Without these adjustments using the SQLite .so in the Unity editor will cause the
47+
# editor to crash.
48+
lib/linux/%/libgilzoide-sqlite-net.so: LINKFLAGS += \
49+
-shared -lm \
50+
-Wl,-Bsymbolic \
51+
-Wl,-rpath,'$$ORIGIN'
52+
4353
lib/linux/%/libgilzoide-sqlite-net.so: lib/linux/%/sqlite3.o~ | lib/linux/%
4454
$(CC) -o $@ $^ $(LINKFLAGS)
4555

0 commit comments

Comments
 (0)