$OpenBSD: patch-src_common_mak,v 1.2 2015/05/22 09:17:35 kettenis Exp $
--- src/common.mak.orig	Sat Jun 14 20:11:08 2008
+++ src/common.mak	Fri May 22 11:13:12 2015
@@ -3,11 +3,11 @@
 V = 2.4
 
 DEFS   = -DREX_OPENLIB=luaopen_$(TRG) -DREX_LIBNAME=\"$(TRG)\"
-CFLAGS = $(MYCFLAGS) $(DEFS) $(INC)
+CFLAGS+= $(MYCFLAGS) $(DEFS) $(INC)
 TRG_AR = lib$(TRG).a
 TRG_SO = $(TRG).so
-LD     = ld
-LDFLAGS= -shared
+LD     = cc
+LDFLAGS= -fPIC -shared
 
 all: $(TRG_AR) $(TRG_SO)
 
