pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

hashcat: building clean-up



Module Name:	pkgsrc-wip
Committed By:	Adam Ciarciński <adam%netbsd.org@localhost>
Pushed By:	adam
Date:		Wed Jan 18 15:05:43 2017 +0100
Changeset:	515aa6524b28891b9cccf23b23b53609e03c67e1

Modified Files:
	hashcat/distinfo
	hashcat/patches/patch-src_Makefile

Log Message:
hashcat: building clean-up

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=515aa6524b28891b9cccf23b23b53609e03c67e1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 hashcat/distinfo                   |  2 +-
 hashcat/patches/patch-src_Makefile | 96 +++++++++++++++++++++++++++++++++++---
 2 files changed, 90 insertions(+), 8 deletions(-)

diffs:
diff --git a/hashcat/distinfo b/hashcat/distinfo
index 5e0e3e6..f5c9513 100644
--- a/hashcat/distinfo
+++ b/hashcat/distinfo
@@ -4,4 +4,4 @@ SHA1 (hashcat-3.30.tar.gz) = 8295ecc0be053aad75f3ef3d25263505e21acb58
 RMD160 (hashcat-3.30.tar.gz) = cfebc1103809155d35d010436b314c069f033a84
 SHA512 (hashcat-3.30.tar.gz) = 8f160a5ec4bd9add83cfc468e9335dcfc9297585180c67263fce18235a8b748f75205fa5bd5ddd1c34efc65569d94408ba98c6181a2b1ab760f33371f92c3c54
 Size (hashcat-3.30.tar.gz) = 3970267 bytes
-SHA1 (patch-src_Makefile) = 36beb7cdc645243299939aed3a414e5c6e1ace89
+SHA1 (patch-src_Makefile) = a9513b22cb28ddeb48b38fcc4cace6c101873cf0
diff --git a/hashcat/patches/patch-src_Makefile b/hashcat/patches/patch-src_Makefile
index 9c92077..8510472 100644
--- a/hashcat/patches/patch-src_Makefile
+++ b/hashcat/patches/patch-src_Makefile
@@ -1,6 +1,9 @@
 $NetBSD$
 
 Add minimal NetBSD support.
+Don't override CC nor optimisation flags in CFLAGS.
+Avoid -march=native.
+Fix shared dynamic library handing on Darwin.
 
 --- src/Makefile.orig	2017-01-06 07:54:39.000000000 +0000
 +++ src/Makefile
@@ -13,29 +16,108 @@ Add minimal NetBSD support.
  $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
  endif
  
-@@ -168,6 +168,16 @@ CFLAGS                  += -fsanitize=ad
+@@ -52,7 +52,11 @@ DOCUMENT_FOLDER         ?= $(PREFIX)/sha
+ ##
+ 
+ HASHCAT_FRONTEND        := hashcat
++ifeq ($(UNAME),Darwin)
++HASHCAT_LIBRARY         := libhashcat.dylib
++else
+ HASHCAT_LIBRARY         := libhashcat.so
++endif
+ 
+ ifeq ($(UNAME),CYGWIN)
+ HASHCAT_FRONTEND        := hashcat.exe
+@@ -76,22 +80,20 @@ OPENCL_HEADERS_KHRONOS  := deps/OpenCL-H
+ ## Native compiler paths
+ ##
+ 
+-CC                      := gcc
+ FIND                    := find
+ INSTALL                 := install
+ RM                      := rm
+ SED                     := sed
+ 
+ ifeq ($(UNAME),Darwin)
+-CC                      := clang
+ SED                     := gsed
+ endif
+ 
+ ifeq ($(UNAME),FreeBSD)
+-CC                      := cc
+ SED                     := gsed
+ endif
+ 
++
+ ##
+ ## Cross compiler paths
+ ##
+@@ -158,16 +160,20 @@ endif
+ 
+ LFLAGS                  := $(LDFLAGS)
+ 
+-ifndef DEBUG
+-CFLAGS                  += -O2
+-LFLAGS                  += -s
+-else
++ifdef DEBUG
+ CFLAGS                  += -DDEBUG -g -ggdb
+ ifeq ($(DEBUG),2)
+ CFLAGS                  += -fsanitize=address -fno-omit-frame-pointer
  endif
  endif
  
 +ifeq ($(UNAME),NetBSD)
 +CFLAGS_NATIVE            := -D_POSIX
-+ifndef DEBUG
-+CFLAGS_NATIVE            += -s
-+endif
 +CFLAGS_NATIVE            += $(CFLAGS)
 +LFLAGS_NATIVE            := -lpthread
 +CFLAGS_NATIVE            += -DHAVE_HWMON
-+endif # netbsd
++endif # NetBSD
 +
  ##
  ## Native compilation target
  ##
-@@ -388,7 +398,7 @@ $(HASHCAT_LIBRARY): $(NATIVE_SHARED_OBJS
+@@ -175,7 +181,6 @@ endif
+ ifeq ($(UNAME),Linux)
+ CFLAGS_NATIVE           := $(CFLAGS)
+ CFLAGS_NATIVE           += -I$(OPENCL_HEADERS_KHRONOS)/
+-CFLAGS_NATIVE           += -march=native
+ CFLAGS_NATIVE           += -DWITH_HWMON
+ LFLAGS_NATIVE           := $(LFLAGS)
+ LFLAGS_NATIVE           += -lpthread -ldl
+@@ -185,7 +190,6 @@ ifeq ($(UNAME),FreeBSD)
+ ifndef PORTNAME
+ CFLAGS_NATIVE           := $(CFLAGS)
+ CFLAGS_NATIVE           += -I$(OPENCL_HEADERS_KHRONOS)/
+-CFLAGS_NATIVE           += -march=native
+ LFLAGS_NATIVE           := $(LFLAGS)
+ LFLAGS_NATIVE           += -lpthread
+ endif
+@@ -194,7 +198,6 @@ endif # FreeBSD
+ ifeq ($(UNAME),Darwin)
+ export MACOSX_DEPLOYMENT_TARGET=10.9
+ CFLAGS_NATIVE           := $(CFLAGS)
+-CFLAGS_NATIVE           += -march=native
+ LFLAGS_NATIVE           := $(LFLAGS)
+ LFLAGS_NATIVE           += -framework OpenCL
+ LFLAGS_NATIVE           += -lpthread
+@@ -227,6 +230,10 @@ endif # MSYS2
+ CFLAGS_NATIVE_SHARED    := $(CFLAGS_NATIVE)
+ CFLAGS_NATIVE_SHARED    += -fpic
+ LFLAGS_NATIVE_SHARED    := $(LFLAGS_NATIVE)
++ifeq ($(UNAME),Darwin)
++LFLAGS_NATIVE_SHARED    += -dylib
++LFLAGS_NATIVE_SHARED    += -install_name $(DESTDIR)$(LIBRARY_FOLDER)/$(HASHCAT_LIBRARY)
++endif
+ 
+ ##
+ ## Cross compilation targets
+@@ -388,7 +395,7 @@ $(HASHCAT_LIBRARY): $(NATIVE_SHARED_OBJS
  	$(CC) -o $@ $^ $(LFLAGS_NATIVE_SHARED) -shared
  
  $(HASHCAT_FRONTEND): $(NATIVE_OBJS) $(HASHCAT_LIBRARY) src/main.c
 -	$(CC)    $(CFLAGS_NATIVE) -o $@ $^ $(LFLAGS_NATIVE) -L. -lhashcat -Wl,-rpath . -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
-+	$(CC)    $(CFLAGS_NATIVE) -o $@ $^ $(LFLAGS_NATIVE) -L. -lhashcat -Wl,-rpath. -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
++	$(CC)    $(CFLAGS_NATIVE) -o $@ $^ $(LFLAGS_NATIVE) -L. -lhashcat -Wl,-rpath=. -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
  
  ##
  ## cross compiled hashcat


Home | Main Index | Thread Index | Old Index