Problems of compiling wine with -fno-PIC

Questions about Wine on Linux
Locked
5taras
Level 1
Level 1
Posts: 6
Joined: Fri Aug 18, 2017 2:22 pm

Problems of compiling wine with -fno-PIC

Post by 5taras »

Hi.
Sorry for disturbance.
I tried to play some game protected seemingly with Enigma Protector. As far as I understand according to Bugzilla to use applications with Enigma wrapper one has to compile wine with -fno-PIC instead of -fPIC.
Being a novice I tried to follow instructions of the link:
https://wiki.winehq.org/Building_Biarch_Wine_On_Ubuntu
I tried to compile winehq 2.14 from git.
Changed all source files using the command:
find ./wine-dirs/ -type f -readable -writable -exec sed -i "s/-fPIC/-fno-PIC/g" {} \;

On final stage of compilations I see:
cd $HOME/wine64
sudo make install
.....
/usr/bin/ld: config.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
config.o: error adding symbols: Bad value

I use Lubuntu 16.04 x64.
Seemingly, I am doing something wrong.
Thank you for your attention.
User avatar
dimesio
Moderator
Moderator
Posts: 13208
Joined: Tue Mar 25, 2008 10:30 pm

Re: Problems of compiling wine with -fno-PIC

Post by dimesio »

According to https://bugs.winehq.org/show_bug.cgi?id=37540 (comments 8 & 10), on Linux you just need to compile Wine with "make CFLAGS=-fno-PIC" and (for WoW64) '-mcmodel=large'.
5taras
Level 1
Level 1
Posts: 6
Joined: Fri Aug 18, 2017 2:22 pm

Re: Problems of compiling wine with -fno-PIC

Post by 5taras »

git clone git://source.winehq.org/git/wine.git ~/wine-git
mkdir $HOME/wine64
cd $HOME/wine64
make clean
../wine-git/configure --enable-win64

make CFLAGS=-fno-PIC -j4
make[1]: Entering directory '/home/baal/wine64/libs/wpp'
........
/usr/bin/ld: config.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
config.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:355: recipe for target 'libwine.so.1.0' failed
make[1]: *** [libwine.so.1.0] Error 1
make[1]: Leaving directory '/home/baal/wine64/libs/wine'
Makefile:20153: recipe for target 'libs/wine' failed
make: *** [libs/wine] Error 2
make: *** Waiting for unfinished jobs....
5taras
Level 1
Level 1
Posts: 6
Joined: Fri Aug 18, 2017 2:22 pm

Re: Problems of compiling wine with -fno-PIC

Post by 5taras »

Ok, thank You for response.
I managed to compile putting (where it's possible) "make CFLAGS='-fno-PIC -mcmodel=large' ", following instructions
https://wiki.winehq.org/Building_Biarch_Wine_On_Ubuntu
Unfortunately, enigma virtual box is not working yet
wine enigmavb.exe
fixme:file:SetSearchPathMode (8001): stub
fixme:process:SetProcessDEPPolicy (1): stub
fixme:file:SetSearchPathMode (8001): stub
fixme:process:SetProcessDEPPolicy (1): stub
fixme:win:DisableProcessWindowsGhosting : stub
fixme:graphics:ShutdownBlockReasonDestroy (0x110066): stub
fixme:graphics:ShutdownBlockReasonCreate (0x110066, L"Installing"): stub
fixme:rstrtmgr:RmStartSession 0x49c3f0, 0, 0x49c3f4 stub!
fixme:graphics:ShutdownBlockReasonDestroy (0x110066): stub
fixme:graphics:ShutdownBlockReasonCreate (0x110066, L"Installing Enigma Virtual Box."): stub
fixme:msg:ChangeWindowMessageFilterEx 0xc0100 c064 1 (nil)
fixme:msg:ChangeWindowMessageFilterEx 0x30134 c064 1 (nil)
fixme:msg:ChangeWindowMessageFilterEx 0x40134 c064 1 (nil)
fixme:shell:SHAutoComplete stub
fixme:explorerframe:taskbar_list_SetProgressValue iface 0x1db0f8, hwnd 0x110066, ullCompleted 0, ullTotal 42c stub!
fixme:sfc:SfcIsFileProtected ((nil), L"C:\\Program Files (x86)\\Enigma Virtual Box\\unins000.exe") stub
fixme:explorerframe:taskbar_list_SetProgressState iface 0x1db0f8, hwnd 0x110066, flags 0 stub!
err:seh:setup_exception_record stack overflow 2112 bytes in thread 0148 eip 7bc58760 esp 00240af0 stack 0x240000-0x241000-0x340000
fixme:graphics:ShutdownBlockReasonDestroy (0x110066): stub
baal@baal:~/photos$
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Problems of compiling wine with -fno-PIC

Post by Bob Wya »

@5taras

Your posts are very hard to wade through ... Owing to you not using the forum:

Code: Select all

Code
tags!! :roll:

Please, please use these to delimit terminal output and commands, from your regular text and comments.

It would be best if you give:
  • what WINEPREFIX directory you are using?
  • 32-bit or 64-bit WINEPREFIX?
  • what Windows configuration for your WINEPREFIX (Windows XP, Windows 7, etc.)?
  • the present working directory (PWD) - which you are launching the Enigma Virtual Box executable from?
  • are you re-testing Enigma Virtual Box - using a clean WINEPREFIX?
You would also need to provide a Wine build log - if you are self-building Wine.
This ensure that this process does introduce any additional errors or have important omissions...
Building multilib 64-bit Wine, on Debian / Ubuntu, isn't particularly easy to do correctly...

Bob
Locked