#57229 closed defect (fixed)

capstone always builds universal

Reported by: icepic (Janne Johansson) Owned by: aquynh@…
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: haspatch Cc:
Port: capstone

Description

Since Mojave, 386 builds will not work.

I don't know how to make it depend on Darwin_18 or what Mojaves identifier is, but on recent MacOS, the Makefile patch for capstone needs to look like this:

diff -u Makefile.orig Makefile
--- Makefile.orig	2018-07-18 18:17:10.000000000 +0200
+++ Makefile	2018-10-03 16:21:11.000000000 +0200
@@ -10,7 +10,7 @@
 
 OS := $(shell uname)
 ifeq ($(OS),Darwin)
-LIBARCHS = i386 x86_64
+LIBARCHS = x86_64
 PREFIX ?= /usr/local
 endif
 
@@ -267,16 +267,8 @@
 endif
 EXT = dylib
 VERSION_EXT = $(API_MAJOR).$(EXT)
-$(LIBNAME)_LDFLAGS += -dynamiclib -install_name lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
+$(LIBNAME)_LDFLAGS += -dynamiclib -install_name $(PREFIX)/lib/lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
 AR_EXT = a
-# Homebrew wants to make sure its formula does not disable FORTIFY_SOURCE
-# However, this is not really necessary because 'CAPSTONE_USE_SYS_DYN_MEM=yes' by default
-ifneq ($(HOMEBREW_CAPSTONE),1)
-ifneq ($(CAPSTONE_USE_SYS_DYN_MEM),yes)
-# remove string check because OSX kernel complains about missing symbols
-CFLAGS += -D_FORTIFY_SOURCE=0
-endif
-endif
 else
 CFLAGS += $(foreach arch,$(LIBARCHS),-arch $(arch))
 LDFLAGS += $(foreach arch,$(LIBARCHS),-arch $(arch))

Change History (2)

comment:1 Changed 23 months ago by ryandesign (Ryan Schmidt)

Keywords: haspatch added; i386 removed
Owner: set to aquynh@…
Port: capstone added; devel/capstone removed
Status: newassigned
Summary: capstone on Mojave tries to make i386 build.capstone always builds universal

comment:2 Changed 23 months ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: assignedclosed

In a1a4c4133169073f82ebfe1b40b131a9beac9dec/macports-ports (master):

capstone: Build for the right archs

Closes: #57229

Also add maintainer's GitHub handle.

Note: See TracTickets for help on using tickets.