--- a/Makefile	2021-08-18 18:30:18.000000000 +0200
+++ b/Makefile	2021-10-12 20:08:12.973944586 +0200
@@ -12,7 +12,7 @@
 MAJOR_VERSION := $(shell $(GIT2LOG) --version VERSION ; cut -d . -f 1 VERSION)
 
 CC	= gcc
-CFLAGS	= -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
+CFLAGS	= -g -O2 -fomit-frame-pointer -Wall
 LDFLAGS =
 
 LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
@@ -27,7 +27,7 @@
 .PHONY: all shared install test demo clean
 
 %.o: %.c
-	$(CC) -c $(CFLAGS) $<
+	$(CC) -c -fPIC -fvisibility=hidden $(CFLAGS) $<
 
 all: changelog shared
 
@@ -43,7 +43,7 @@
 	install -m 644 -D include/x86emu.h $(DESTDIR)/usr/include/x86emu.h
 
 $(LIB_NAME): .depend $(OBJS)
-	$(CC) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME) $(LDFLAGS)
+	$(CC) -fvisibility=hidden -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME) $(LDFLAGS)
 	@ln -snf $(LIB_NAME) $(LIB_SONAME)
 	@ln -snf $(LIB_SONAME) $(LIBX86).so
 
@@ -68,7 +68,7 @@
 
 ifneq "$(MAKECMDGOALS)" "clean"
 .depend: $(CFILES)
-	@$(CC) -MG -MM $(CFLAGS) $(CFILES) >$@
+	@$(CC) -MG -MM -fPIC -fvisibility=hidden $(CFLAGS) $(CFILES) >$@
 -include .depend
 endif
 
