TelegramMessenger / MTProxy

5.02k stars 831 forks source link

debian 11 collect2: error: ld returned 1 exit status #511

Open shakibamoshiri opened 1 year ago

shakibamoshiri commented 1 year ago
openssl version 
OpenSSL 3.2.0-dev  (Library: OpenSSL 3.2.0-dev )

and log before error

cc -o objs/bin/mtproto-proxy objs/mtproto/mtproto-proxy.o objs/mtproto/mtproto-config.o objs/net/net-tcp-rpc-ext-server.o objs/lib/libkdb.a objs/lib/libkdb.a  -L/usr/lib/x86_64-linux-gnu/  -ggdb -rdynamic -lm -lrt -lcrypto -lz -lpthread -lcrypto
/usr/bin/ld: objs/mtproto/mtproto-config.o:(.bss+0x200a0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/net/net-tcp-rpc-ext-server.o:(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(resolver.o):(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(parse-config.o):(.bss+0x28): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-rpc-targets.o):(.bss+0x820): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-http-server.o):(.bss+0x18): multiple definition of `http_queries'; objs/mtproto/mtproto-proxy.o:(.bss+0x488): first defined here
/usr/bin/ld: objs/lib/libkdb.a(engine-rpc.o):(.bss+0x0): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-stats.o):(.bss+0x8): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(pid.o):(.bss+0x0): multiple definition of `PID'; objs/lib/libkdb.a(net-stats.o):(.bss+0x30): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:94: objs/bin/mtproto-proxy] Error 1

all solution of #4 were tested but did not solve the issue

any idea ?

Regards

Snowmaze-dev commented 1 year ago

Same problem, but on Ubuntu

CJYKK commented 1 year ago

Try add "-fcommon" to the end of CFLAGS in Makefile.

shakibamoshiri commented 1 year ago

@CJYKK It was complied but after running it, failed

[244560][2023-07-13 06:42:44.256158 local] Invoking engine mtproxy-0.01 compiled at Jul 13 2023 06:13:14 by gcc 10.2.1 20210110 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b
[244560][2023-07-13 06:42:44.256257 local] config_filename = 'proxy-multi.conf'
[244560][2023-07-13 06:42:44.256449 local] creating 1 workers
mtproto-proxy: common/pid.c:42: init_common_PID: Assertion `!(p & 0xffff0000)' failed.
[pid 244560] [time 1689230564] 
------- Stack Backtrace -------
./mtproto-proxy(print_backtrace+0x1a)[0x5610ff61842a]
./mtproto-proxy(extended_debug_handler+0x10)[0x5610ff618570]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x13140)[0x7f499eb08140]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x7f499e959ce1]
15  CFLAGS = $(ARCH) -fcommon -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"${COMMIT}\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=
/lib/x86_64-linux-gnu/libc.so.6(abort+0x123)[0x7f499e943537]
/lib/x86_64-linux-gnu/libc.so.6(+0x2240f)[0x7f499e94340f]
/lib/x86_64-linux-gnu/libc.so.6(+0x31662)[0x7f499e952662]
./mtproto-proxy(+0x4c141)[0x5610ff61c141]
./mtproto-proxy(engine_init+0xe4)[0x5610ff612a04]
./mtproto-proxy(default_main+0x10f)[0x5610ff6137ff]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea)[0x7f499e944d0a]
./mtproto-proxy(_start+0x2a)[0x5610ff5e1f2a]
[pid 244560] [time 1689230564] -------------------------------
[pid 244560] [time 1689230564] mtproxy-0.01 compiled at Jul 13 2023 06:13:14 by gcc 10.2.1 20210110 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b[pid 244560] [time 1689230564] 
mtproto-proxy: common/pid.c:42: init_common_PID: Assertion `!(p & 0xffff0000)' failed.
root@203:/opt/MTProxy/objs/bin# [pid 244561] [time 1689230564] 
------- Stack Backtrace -------
./mtproto-proxy(print_backtrace+0x1a)[0x5610ff61842a]
./mtproto-proxy(extended_debug_handler+0x10)[0x5610ff618570]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x13140)[0x7f499eb08140]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x7f499e959ce1]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x123)[0x7f499e943537]
/lib/x86_64-linux-gnu/libc.so.6(+0x2240f)[0x7f499e94340f]
/lib/x86_64-linux-gnu/libc.so.6(+0x31662)[0x7f499e952662]
./mtproto-proxy(+0x4c141)[0x5610ff61c141]
./mtproto-proxy(engine_init+0xe4)[0x5610ff612a04]
./mtproto-proxy(default_main+0x10f)[0x5610ff6137ff]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea)[0x7f499e944d0a]
./mtproto-proxy(_start+0x2a)[0x5610ff5e1f2a]
[pid 244561] [time 1689230564] -------------------------------
[pid 244561] [time 1689230564] mtproxy-0.01 compiled at Jul 13 2023 06:13:14 by gcc 10.2.1 20210110 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b[pid 244561] [time 1689230564]
13werwolf13 commented 1 year ago

opensuse 15.5, opensuse tumbleweed, oracle linux 8, almalinux 8.. same problem..

shakibamoshiri commented 10 months ago

one year later ... The same issue with Ubuntu 20 no longer the project is active ?

rezaparsad commented 8 months ago

Try add "-fcommon" to the end of CFLAGS in Makefile.

Please put the complete command

Michal-Szczepaniak commented 8 months ago

@rezaparsad open Makefile, CFLAGS is right at the beginning, add -fcommon at the end

also it works on opensuse 15.5/tumbleweed with that change @13werwolf13

13werwolf13 commented 8 months ago

@rezaparsad open Makefile, CFLAGS is right at the beginning, add -fcommon at the end

also it works on opensuse 15.5/tumbleweed with that change @13werwolf13

thanks! it worked!! but I'm not sure if I can return it to the repository since opensuse maintainers, as far as I know, are against adding packages with unmaintained software. but I will definitely try!