Skip to content
This repository has been archived by the owner on Sep 22, 2018. It is now read-only.

nikita322/llvm-clang-6_metin2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

Core update to LLVM6

Hello, today I will tell you how to update your old gcc to a new llvm6.

Programm:

Structure

Content

Install Freebsd

The first thing we should start with is the installation of freebsd.

  • Go to official site freebsd and download this .iso
  • Then, we need install this disk image. I used a VirtualBox.
  • Now, we create a machine and all steps will be in pictures.
  • installfreebsd1
  • installfreebsd2
  • installfreebsd3
  • installfreebsd4
  • installfreebsd5
  • installfreebsd6
  • installfreebsd7
  • installfreebsd8
  • Then, start the virtual machine and presses "install".
  • installfreebsd9
  • installfreebsd10
  • After choose your encoding, I left by the standard.
  • Enter the name of the machine, I wrote "llvm6".
  • installfreebsd11
  • Choose (UFS), if you are an advanced user, you can choose (ZFS).
  • Then "Entire Disk" - > "MBR" ("Finish" and "Commit").
  • installfreebsd12
  • After installation, enter the password (my password is "dev" and repeat).
  • Select network interface. (IPv4 -> "Yes", DHCP -> "Yes", IPv6 -> "No").
  • Skip, by pressing "ENTER".
  • Choose your region and time zone. Then we choose "Set Date" twice.
  • Press "ENTER" and skip twice. After, we are asked if we want to create another user. We answer "No".
  • Manual Configuration -> "No", Complete -> "Reboot".
  • Go to the settings and turn off the drive -> "Remove". installfreebsd13

Freebsd setting

First step it is open access for root users.

  • Write this in command line "ee /etc/ssh/sshd_config".
  • Then found line "#PermitRootLogin no" and change to "PermitRootLogin yes". freebsdsetting1
  • Save changes (ESC -> ENTER -> ENTER).
  • Restart SSHD (service sshd restart).
  • freebsdsetting2
  • Then we need to know your local ip. Press ("WIN + R" -> cmd -> ipconfig) freebsdsetting3
  • And last step. For SFTP connection I use WinSCP and PuTTY for ssh. freebsdsetting3 freebsdsetting3

Install some packages

  • pkg update
  • pkg upgrade
  • pkg install gmake
  • pkg install subversion
  • pkg install clang-devel

Compile libs

  • Upload source. I choose VINCHENZOO files and upload to /root/ (although this is not important).
  • First lib (libgame), go to /src/Makefile and edit:

 CXX = g++

replace it with

 CXX = clang++-devel

and

 ifeq ($(GCC_VERSION), 4)
 CFLAGS  = -Wall -O2 -pipe -mtune=i686 -fno-exceptions -fno-rtti
 else
 CFLAGS  = -Wall -O2 -pipe -mcpu=i686 -fno-exceptions -fno-rtti
 endif

replace it with

 CFLAGS = -Wall -Ofast -D_THREAD_SAFE -pipe -msse2 -mssse3 -m32 -fno-exceptions -std=c++17 -stdlib=libc++ -I../include

After write:

 gmake clean
 gmake dep
 gmake -j20

and we have this error:

 ./../../common/stl.h:12:10: fatal error: 'ext/functional' file not found
 #include <ext/functional>
          ^~~~~~~~~~~~~~~~
 1 error generated.

to fix it, go to /common/stl.h and delete 3 line.

 #ifdef __GNUC__
 #include <ext/functional>
 #endif

Then compile again (gmake -j20). If successful, then in the folder lib there will be libgame.a

  • Second lib (liblua), go to /config and edit:

 CC= clang-devel

After write:

 gmake clean
 gmake -j20

If successful, then in the folder lib there will be liblua.a & liblualib.a

  • Third lib (libpoly), go to /Makefile and edit:

 CXX = g++

replace it with

 CXX = clang++-devel

and

 ifeq ($(GCC_VERSION), 4)
 CFLAGS  = -Wall -O2 -pipe -mtune=i686 -fno-exceptions -fno-rtti
 else
 CFLAGS  = -Wall -O2 -pipe -mcpu=i686 -fno-exceptions -fno-rtti
 endif

replace it with

 CFLAGS = -Wall -Ofast -D_THREAD_SAFE -pipe -msse2 -mssse3 -m32 -fno-exceptions -std=c++17 -stdlib=libc++

After write:

 gmake clean
 gmake dep
 gmake -j20

If successful, then there will be libpoly.a

  • Fourth lib (libserverkey), go to /Makefile and edit:

 CXX = g++

replace it with

 CXX = clang++-devel

and

 ifeq ($(GCC_VERSION), 4)
 CFLAGS  = -Wall -O2 -pipe -mtune=i686 -fno-exceptions -fno-rtti
 else
 CFLAGS  = -Wall -O2 -pipe -mcpu=i686 -fno-exceptions -fno-rtti
 endif

replace it with

 CFLAGS = -Wall -Ofast -D_THREAD_SAFE -pipe -msse2 -mssse3 -m32 -fno-exceptions -std=c++17 -stdlib=libc++

After write:

 gmake clean
 gmake dep
 gmake -j20

If successful, then there will be libserverkey.a

  • Fifth lib (libsql), go to /Makefile and edit:

 CXX = g++

replace it with

 CXX = clang++-devel

and

 CFLAGS  = $(IFLAGS) -Wall -O2 -pipe -mtune=i686 -D_THREAD_SAFE -fno-exceptions 

replace it with

 CFLAGS = $(IFLAGS) -Wall -Ofast -D_THREAD_SAFE -pipe -msse2 -mssse3 -m32 -fno-exceptions -std=c++17 -stdlib=libc++

After write:

 gmake clean
 gmake dep
 gmake -j20

If successful, then there will be libsql.a

  • Sixth lib (libthecore):

In this lib very much needs to be corrected. So I suggest just delete old files and upload my (./some files/libthecore).

 gmake clean
 gmake dep
 gmake -j20

If successful, then there will be libthecore.a

  • With game we finished. Now let's look at the folder Extern.

  • First we download boost from official site choose the latest version (now it is 1.65.1) and click to boost_1_65_1.tar.gz

  • Delete (rm -rf boost) folder "boost".

  • Upload to server and unpack (tar -xf boost_1_65_1.tar.gz).

  • Go to ./boost_1_65_1 and move(mv boost ../) folder to ../

  • Then delete folder(rm -rf boost_1_65_1) "boost_1_65_1" and archive(rm -rf boost_1_65_1.tar.gz) "boost_1_65_1.tar.gz". Boost lib no need to compile, so we finished with it.

  • Delete (rm -rf cryptopp) folder "cryptopp".

  • Upload to server and unpack (tar -xf cryptopp-CRYPTOPP_5_6_5.tar.gz).

  • In ./cryptopp-CRYPTOPP_5_6_5/GNUmakefile we found:

 .PHONY: all

and add above

 СС = clang-devel
 CXX	= clang++-devel -std=c++17

ok, now need disable sha asm & disable vmac asm. Open sha.cpp looking for a line:

 #if defined(CRYPTOPP_DISABLE_SHA_ASM)

and add above

 #define CRYPTOPP_DISABLE_SHA_ASM

Open vmac.cpp looking for a line:

 #if defined(CRYPTOPP_DISABLE_VMAC_ASM)

and add above

 #define CRYPTOPP_DISABLE_VMAC_ASM

Open sha.h looking for a line:

 #if defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)
 # define CRYPTOPP_DISABLE_SHA_ASM
 #endif

and replace it with

 #define CRYPTOPP_DISABLE_SHA_ASM
 gmake clean
 gmake -j20

After compile move(mv libcryptopp.a ../../lib) to lib folder and rename cryptopp-CRYPTOPP_5_6_5 to cryptopp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published