diff options
author | David Benjamin <davidben@chromium.org> | 2015-01-27 20:36:16 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-01-27 22:32:17 +0300 |
commit | 69ad27fdd88de89edab13eaa5e134aa1d1b292c0 (patch) | |
tree | 80e046bd783ad5d644a619dfb5849e8d13e72270 /crypto | |
parent | 36eb7d5fbc841987be3d6272884c07c90328dbb1 (diff) |
Run x86 perlasm on UNIX with -fPIC.
This matches the Chromium build.
Change-Id: I6ebd01c6ecb67c79577f98cf468dc204721595ef
Reviewed-on: https://boringssl-review.googlesource.com/3063
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index ca8bb8be..6fa0a268 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -1,6 +1,9 @@ include_directories(. ../include) if(APPLE) + if (${ARCH} STREQUAL "x86") + set(PERLASM_FLAGS "-fPIC") + endif() set(PERLASM_STYLE macosx) set(ASM_EXT S) enable_language(ASM) @@ -9,6 +12,9 @@ elseif(UNIX) # The "armx" Perl scripts look for "64" in the style argument # in order to decide whether to generate 32- or 64-bit asm. set(PERLASM_STYLE linux64) + elseif (${ARCH} STREQUAL "x86") + set(PERLASM_FLAGS "-fPIC") + set(PERLASM_STYLE elf) else() set(PERLASM_STYLE elf) endif() @@ -31,7 +37,7 @@ endif() function(perlasm dest src) add_custom_command( OUTPUT ${dest} - COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${ARGN} > ${dest} + COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} > ${dest} DEPENDS ${src} ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl |