ports/devel/jna/files/patch-native_Makefile
Antoine Brodin 53b64bbf77 Fix build on i386 with lld
PR:		234718
2019-04-28 11:04:25 +00:00

37 lines
1.2 KiB
Text

--- native/Makefile.orig 2017-12-27 19:27:16 UTC
+++ native/Makefile
@@ -39,6 +39,8 @@
# protection simply by defining HAVE_PROTECTION. This option has been only
# been enabled for those platforms on which it has been tested successfully.
+unexport LDFLAGS
+
OS=$(shell uname | sed -e 's/CYGWIN.*/win32/g' \
-e 's/MINGW32.*/win32/g' \
-e 's/SunOS.*/solaris/g' \
@@ -278,8 +280,11 @@ endif
ifneq (,$(findstring bsd,$(OS)))
ARCH=$(shell uname -m | sed 's/i.86/i386/g')
PCFLAGS+=-fPIC
-CINCLUDES+=-I/usr/X11R6/include
+CINCLUDES+=-I%%LOCALBASE%%/include
LDFLAGS=-o $@ -shared
+ifeq ($(ARCH),i386)
+LDFLAGS+=-Wl,-z,notext
+endif
CDEFINES+=-DHAVE_PROTECTION -DFFI_MMAP_EXEC_WRIT -DUSE_DEAFULT_LIBNAME_ENCODING
endif
@@ -336,10 +341,10 @@ endif
ifeq ($(CC),gcc)
GCC_MAJOR_VERSION = $(shell gcc -dumpversion | cut -f 1 -d '.')
ifneq ($(GCC_MAJOR_VERSION),4)
- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable
+ LOC_CC_OPTS=-Werror -Wno-unused-variable
endif
else
- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable
+ LOC_CC_OPTS=-Werror -Wno-unused-variable
endif
# Enable 64-bit builds if the arch demands it