Compile Server in Debian
#11

It's normal for linux servers to be that big, you can just look around any release and see that this is the case.

 

And the flag is probably the threads that are being used to compile. 

#12


On 4/12/2022 at 10:43 PM, Sickness said:




I would recommend a local vmware centos installation for compiling, for security reasons as well.




what is the difference between a compilation through ubuntu/debian or centOS ... what count is the compiler 

#13


On 4/12/2022 at 1:08 AM, nicolasg said:




no compelling reason to use Debian, just i had my web server mounted on Debian and try to avoid migrating everything to centos to compile gameserver




web server to compile ? ? 

#14


10 hours ago, nicolasg said:




Hello, apparently today I managed to compile everything "correctly", but in "shared" format, when I try to compile it in "static" format and try to run a server, it returns "segmentation fault". I need have to modify some line of code or just the shit i compiled is wrong? ps: my GameServer weighs 80mbs, I don't know if it's normal, in windows it weighs only 6.3mbs



ps2: i know its an ambiguous questions. Now i'm compiling it in usadebug to see if it return something more...



Little update: its posible flag -m32 in CXX (makefile.inc) its wrong or are causing any problem?




I suppose you receive the segmentation fault while trying to launch the server. Compile and run the server are totally different arguments, i guess if you manage how to compile on debian you should post here the solution and maybe open a new topic regarding the launch of a server on to debian!



You are probably receiving that error regarding the different libs used! 

#15


1 hour ago, Scura said:




web server to compile ? ? 




home/local web server 

imagine use web hosting for compile haha xD

#16


2 hours ago, Scura said:




I suppose you receive the segmentation fault while trying to launch the server. Compile and run the server are totally different arguments, i guess if you manage how to compile on debian you should post here the solution and maybe open a new topic regarding the launch of a server on to debian!



You are probably receiving that error regarding the different libs used! 




this would be my draft

cd /usr/local

=====================================================================================================================================================================================

apt install build-essential

apt install gcc-multilib g++-multilib (gcc-multilib:i386 g++-multilib:i386)

apt install libz-dev

apt install python-dev

apt install lib32ncurses-dev

dpkg --add-architecture i386

apt update

#apt install libcrypt1:i386 # i don't know if really need that

apt install libcrypt-dev:i386 # i don't know if really need that, probably yep 

=====================================================================================================================================================================================

export CFLAGS="-m32"

export CC="gcc -m32"

export CXX="g++ -m32"

=====================================================================================================================================================================================

wget 2 && tar xvzf apr-1.5.2.tar.gz

wget 2 && tar -xvjf apr-util-1.5.4.tar.bz2

wget 2 && tar zxvf openssl-1.0.2o.tar.gz

wget 2 && tar xvzf apache-log4cxx-0.10.0.tar.gz

wget 2 && tar xvzf jsoncpp-src-0.6.0-rc2.tar.gz

wget 2 && tar zxvf boost_1_64_0.tar.gz

wget 2 && tar xvzf Botan-1.10.17.tgz

wget 2 && tar xvzf ccache-3.4.2.tar.gz

wget 2 && tar xvzf curl-7.59.0.tar.gz

#In windows use mysql-5.1.73, probably work fine, but  i can update it easy...

wget 2 && tar xvzf mysql-5.1.62.tar.gz

=====================================================================================================================================================================================

cd /usr/local/apr-1.5.2

    touch libtoolT

    ./configure "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

    make -j4 && make install

cd ..

=====================================================================================================================================================================================

cd /usr/local/openssl-1.0.2o

    ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl zlib

    make && make install

    make MANDIR=/usr/share/man MANSUFFIX=ssl install && install -dv -m755 /usr/share/doc/openssl-1.0.2o && cp -vfr doc/*     /usr/share/doc/openssl-1.0.2o

cd ..

=====================================================================================================================================================================================

cd /usr/local/apr-util-1.5.4

    ./configure --prefix=/usr "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --with-apr=/usr/local/apr --with-openssl=/usr/local/ssl "LDFLAGS=-L/usr/local/ssl/lib"

    OR

    ./configure --prefix=/usr --with-apr=/usr --with-gdbm=/usr --with-openssl=/usr\ --with-crypto

    make -j4 && make install

cd ..

# LOG4CXX ===========================================================================================================================================================================

cd /usr/local/apache-log4cxx-0.10.0

    ./configure --with-apr=../apr-1.5.2 --with-apr-util=../apr CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/ssl/lib" CXXFLAGS="-fpermissive" "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

    inputstreamreader.cpp

    socketoutputstream.cpp

        #include <string.h>

    console.cpp

        #include <stdio.h>

        #include <string.h>

    locationinfo.cpp

        char prolog[] = {

        TO

        unsigned char prolog[] = {

        os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);

        TO

        os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, (char *)prolog, sizeof(prolog), p);

    loggingevent.cpp

        char classDesc[] = {

        TO

        unsigned char classDesc[] = {

        8, classDesc, sizeof(classDesc), p);

        TO

        8, (char *)classDesc, sizeof(classDesc), p);

    objectoutputstream.cpp

        char start[] = { 0xAC, 0xED, 0x00, 0x05 };

        TO

        unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 };

        ByteBuffer buf(start, sizeof(start));

        TO

        ByteBuffer buf((char *)start, sizeof(start));

        char prolog[] = {

        TO

        unsigned char prolog[] = {

        writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);

        TO

        writeProlog("java.util.Hashtable", 1, (char *)prolog, sizeof(prolog), p);

    domtestcase.cpp

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };

        TO

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };

        TO

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };

        TO

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };

        TO

        const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };

    make -j4 && make install

cd ..

=====================================================================================================================================================================================

cd jsoncpp-src-0.6.0-rc2/src/lib_json

    g++ -I../../include -O2 -c *.cpp -m32

    ar rs libjsoncpp.a *.o

    cp libjsoncpp.a /usr/local/lib

    cp -R ../../include/json /usr/local/include

cd ../../..

# BOOST =============================================================================================================================================================================

cd boost_1_64_0

    ./bootstrap.sh --with-libraries=all --with-toolset=gcc

    ./bjam --toolset=gcc --variant=release,debug --layout=versioned --link=static --runtime-link=static threading=multi install address-model=32 cflags=-m32 cxxflags=-m32 --ldflags=-m32 --build=i686-linux-gnu architecture=x86 instruction-set=i686 stage

    ln -s -d /usr/local/boost_1_64_0/boost /usr/include/

cd ..

# BOTAN =============================================================================================================================================================================

cd Botan-1.10.17

    ./configure.py --disable-shared --includedir=../../usr/include --cpu=x86_32 --cc-bin='gcc -m32'

    gost_3411.cpp

        #include <stdint.h>

    make -j4 && make install

    ln -s -d /usr/include/botan-1.10/botan /usr/include/

cd ..

=====================================================================================================================================================================================

cd ccache-3.4.2

    ./configure && make -j4 && make install

cd ..

=====================================================================================================================================================================================

cd curl-7.59.0

    ./configure --enable-shared=no --libdir=/usr/local/lib

    make -j4 && make install

cd ..

=====================================================================================================================================================================================

cd mysql-5.1.62

    ./configure --disable-shared --enable-static CFLAGS="-fPIC" "CFLAGS=-m32" "CXXFLAGS=-m32 -Wno-narrowing -fpermissive" "LDFLAGS=-m32"

    make -j4 && make install

cd ..

=====================================================================================================================================================================================

# Nov Server

    lchttps.cpp

        #include <unistd.h>

        OR

        #include "unistd.h"

    

    makefile.inc

        CXX = ccache g++ -g -fno-pie -no-pie -mabi=ms -m32 -Wno-return-type -fpermissive -Wno-deprecated

    item.cpp

        return false; 

        TO

        return o;



ps makefile.inc

.SUFFIXES : .cpp .o
.PHONY: clean dep new cleanall local debug clear test

CXX = ccache g++ -g -fno-pie -no-pie -mabi=ms -m32 -Wno-return-type -fpermissive -Wno-deprecated

BOOST_INCLUDE = /usr/local/boost_1_64_0
BOOST_LIB_VER = -gcc-mt-1_64

OPT_CRYPT = -I../ShareLib \
        -I/usr/local/include/mysql \
        -I/usr/local/ssl/include \
        -I/usr/local/include/botan-1.10 \
        -I$(BOOST_INCLUDE)
        
OPT_LDOBJ = -L../ShareLib \
            -L/usr/local/lib \
            -L/usr/local/apr/lib \
            -L/usr/local/mysql-5.1.62/libmysql/.libs \
            -lSharelib \
            -lmysqlclient \
            -l:libboost_thread-gcc-mt-1_64.a \
            -l:libboost_system-gcc-mt-1_64.a \
            -llog4cxx \
            -laprutil-1 \
            -lapr-1 \
            -lrt \
            -lstdc++ \
            -lexpat \
            -lpthread \
            -ljsoncpp
            
OPT_VER=-DLC_VER=\"$(LC_VER)\"

CXXFLAGS =  -D_THREAD_SAFE -finline-functions \
            -funroll-loops \
            -fdefer-pop \
            -fstrength-reduce \
            -Wno-write-strings \
            -Wno-char-subscripts \
            $(OPT_BIGENDIAN) \
            $(OPT_LANG) \
            $(OPT_DEBUG) \
            $(OPT_DEF) \
            $(OPT_TEST) \
            $(OPT_VER) \
            $(OPT_CRYPT)

 

#17

gdb currently return that, i'm completely lost at this point



#18

I think that at this point my questions on the subject are already annoying. But does anyone have a iso of CentOS ready to compile server files? Today I gave up my attempt to use Debian to compile, I created a virtual machine with centos 7 and got the same result as with Debian (segmentation fault) ?

#19


17 hours ago, nicolasg said:




I think that at this point my questions on the subject are already annoying. But does anyone have a iso of CentOS ready to compile server files? Today I gave up my attempt to use Debian to compile, I created a virtual machine with centos 7 and got the same result as with Debian (segmentation fault) ?




Here is a nice script maded by /index.php?/profile/20161-karmel/&do=hovercard" data-mentionid="20161" href="/index.php?/profile/20161-karmel/" rel="">@Karmel. I didn't test it but it may be useful!


On 4/14/2022 at 10:16 PM, nicolasg said:




gdb currently return that, i'm completely lost at this point



2




I see "backtrac" instead of "backtrace" dunno if it may show us more information (also why you quit it before backtrace?). Despite of that i guess is a problem with the libs indicated. Are you sure about the installation of boost? Which version did you chose (i guess by the screen 1.64, while i am using 1.67) ? 

#20


41 minutes ago, Scura said:




Here is a nice script maded by /index.php?/profile/20161-karmel/&do=hovercard" data-mentionid="20161" href="/index.php?/profile/20161-karmel/" rel="">@Karmel. I didn't test it but it may be useful!



I see "backtrac" instead of "backtrace" dunno if it may show us more information (also why you quit it before backtrace?). Despite of that i guess is a problem with the libs indicated. Are you sure about the installation of boost? Which version did you chose (i guess by the screen 1.64, while i am using 1.67) ? 






I deleted the distro out of frustration xD so I can't provide more information at the moment, I made a post on pvpers, according to @Wizatek it was a problem with the version of gcc I was using (it was the version that came with Debian 11), try Centos 7 and gcc 4.8.5 and it kept giving the same problem, right now I'm trying with an iso that happened to me...



Forum Jump:


Users browsing this thread: 1 Guest(s)