Я пытаюсь установить cryptlib3.4.5 на docker контейнер, т.е. работает под управлением Ubuntu: 18.04. Версия clang - 6.0.0. Я смог установить cryptlib на Ubuntu docker, используя make и make install.
make output
clang -c -D__UNIX__ -DNDEBUG -I. -DDATA_LITTLEENDIAN -DFIXED_SEED=0x53971d66b3260c4f -Wno-pointer-sign -Wno-switch -DHAS_RECURSIVE_MUTEX -DHAS_ROBUST_MUTEX -DOSVERSION=4 -O3 -fomit-frame-pointer -D_REENTRANT test/suiteb.c
clang -c -D__UNIX__ -DNDEBUG -I. -DDATA_LITTLEENDIAN -DFIXED_SEED=0x53971d66b3260c4f -Wno-pointer-sign -Wno-switch -DHAS_RECURSIVE_MUTEX -DHAS_ROBUST_MUTEX -DOSVERSION=4 -O3 -fomit-frame-pointer -D_REENTRANT test/testfunc.c
clang -c -D__UNIX__ -DNDEBUG -I. -DDATA_LITTLEENDIAN -DFIXED_SEED=0x53971d66b3260c4f -Wno-pointer-sign -Wno-switch -DHAS_RECURSIVE_MUTEX -DHAS_ROBUST_MUTEX -DOSVERSION=4 -O3 -fomit-frame-pointer -D_REENTRANT test/testlib.c
test/testfunc.c:1426:25: warning: '/*' within block comment [-Wcomment]
/*#define TEST_MEMFAULT /* Undefine to perform memory-fault tests */
^
1 warning generated.
clang -c -D__UNIX__ -DNDEBUG -I. -DDATA_LITTLEENDIAN -DFIXED_SEED=0x53971d66b3260c4f -Wno-pointer-sign -Wno-switch -DHAS_RECURSIVE_MUTEX -DHAS_ROBUST_MUTEX -DOSVERSION=4 -O3 -fomit-frame-pointer -D_REENTRANT test/utils.c
test/utils.c:1501:19: warning: format specifies type 'int' but the argument has type 'HIRES_TIME' (aka 'unsigned long') [-Wformat]
printf( "%d, ", times[ i ] );
~~ ^~~~~~~~~~
%lu
1 warning generated.
clang version
root@2bacadf0266d:/tmp/cryptlib/bindings# clang -v
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
make install output
make[2]: Leaving directory '/tmp/cryptlib'
make[1]: Leaving directory '/tmp/cryptlib'
make[1]: Entering directory '/tmp/cryptlib'
make[1]: Leaving directory '/tmp/cryptlib'
if [ -f "libcl.a" ] ; then \
cp "libcl.a" "/usr/local/lib" ; \
chmod 644 "/usr/local/lib/libcl.a" ; \
fi
if [ -f "libcl.so.3.4.5" ] ; then \
cp "libcl.so.3.4.5" "/usr/local/lib" ; \
chmod 755 "/usr/local/lib/libcl.so.3.4.5" ; \
ln -s "libcl.so.3.4.5" "/usr/local/lib/libcl.so.3" ; \
ln -s "libcl.so.3.4.5" "/usr/local/lib/libcl.so" ; \
fi
if [ -f "libcl.3.4.dylib" ] ; then \
cp "libcl.3.4.dylib" "/usr/local/lib" ; \
chmod 755 "/usr/local/lib/libcl.3.4.dylib" ; \
fi
cp cryptlib.h "/usr/local/include"
chmod 644 "/usr/local/include/cryptlib.h"
Я вижу, что файл cryptlib.h был скопирован в папку / usr / local / include / после запуска make install. Теперь, если попытаетесь установить python3 привязку, запустив команду cd bindings && python3 setup.py install
. Я вижу, что установщик не работает по следующей причине:
creating build/lib.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/python.o -L.. -lcl -o build/lib.linux-x86_64-3.6/cryptlib_py.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: ../libcl.a(cryptapi.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../libcl.a(cryptcrt.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../libcl.a(cryptlib.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
!
/usr/bin/ld: ../libcl.a(icbc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../libcl.a(ctx_bnsieve.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Не могли бы вы сообщить мне, в чем может быть проблема?