VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Build/Include/Makefile.inc4
-rwxr-xr-xsrc/Build/Tools/MacOSX/nasmbin1818752 -> 0 bytes
-rw-r--r--src/Makefile15
-rw-r--r--src/Volume/Volume.make30
4 files changed, 24 insertions, 25 deletions
diff --git a/src/Build/Include/Makefile.inc b/src/Build/Include/Makefile.inc
index 9a38dcee..2e9e9b4f 100644
--- a/src/Build/Include/Makefile.inc
+++ b/src/Build/Include/Makefile.inc
@@ -31,8 +31,8 @@ clean:
ifeq "$(PLATFORM)" "MacOSX"
%.o: %.asm
@echo Assembling $(<F)
- $(AS) $(ASFLAGS) -f macho32 -o $@.32 $<
- $(AS) $(ASFLAGS) -f macho64 -o $@.64 $<
+ $(AS) $(ASFLAGS32) -f macho32 -o $@.32 $<
+ $(AS) $(ASFLAGS64) -f macho64 -o $@.64 $<
lipo -create $@.32 $@.64 -output $@
else
%.o: %.asm
diff --git a/src/Build/Tools/MacOSX/nasm b/src/Build/Tools/MacOSX/nasm
deleted file mode 100755
index 7d2c38ac..00000000
--- a/src/Build/Tools/MacOSX/nasm
+++ /dev/null
Binary files differ
diff --git a/src/Makefile b/src/Makefile
index c1c4f02f..af83d874 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -38,14 +38,13 @@ export BUILD_INC := $(BASE_DIR)/Build/Include
export AR ?= ar
export CC ?= gcc
export CXX ?= g++
-export AS := nasm
-export YASM := yasm
+export AS := yasm
export RANLIB ?= ranlib
export CFLAGS := -Wall
export CXXFLAGS := -Wall -Wno-unused-parameter
C_CXX_FLAGS := -MMD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I$(BASE_DIR) -I$(BASE_DIR)/Crypto
-export ASFLAGS := -Ox -D __GNUC__
+export ASFLAGS := -D __GNUC__
export LFLAGS :=
export PKG_CONFIG_PATH ?= /usr/local/lib/pkgconfig
@@ -136,10 +135,10 @@ ARCH = $(shell uname -m)
ifneq (,$(filter i386 i486 i586 i686 x86,$(ARCH)))
CPU_ARCH = x86
- ASFLAGS += -f elf32
+ ASFLAGS += -f elf32 -D __BITS__=32
else ifneq (,$(filter x86_64 x86-64 amd64 x64,$(ARCH)))
CPU_ARCH = x64
- ASFLAGS += -f elf64
+ ASFLAGS += -f elf64 -D __BITS__=64
endif
ifeq "$(origin NOASM)" "command line"
@@ -251,9 +250,9 @@ ifeq "$(shell uname -s)" "Darwin"
CXXFLAGS += -mssse3 -msse4.1
endif
- AS := $(BASE_DIR)/Build/Tools/MacOSX/nasm
- YASM := $(BASE_DIR)/Build/Tools/MacOSX/yasm
- ASFLAGS += --prefix _
+ AS := $(BASE_DIR)/Build/Tools/MacOSX/yasm
+ export ASFLAGS32 := -D __GNUC__ -D __BITS__=32 --prefix _ -f macho32
+ export ASFLAGS64 := -D __GNUC__ -D __BITS__=64 --prefix _ -f macho64
ifeq "$(TC_BUILD_CONFIG)" "Release"
diff --git a/src/Volume/Volume.make b/src/Volume/Volume.make
index e179c563..9f2bc063 100644
--- a/src/Volume/Volume.make
+++ b/src/Volume/Volume.make
@@ -91,46 +91,46 @@ VolumeLibrary: Volume.a
ifeq "$(PLATFORM)" "MacOSX"
../Crypto/Aes_asm.oo: ../Crypto/Aes_x86.asm ../Crypto/Aes_x64.asm
@echo Assembling $(<F)
- $(AS) $(ASFLAGS) -f macho32 -o ../Crypto/Aes_x86.o ../Crypto/Aes_x86.asm
- $(AS) $(ASFLAGS) -f macho64 -o ../Crypto/Aes_x64.o ../Crypto/Aes_x64.asm
+ $(AS) $(ASFLAGS32) -o ../Crypto/Aes_x86.o ../Crypto/Aes_x86.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/Aes_x64.o ../Crypto/Aes_x64.asm
lipo -create ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o -output ../Crypto/Aes_asm.oo
rm -fr ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o
../Crypto/Twofish_asm.oo: ../Crypto/Twofish_x64.S
@echo Assembling $(<F)
- $(YASM) -p gas -f macho64 -o ../Crypto/Twofish_asm.oo ../Crypto/Twofish_x64.S
+ $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Twofish_asm.oo ../Crypto/Twofish_x64.S
../Crypto/Camellia_asm.oo: ../Crypto/Camellia_x64.S
@echo Assembling $(<F)
- $(YASM) -p gas -f macho64 -o ../Crypto/Camellia_asm.oo ../Crypto/Camellia_x64.S
+ $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_asm.oo ../Crypto/Camellia_x64.S
../Crypto/Camellia_aesni_asm.oo: ../Crypto/Camellia_aesni_x64.S
@echo Assembling $(<F)
- $(YASM) -p gas -f macho64 -o ../Crypto/Camellia_aesni_asm.oo ../Crypto/Camellia_aesni_x64.S
+ $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_aesni_asm.oo ../Crypto/Camellia_aesni_x64.S
../Crypto/sha256-nayuki.oo: ../Crypto/sha256-x86-nayuki.S
@echo Assembling $(<F)
- $(YASM) -p gas -f macho32 -o ../Crypto/sha256-nayuki.oo ../Crypto/sha256-x86-nayuki.S
+ $(AS) $(ASFLAGS32) -p gas -o ../Crypto/sha256-nayuki.oo ../Crypto/sha256-x86-nayuki.S
../Crypto/sha256_avx1.oo: ../Crypto/sha256_avx1_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha256_avx1.oo ../Crypto/sha256_avx1_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx1.oo ../Crypto/sha256_avx1_x64.asm
../Crypto/sha256_avx2.oo: ../Crypto/sha256_avx2_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha256_avx2.oo ../Crypto/sha256_avx2_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx2.oo ../Crypto/sha256_avx2_x64.asm
../Crypto/sha256_sse4.oo: ../Crypto/sha256_sse4_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha256_sse4.oo ../Crypto/sha256_sse4_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha256_sse4.oo ../Crypto/sha256_sse4_x64.asm
../Crypto/sha512-nayuki.oo: ../Crypto/sha512-x86-nayuki.S ../Crypto/sha512-x64-nayuki.S
@echo Assembling $(<F)
- $(YASM) -p gas -f macho32 -o ../Crypto/sha512-x86-nayuki.o ../Crypto/sha512-x86-nayuki.S
- $(YASM) -p gas -f macho64 -o ../Crypto/sha512-x64-nayuki.o ../Crypto/sha512-x64-nayuki.S
- lipo -create ../Crypto/sha512-x64-nayuki.o ../Crypto/sha512-x64-nayuki.o -output ../Crypto/sha512-nayuki.oo
+ $(AS) -p gas $(ASFLAGS32) -o ../Crypto/sha512-x86-nayuki.o ../Crypto/sha512-x86-nayuki.S
+ $(AS) -p gas $(ASFLAGS64) -o ../Crypto/sha512-x64-nayuki.o ../Crypto/sha512-x64-nayuki.S
+ lipo -create ../Crypto/sha512-x86-nayuki.o ../Crypto/sha512-x64-nayuki.o -output ../Crypto/sha512-nayuki.oo
rm -fr ../Crypto/sha512-x86-nayuki.o ../Crypto/sha512-x64-nayuki.o
../Crypto/sha512_avx1.oo: ../Crypto/sha512_avx1_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha512_avx1.oo ../Crypto/sha512_avx1_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx1.oo ../Crypto/sha512_avx1_x64.asm
../Crypto/sha512_avx2.oo: ../Crypto/sha512_avx2_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha512_avx2.oo ../Crypto/sha512_avx2_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx2.oo ../Crypto/sha512_avx2_x64.asm
../Crypto/sha512_sse4.oo: ../Crypto/sha512_sse4_x64.asm
@echo Assembling $(<F)
- $(YASM) -f macho64 -o ../Crypto/sha512_sse4.oo ../Crypto/sha512_sse4_x64.asm
+ $(AS) $(ASFLAGS64) -o ../Crypto/sha512_sse4.oo ../Crypto/sha512_sse4_x64.asm
endif
include $(BUILD_INC)/Makefile.inc