Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdir Makefiles' compiler flags #5599

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/Makefile.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ linux-x86-64-avx512:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o" \
CFLAGS_MAIN="$(CFLAGS) -DJOHN_AVX512F -DHAVE_CRYPT" \
CFLAGS="$(CFLAGS) -mavx512f -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -mavx512f" \
CFLAGS="$(CFLAGS) -mavx512f -maes -mpclmul -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -mavx512f" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -lcrypt"

linux-x86-64-avx2:
Expand All @@ -357,8 +357,8 @@ linux-x86-64-avx2:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o" \
CFLAGS_MAIN="$(CFLAGS) -DJOHN_AVX2 -DHAVE_CRYPT" \
CFLAGS="$(CFLAGS) -mavx2 -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -mavx2" \
CFLAGS="$(CFLAGS) -mavx2 -maes -mpclmul -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -mavx2" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -lcrypt"

linux-x86-64-xop:
Expand All @@ -380,8 +380,8 @@ linux-x86-64-avx:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o simd-intrinsics.o" \
CFLAGS_MAIN="$(CFLAGS) -DJOHN_AVX -DHAVE_CRYPT -DHAVE_LIBDL" \
CFLAGS="$(CFLAGS) -mavx -DHAVE_CRYPT -DHAVE_LIBDL" \
ASFLAGS="$(ASFLAGS) -mavx" \
CFLAGS="$(CFLAGS) -mavx -maes -mpclmul -DHAVE_CRYPT -DHAVE_LIBDL" \
ASFLAGS="$(ASFLAGS) -mavx" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -lcrypt -ldl"
@echo "Failing after this point just means some helper tools did not build:"
$(MAKE_ORIG) $(PROJ_PCAP)
Expand Down Expand Up @@ -566,8 +566,8 @@ linux-x86-avx512:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86.o" \
CFLAGS_MAIN="$(CFLAGS) -m32 -DJOHN_AVX512F -DHAVE_CRYPT" \
CFLAGS="$(CFLAGS) -m32 -mavx512f -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx512f" \
CFLAGS="$(CFLAGS) -m32 -mavx512f -maes -mpclmul -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx512f" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -m32 -lcrypt"

linux-x86-avx2:
Expand All @@ -576,8 +576,8 @@ linux-x86-avx2:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86.o" \
CFLAGS_MAIN="$(CFLAGS) -m32 -DJOHN_AVX2 -DHAVE_CRYPT" \
CFLAGS="$(CFLAGS) -m32 -mavx2 -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx2" \
CFLAGS="$(CFLAGS) -m32 -mavx2 -maes -mpclmul -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx2" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -m32 -lcrypt"

linux-x86-xop:
Expand All @@ -599,8 +599,8 @@ linux-x86-avx:
$(MAKE_ORIG) $(PROJ) \
JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86.o x86-sse.o simd-intrinsics.o" \
CFLAGS_MAIN="$(CFLAGS) -m32 -DJOHN_AVX -DHAVE_CRYPT -D_LARGEFILE64_SOURCE" \
CFLAGS="$(CFLAGS) -m32 -mavx -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx" \
CFLAGS="$(CFLAGS) -m32 -mavx -maes -mpclmul -DHAVE_CRYPT" \
ASFLAGS="$(ASFLAGS) -m32 -mavx" -maes -mpclmul \
LDFLAGS="$(LDFLAGS) -m32 -lcrypt"
@echo "Failing after this point just means some helper tools did not build:"
$(MAKE_ORIG) $(PROJ_PCAP) CFLAGS="$(CFLAGS) -m32"
Expand Down
54 changes: 54 additions & 0 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -11790,6 +11790,60 @@ if test $simd != yes; then
fi
fi

if test "x$simd" != xno; then
CFLAGS_EX=""
if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -maes -mpclmul" >&5
$as_echo_n "checking if $CC supports -maes -mpclmul... " >&6; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

ac_saved_cflags="$CFLAGS"
CFLAGS="-Werror -maes -mpclmul"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if test "1" -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
CFLAGS_EX="$CFLAGS_EX -maes -mpclmul"

else
if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "1" = 2; then :
as_fn_error $? "Not supported by compiler" "$LINENO" 5
fi

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$ac_saved_cflags"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


CPU_BEST_FLAGS="$CPU_BEST_FLAGS $CFLAGS_EX"
fi

CC="$CC_BACKUP"
CFLAGS="$CFLAGS_BACKUP"

Expand Down
2 changes: 1 addition & 1 deletion src/ed25519-donna/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AS = @CC@
LD = @CC@
CPP = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ -Wno-unused-function
CFLAGS = -c -DAC_BUILT @CC_CPU@ @CC_MAIN_CPU@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ @CPPFLAGS@ -Wno-unused-function
ASFLAGS = @ASFLAGS@ -c @EXTRA_AS_FLAGS@
LDFLAGS = @LDFLAGS@ @OPENSSL_LIBS@
AR = @AR@
Expand Down
7 changes: 7 additions & 0 deletions src/m4/jtr_x86_logic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ if test $simd != yes; then
fi
fi

if test "x$simd" != xno; then
CFLAGS_EX=""
dnl Add -maes -mpclmul if supported
JTR_FLAG_CHECK([-maes -mpclmul], 1)
CPU_BEST_FLAGS="$CPU_BEST_FLAGS $CFLAGS_EX"
fi

CC="$CC_BACKUP"
CFLAGS="$CFLAGS_BACKUP"

Expand Down
2 changes: 1 addition & 1 deletion src/mbedtls/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CC = @CC@
AS = @CC@
LD = @CC@
CPP = @CC@
CFLAGS = @CFLAGS@ @CFLAGS_EXTRA@ @JOHN_NO_SIMD@ -std=c99
CFLAGS = -c -DAC_BUILT @CC_CPU@ @CC_MAIN_CPU@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ @CPPFLAGS@ -std=c99
ASFLAGS = @ASFLAGS@ -c @EXTRA_AS_FLAGS@
LDFLAGS = @LDFLAGS@
AR = @AR@
Expand Down
2 changes: 1 addition & 1 deletion src/poly1305-donna/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AS = @CC@
LD = @CC@
CPP = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ @CFLAGS_EXTRA@ -Wno-unused-function
CFLAGS = -c -DAC_BUILT @CC_CPU@ @CC_MAIN_CPU@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ @CPPFLAGS@ -Wno-unused-function
ASFLAGS = @ASFLAGS@ -c @EXTRA_AS_FLAGS@
LDFLAGS = @LDFLAGS@
AR = @AR@
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CXX = @CXX@
AS = @CC@
LD = @CC@
CPP = @CC@
CFLAGS = @CFLAGS@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ -Wno-unused-function
CFLAGS = -c -DAC_BUILT @CC_CPU@ @CC_MAIN_CPU@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ @CPPFLAGS@ -Wno-unused-function
ASFLAGS = @ASFLAGS@ -c @EXTRA_AS_FLAGS@
LDFLAGS = @LDFLAGS@ @OPENSSL_LIBS@
AR = @AR@
Expand Down
158 changes: 79 additions & 79 deletions src/ztex/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
# This software is Copyright (c) 2016 Denis Burykin
# [denis_burykin yahoo com], [denis-burykin2014 yandex ru]
# and it is hereby released to the general public under the following terms:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.
CC = gcc
CFLAGS = -c -Wall -O2 -g
CFLAGS_TEST = -O
#LD = ld
RM = /bin/rm -f
EXTRA_LIBS = -lusb-1.0
SUBDIRS = pkt_comm
TEST_OBJS = device.o inouttraffic.o ztex.o ztex_scan.o ztex_sn.o
OBJS = $(TEST_OBJS) device_format.o jtr_device.o jtr_mask.o task.o
TEST_EXTRA_OBJS = pkt_comm/pkt_comm.o pkt_comm/word_gen.o pkt_comm/word_list.o
EXTRA_OBJS = pkt_comm/*.o
#TESTS = simple_test test pkt_test
default: $(SUBDIRS) $(OBJS)
all: $(SUBDIRS) $(OBJS)
.PHONY: subdirs $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ all
device.o: device.c device.h
$(CC) $(CFLAGS) device.c
inouttraffic.o: inouttraffic.c inouttraffic.h
$(CC) $(CFLAGS) inouttraffic.c
ztex.o: ztex.c ztex.h
$(CC) $(CFLAGS) ztex.c
ztex_scan.o: ztex_scan.c ztex_scan.h
$(CC) $(CFLAGS) ztex_scan.c
ztex_sn.o: ztex_sn.c ztex_sn.h
$(CC) $(CFLAGS) ztex_sn.c
device_format.o: device_format.c device_format.h
$(CC) $(CFLAGS) device_format.c
jtr_device.o: jtr_device.c jtr_device.h
$(CC) $(CFLAGS) jtr_device.c
jtr_mask.o: jtr_mask.c jtr_mask.h
$(CC) $(CFLAGS) jtr_mask.c
task.o: task.c task.h
$(CC) $(CFLAGS) task.c
simple_test: simple_test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) simple_test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o simple_test
test: test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o test
pkt_test: pkt_test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) pkt_test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o pkt_test
clean:
find . -name \*.o -exec rm -f "{}" \;
rm -f *.exe simple_test test pkt_test
distclean: clean
$(RM) Makefile
# This software is Copyright (c) 2016 Denis Burykin
# [denis_burykin yahoo com], [denis-burykin2014 yandex ru]
# and it is hereby released to the general public under the following terms:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.

CC = gcc
CFLAGS = -c -DAC_BUILT @CC_CPU@ @CC_MAIN_CPU@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ @CPPFLAGS@
CFLAGS_TEST = -O
#LD = ld
RM = /bin/rm -f
EXTRA_LIBS = -lusb-1.0

SUBDIRS = pkt_comm

TEST_OBJS = device.o inouttraffic.o ztex.o ztex_scan.o ztex_sn.o

OBJS = $(TEST_OBJS) device_format.o jtr_device.o jtr_mask.o task.o

TEST_EXTRA_OBJS = pkt_comm/pkt_comm.o pkt_comm/word_gen.o pkt_comm/word_list.o

EXTRA_OBJS = pkt_comm/*.o

#TESTS = simple_test test pkt_test


default: $(SUBDIRS) $(OBJS)
all: $(SUBDIRS) $(OBJS)

.PHONY: subdirs $(SUBDIRS)

$(SUBDIRS):
$(MAKE) -C $@ all

device.o: device.c device.h
$(CC) $(CFLAGS) device.c

inouttraffic.o: inouttraffic.c inouttraffic.h
$(CC) $(CFLAGS) inouttraffic.c

ztex.o: ztex.c ztex.h
$(CC) $(CFLAGS) ztex.c

ztex_scan.o: ztex_scan.c ztex_scan.h
$(CC) $(CFLAGS) ztex_scan.c

ztex_sn.o: ztex_sn.c ztex_sn.h
$(CC) $(CFLAGS) ztex_sn.c

device_format.o: device_format.c device_format.h
$(CC) $(CFLAGS) device_format.c

jtr_device.o: jtr_device.c jtr_device.h
$(CC) $(CFLAGS) jtr_device.c

jtr_mask.o: jtr_mask.c jtr_mask.h
$(CC) $(CFLAGS) jtr_mask.c

task.o: task.c task.h
$(CC) $(CFLAGS) task.c



simple_test: simple_test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) simple_test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o simple_test

test: test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o test

pkt_test: pkt_test.c $(SUBDIRS) $(TEST_OBJS)
$(CC) $(CFLAGS_TEST) pkt_test.c $(TEST_OBJS) $(TEST_EXTRA_OBJS) $(EXTRA_LIBS) -o pkt_test


clean:
find . -name \*.o -exec rm -f "{}" \;
rm -f *.exe simple_test test pkt_test

distclean: clean
$(RM) Makefile
Loading