os: CentOS 7.9 X86_64 openssl version:OpenSSL 3.0.1
make && make PREFIX=/usr USE_SYSTEMD=yes MALLOC=jemalloc V=1 BUILD_TLS=yes install
../deps/hiredis/libhiredis_ssl.a(ssl.o): In function redisInitOpenSSL':
/root/yunweipai/redis-7.0.0/deps/hiredis/ssl.c:159: undefined reference toSSL_library_init'
collect2: error: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/root/yunweipai/redis-7.0.0/src'
make: *** [install] Error 2
Comment From: oranagra
@spacexnasa please provide some context, and how this relates to #10280 i see you mentioned there that Centos 7.9 was ok.
are you saying the fix in #10291 doesn't work? or did it cause a regression?
Comment From: spacexnasa
@spacexnasa please provide some context, and how this relates to #10280 i see you mentioned there that Centos 7.9 was ok.
are you saying the fix in #10291 doesn't work? or did it cause a regression?
10280, i use git clone xxx and git checkout to 6.2.7,this can work
now i use wget https://github.com/redis/redis/archive/7.0.0.tar.gz && tar zxf 7.0.0.tar.gz and
make && make PREFIX=/usr USE_SYSTEMD=yes MALLOC=jemalloc V=1 BUILD_TLS=yes install
so i have not compare the code, i'm not sure they pathched the code
Comment From: InputOutputZ
It seems that you've another OpenSSL installed and its being referenced by Redis Makefile, therefore set OPENSSL_PREFIX to point to OpenSSL 3 headers, that's if compiled from repository source without prefix, it should work with the following settings.
make PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr/local/openssl
Comment From: spacexnasa
It seems that you've another OpenSSL installed and its being referenced by Redis Makefile, therefore set OPENSSL_PREFIX to point to OpenSSL 3 headers, that's if compiled from repository source without prefix, it should work with the following settings.
make PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr/local/openssl
yes, i installed the latest openssl version 3.0.3 (i installed the openssl to /usr) and try this make PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr
this is first error
cc -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -O2 -c -o lobject.o lobject.c ssl.c: In function ‘redisInitOpenSSL’: ssl.c:159:5: warning: implicit declaration of function ‘SSL_library_init’; did you mean ‘SSL_in_init’? [-Wimplicit-function-declaration] SSL_library_init(); ^~~~~~~~~~~~~~~~ SSL_in_init
this is last
cc -pedantic -DREDIS_STATIC='' -std=c11 -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -DHAVE_LIBSYSTEMD -DUSE_JEMALLOC -I../deps/jemalloc/include -DUSE_OPENSSL -I/usr/include -MMD -o cli_common.o -c cli_common.c
cli_common.c: In function ‘cliSecureInit’:
cli_common.c:197:5: warning: implicit declaration of function ‘ERR_load_crypto_strings’; did you mean ‘ERR_load_SSL_strings’? [-Wimplicit-function-declaration]
ERR_load_crypto_strings();
^~~~~~~~~~~~~~~~~~~~~~~
ERR_load_SSL_strings
cli_common.c:198:5: warning: implicit declaration of function ‘SSL_load_error_strings’; did you mean ‘ERR_lib_error_string’? [-Wimplicit-function-declaration]
SSL_load_error_strings();
^~~~~~~~~~~~~~~~~~~~~~
ERR_lib_error_string
cli_common.c:199:5: warning: implicit declaration of function ‘SSL_library_init’; did you mean ‘SSL_in_init’? [-Wimplicit-function-declaration]
SSL_library_init();
^~~~~~~~~~~~~~~~
SSL_in_init
cc -pedantic -DREDIS_STATIC='' -std=c11 -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -DHAVE_LIBSYSTEMD -DUSE_JEMALLOC -I../deps/jemalloc/include -DUSE_OPENSSL -I/usr/include -MMD -o redis-benchmark.o -c redis-benchmark.c
cc -g -ggdb -rdynamic -L/usr/lib -o redis-server adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o acl.o tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/jemalloc/lib/libjemalloc.a -lm -ldl -pthread -lrt -lsystemd ../deps/hiredis/libhiredis_ssl.a -lssl -lcrypto
../deps/hiredis/libhiredis_ssl.a(ssl.o): In function redisInitOpenSSL':
/usr/local/src/redis-7.0.0/deps/hiredis/ssl.c:159: undefined reference toSSL_library_init'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:373: redis-server] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/local/src/redis-7.0.0/src'
make: *** [Makefile:6: all] Error 2
Comment From: InputOutputZ
Note, for some reasons you have to compile hiredis in deps directory before and after redis, try:-
cd deps
make hiredis USE_SSL=1 OPENSSL_PREFIX=/usr
cd ..
Make PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr USE_SSL=1
cd deps
make hiredis USE_SSL=1 OPENSSL_PREFIX=/usr
cd ..
make install PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr USE_SSL=1
Comment From: spacexnasa
cd deps make hiredis USE_SSL=1 OPENSSL_PREFIX=/usr cd .. Make PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr USE_SSL=1 cd deps make hiredis USE_SSL=1 OPENSSL_PREFIX=/usr cd .. make install PREFIX=/usr USE_SYSTEMD=yes BUILD_TLS=yes OPENSSL_PREFIX=/usr USE_SSL=1
cd ..
[root@test1 src]# rm -rf redis-7.0.0
[root@test1 src]# tar zxf redis-7.0.0.tar.gz
[root@test1 src]# cd redis-7.0.0
[root@test1 redis-7.0.0]# cd deps
[root@test1 deps]# make hiredis USE_SSL=1 OPENSSL_PREFIX=/usr
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(cd hdr_histogram && make clean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[1]: Entering directory /usr/local/src/redis-7.0.0/deps/hiredis'
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic alloc.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic net.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic hiredis.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic sds.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic async.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic read.c
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic sockcompat.c
ar rcs libhiredis.a alloc.o net.o hiredis.o sds.o async.o read.o sockcompat.o
cc -std=c99 -c -O3 -fPIC -DHIREDIS_TEST_SSL -I/usr/include -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic ssl.c
ssl.c: In function ‘redisInitOpenSSL’:
ssl.c:159:5: warning: implicit declaration of function ‘SSL_library_init’ [-Wimplicit-function-declaration]
SSL_library_init();
^
ar rcs libhiredis_ssl.a ssl.o
make[1]: Leaving directory/usr/local/src/redis-7.0.0/deps/hiredis'
Comment From: spacexnasa
openssl version OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)
Comment From: yossigo
@spacexnasa I tried to reproduce this locally but don't experience any of these problems. OpenSSL 3.0.3 installed in some custom path, building Redis with OPENSSL_PREFIX= pointing to it.
I suspect you may experience issues with your specific OpenSSL setup (e.g. some custom configuration, leftovers of a previous version, etc.).
Comment From: spacexnasa
@spacexnasa I tried to reproduce this locally but don't experience any of these problems. OpenSSL 3.0.3 installed in some custom path, building Redis with
OPENSSL_PREFIX=pointing to it.I suspect you may experience issues with your specific OpenSSL setup (e.g. some custom configuration, leftovers of a previous version, etc.).
ok,i will test tomorrow
Comment From: spacexnasa
@spacexnasa I tried to reproduce this locally but don't experience any of these problems. OpenSSL 3.0.3 installed in some custom path, building Redis with
OPENSSL_PREFIX=pointing to it.I suspect you may experience issues with your specific OpenSSL setup (e.g. some custom configuration, leftovers of a previous version, etc.).
i install the openssl 3.0.3 to /usr/local/openssl,and now it's work
openssl ./config linux-x86_64 --prefix=/usr/local/openssl
ldd /usr/bin/redis-server | grep ssl libssl.so.3 => /lib64/libssl.so.3 (0x00007fd7b09ff000)
and i want to know why when i install the openssl to /usr, it doesn't work
Comment From: yossigo
@spacexnasa As I mentioned, my best guess is you're partially overwriting header files that were already there. But I can't be sure of course.
Comment From: 627721565
您好,邮件已经收到,查阅后会尽快给您回复!