TelegramMessenger / MTProxy

4.96k stars 818 forks source link

Build error on Solaris #16

Open yvoinov opened 6 years ago

yvoinov commented 6 years ago

With GCC 5.5:

make

cc -m64 -O3 -std=gnu11 -Wall -mpclmul -march=native -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"2fd27cb0753c62e5766c86db28f2acc1d755547f\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/mtproto/mtproto-proxy.d -MQ objs/mtproto/mtproto-proxy.o -o objs/mtproto/mtproto-proxy.o mtproto/mtproto-proxy.c cc: Warning: GCC option -mpclmul ignored. Suggest using -xarch=aes cc: Warning: Option -mfpmath=sse passed to ld, if ld is invoked, ignored otherwise cc: Warning: Option -fno-strict-overflow passed to ld, if ld is invoked, ignored otherwise cc: Warning: Option -fwrapv passed to ld, if ld is invoked, ignored otherwise cc: Warning: Option -quote passed to ld, if ld is invoked, ignored otherwise cc: Warning: Option -quote passed to ld, if ld is invoked, ignored otherwise cc: refused to overwrite input file by output file: objs/mtproto/mtproto-proxy.o make: *** [Makefile:78: objs/mtproto/mtproto-proxy.o] Error 1

It seems as Makefile error.

Ah, I see. This is not portable code, will not build on Solaris in any way. Sorry and sadly.

sburn commented 6 years ago

Guys, add BSD support, please!

yvoinov commented 6 years ago

At least.

Most better make fully portable code - will be more proxies. ;)

11.06.2018 15:01, Vadim Korchagin пишет:

Guys, add BSD support, please!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TelegramMessenger/MTProxy/issues/16#issuecomment-396172917, or mute the thread https://github.com/notifications/unsubscribe-auth/AOUiqBJhDDXKLbEbiU7baSO4v8251SSJks5t7jHYgaJpZM4UUYgl.

-- "C++ seems like a language suitable for firing other people's legs."


marmulak commented 6 years ago

There's no good reason why a program like this shouldn't compile and run on any *nix type system. Its only dependencies are openssl and zlib ...

yvoinov commented 6 years ago

Yes. It should be portable. But it not.

06.09.2018 17:40, marmulak пишет:

There's no good reason why a program like this shouldn't compile and run on any *nix type system. Its only dependencies are openssl and zlib ...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TelegramMessenger/MTProxy/issues/16#issuecomment-419062844, or mute the thread https://github.com/notifications/unsubscribe-auth/AOUiqI0v98Ki6O4kCHvLBHDo3OShXK_8ks5uYQm2gaJpZM4UUYgl.

-- "C++ seems like a language suitable for firing other people's legs."


stek29 commented 6 years ago

@marmulak is using epoll a good reason?

marmulak commented 6 years ago

Well I'm looking into this a little bit and apparently epoll is not available for FreeBSD and apparently not in its Linux emulation layer either (I only saw a brief reference to this so I'm not sure), but BSD systems have their own function, kqueue, which appears to do what epoll does. MTProxy can support multiple platforms. Obviously BSD is a worthwhile target, so you might want to add the ability to compile with kqueue on BSD systems, or search for an alternative method to get it to work.

http://people.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html

^ According to this guy, kqueue is better anyway. :)

Apparently there's more than one article about why epoll sucks: https://idea.popcount.org/2017-02-20-epoll-is-fundamentally-broken-12/

yvoinov commented 6 years ago

(and there is not only BSD and Linux nix-like OS on market presents - also /dev/poll OS, poll etc.... libevent also inventer already ;-))

06.09.2018 19:25, marmulak пишет:

Well I'm looking into this a little bit and apparently epoll is no available for FreeBSD and apparently not in its Linux emulation layer either (I only saw a brief reference to this so I'm not sure), but BSD systems have their own function, kqueue, which appears to do what epoll does. MTProxy can support multiple platforms. Obviously BSD is a worthwhile target, so you might to add the ability to compile with kqueue on BSD systems, or search for an alternative method to get it to work.

http://people.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html http://people.eecs.berkeley.edu/%7Esangjin/2012/12/21/epoll-vs-kqueue.html

^ According to this guy, kqueue is better anyway. :)

Apparently there's more than one article about why epoll sucks: https://idea.popcount.org/2017-02-20-epoll-is-fundamentally-broken-12/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TelegramMessenger/MTProxy/issues/16#issuecomment-419092108, or mute the thread https://github.com/notifications/unsubscribe-auth/AOUiqFAnwyXru5GjXtfoUBrNN47NT7R6ks5uYSJKgaJpZM4UUYgl.

-- "C++ seems like a language suitable for firing other people's legs."


marmulak commented 6 years ago

So perhaps libevent can provide the necessary abstraction to make the software cross-platform? True there are many OS's out there. I'm particularly interested in BSD as I have a BSD server I would like to run this on, and actually it doesn't seem like a totally unreasonable expectation. A great many servers run BSD, and perhaps even Windows support can be added as well.

stek29 commented 6 years ago

@marmulak I just wanted to show you the reason why it doesn't work on BSDs now, not the reason it can't work there. Nobody is going to rewrite all of this with libev/kqueue -- just use alternative implementations.

bao3 commented 5 years ago

Guys, I built in FreeBSD 12 with gmake , got the same issue.


teleMTP /root/MTProxy >gmake                                                                            
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-ove
rflow -fwrapv -DAES=1 -DCOMMIT=\"2c942119c4ee340c80922ba11d14fb3b10d5e654\" -D_GNU_SOURCE=1 -D_FILE_OFFS
ET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/mtproto/mtproto-proxy.d -MQ objs/mtproto/mtproto-
proxy.o -o objs/mtproto/mtproto-proxy.o mtproto/mtproto-proxy.c                                         
cc: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
In file included from mtproto/mtproto-proxy.c:53:                                                       
In file included from ./net/net-tcp-connections.h:28:                                                   
In file included from ./net/net-connections.h:34:                                                       
./jobs/jobs.h:234:23: error: field has incomplete type 'struct drand48_data'                            
  struct drand48_data rand_data;                                                                        
                      ^                                                                                 
./jobs/jobs.h:234:10: note: forward declaration of 'struct drand48_data'                                
  struct drand48_data rand_data;                                                                        
         ^                                                                                              
mtproto/mtproto-proxy.c:2007:9: warning: implicit declaration of function 'kill' is invalid in C99      
      [-Wimplicit-function-declaration]                                                                 
        kill (pids[i], SIGKILL);                                                                        
        ^                                                                                               
mtproto/mtproto-proxy.c:2007:24: error: use of undeclared identifier 'SIGKILL'                          
        kill (pids[i], SIGKILL);                                                                        
                       ^                                                                                
mtproto/mtproto-proxy.c:2019:7: warning: implicit declaration of function 'kill' is invalid in C99      
      [-Wimplicit-function-declaration]                                                                 
      kill (pids[i], signal);                                                                           
      ^                                                                                                 
mtproto/mtproto-proxy.c:2038:26: error: use of undeclared identifier 'SIGTERM'                          
          kill_children (SIGTERM);