Workaround for Wine/World Of Warcraft Crashing on Linux 64bit systems with > 4gb of RAM.

Posted in Linux Development, World Of Warcraft on February 24th, 2010 by OneOfOne

I recently got a new computer with 8gb of RAM, and since then World Of Warcraft crashed very often with out of memory errors.
After banging my head for hours every time I crashed in dalaran or coming out of the arenas, I finally discovered setarch(8).

Usage: setarch  [options] [program [program arguments]]                                                               

Options:
 -h, --help               displays this help text
 -v, --verbose            says what options are being switched on
 -R, --addr-no-randomize  disables randomization of the virtual address space
 -F, --fdpic-funcptrs     makes function pointers point to descriptors       
 -Z, --mmap-page-zero     turns on MMAP_PAGE_ZERO                            
 -L, --addr-compat-layout changes the way virtual memory is allocated        
 -X, --read-implies-exec  turns on READ_IMPLIES_EXEC                         
 -B, --32bit              turns on ADDR_LIMIT_32BIT                          
 -I, --short-inode        turns on SHORT_INODE                               
 -S, --whole-seconds      turns on WHOLE_SECONDS                             
 -T, --sticky-timeouts    turns on STICKY_TIMEOUTS                           
 -3, --3gb                limits the used address space to a maximum of 3 GB 
     --4gb                ignored (for backward compatibility only)
setarch i386 -3 -L -B -R wine wow.exe -opengl

While it isn’t a perfect solution, it work’s for the most part.

Tags: , , ,

Using CMake + Mingw to Cross-Compile Windows Apps.

Posted in Linux Development on November 23rd, 2009 by OneOfOne

As promised, here’s the second part of the tutorial on how to use cmake to build Qt4/OpenSSL Apps for Windows using mingw on Linux.

Assumptions :

1. You already followed the tutorial on how to setup Qt4/OpenSSL using mingw.
2. You have cmake installed.
3. You have a working wine setup or a way to test the executables.

Part 0 : Setup Wine

You can ignore this if you will test on windows.

  1. Run winecfg, go to Drives, add drive and set the path to your win32 dev (we will use the letter G for this).
  2. Run wine regedit, go to HKEY_LOCAL_MACHINE -> System -> Session Manager -> Enviroment -> edit PATH and append G:\qt-win-opensource-src-4.5.3\;G:\openssl-0.9.8l to the end.

Part 1 : Custom CMake Rules

We need to create a custom cmake rules file, we will name it lin-mingw.cmake for now :

if(WIN32)
	#We haven't built Qt with debug support, so no point setting debug flags.
	set(CMAKE_BUILD_TYPE "Release")
	ADD_DEFINITIONS(${QT_DEFINITIONS})
	SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)

	#set the default pathes, should be changed to match your setup.
	set(WIN32_BASE /home/dev/win32/)
	set(QT_BASE ${WIN32_BASE}/qt-win-opensource-src-4.5.3)
	set(OSSL_BASE ${WIN32_BASE}/openssl-0.9.8l)
	set(APP_ICON_RC ${CMAKE_CURRENT_SOURCE_DIR}/win32_icon.rc)

	set(MINGW_PREFIX "i686-pc-mingw32-")

	# set "sane" default cxxflags for windows, the -mwindows so it wouldn't open a command dos window.
	set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} -march=pentium4 -mtune=pentium4 -mwindows -O2")
	# we need -static-libgcc otherwise we'll link against libgcc_s_sjlj-1.dll.
	SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,--no-undefined -static-libgcc -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -s")

.............. etc etc ............

Download the file.
Read more »

Tags: , , , , , , , ,