Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Can't build custom engine with clang


  • Please log in to reply
10 replies to this topic

#1 eradicator006

eradicator006

    Regular Member

  • Members
  • Pip
  • 18 posts

Posted 04 March 2015 - 03:03 AM

I'm using mac os x 10.10.2 and trying to compile a custom engine.  I want to use clang and the 10.9 sdk.  I feel that there should be no need to be using the 10.6 sdk anymore.  There is no reason wine shouldn't compile with newer tools.

I changed -O2 to -Os and changed gcc4.2 and g++4.2 to gcc and g++  I am also using --disable-win16

I can get this to compile using 10.6sdk with gcc4.2 but I don't want to do it that way.

Any ideas on why this could be failing?

gcc -m32 -c -o oleaut32_ocidl_p.o oleaut32_ocidl_p.c -I. -I../../include -D__WINESRC__ -D_OLEAUT32_ -D_REENTRANT -fPIC \
  -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers \
  -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -fno-omit-frame-pointer \
  -I/tmp/Wineskin/include -arch i386 -m32 -Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -I/tmp/Wineskin/include
../../tools/wrc/wrc -o oleaut32.res -m32 --nostdinc -I. -I../../include -D__WINESRC__ -D_OLEAUT32_ \
  oleaut32.rc
dyld: Library not loaded: @executable_path/../Frameworks/libgettextpo.0.dylib
  Referenced from: /Users/kyle/temp/wine-patched/dlls/oleaut32/../../tools/wrc/wrc
  Reason: image not found
make[1]: *** [oleaut32.res] Trace/BPT trap: 5
make: *** [dlls/oleaut32] Error 2

Thank you.

#2 Slice

Slice

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 305 posts
  • Graphics Card:AMD Radeon HD6670, GTX650
  • Operating System:OS X 10.11 (El Capitan)
  • I like to play:Heroes III
    4x4 Evolution
    made Heroes VI working!

Posted 04 March 2015 - 05:46 AM

Clang has two restrictions:
1. It doesn't compile code16. OK, you set --disable-win16
2. It can produce only position independent codes. No absolute addressing!
Moreover, new SDK doesn't contain 32bit libraries. 10.7 was the last one. I think this is you fail.

I also have gcc-4.9.2 but it can't work with -framework (Apple specific feature).
So gcc-4.2.1 is only compiler.

#3 eradicator006

eradicator006

    Regular Member

  • Members
  • Pip
  • 18 posts

Posted 04 March 2015 - 02:37 PM

I can get it to compile if I do it myself and not through wineskin.  I use the same configure options.  The only thing done differently is not specifying CFLAGS.

#4 eradicator006

eradicator006

    Regular Member

  • Members
  • Pip
  • 18 posts

Posted 04 March 2015 - 04:37 PM

I've managed to get it working using 10.8 SDK with clang.  I didn't realize the wineskin engine builder uses a bunch of it's own libraries at /tmp/Wineskin/lib.  Some of those libraries don't work with the 10.9 SDK.  

This works good enough for me.  At least now I have a better understanding of how the wineskin engine builder works now.

#5 Slice

Slice

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 305 posts
  • Graphics Card:AMD Radeon HD6670, GTX650
  • Operating System:OS X 10.11 (El Capitan)
  • I like to play:Heroes III
    4x4 Evolution
    made Heroes VI working!

Posted 26 March 2015 - 06:48 PM

View Posteradicator006, on 04 March 2015 - 04:37 PM, said:

I've managed to get it working using 10.8 SDK with clang.  I didn't realize the wineskin engine builder uses a bunch of it's own libraries at /tmp/Wineskin/lib.  Some of those libraries don't work with the 10.9 SDK.  

This works good enough for me.  At least now I have a better understanding of how the wineskin engine builder works now.
Big thanks for the idea.
I have XCode6.2 with latest clang,
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)

Target: x86_64-apple-darwin13.4.0


took 10.8SDK from XCode4.4 and successfully compile engine.
It works but winemenubuilder crashes
Unhandled exception: page fault on execute access to 0x00000001 in 32-bit code (0x00000001).
Register dump:
CS:001b SS:0023 DS:0023 ES:0023 FS:1007 GS:000f
EIP:00000001 ESP:0033ea2c EBP:0033eb38 EFLAGS:00010206(  R- --  I   - -P- )
EAX:00168048 EBX:41b24197 ECX:00110098 EDX:00000000
ESI:80004005 EDI:0033eaa4
Stack dump:
0x0033ea2c:  41b24413 00168048 00000000 001683a8
0x0033ea3c:  0033eaa4 0000a97f 00000000 0033ea98
0x0033ea4c:  7bc3d941 00000020 00110000 0033eaa8
0x0033ea5c:  7bc3d621 00000030 00000000 a087a938
0x0033ea6c:  7bc3c550 4132ae00 41000000 7bc3d860
0x0033ea7c:  a0dabe88 00168400 001683a8 474e5089
0200: sel=1007 base=7ffc0000 limit=00000fff 32-bit rw-
Backtrace:
=>0 0x00000001 (0x0033eb38)
  1 0x405ae1d4 (0x0033ebd8)
  2 0x405ac515 (0x0033ecb8)
  3 0x405a777d (0x0033ee78)
  4 0x405a5805 (0x0033fe38)
  5 0x405b112a (0x0033fea8)
  6 0x405b1078 (0x0033fec8)
  7 0x7b84e87c in kernel32 (+0x3e87b) (0x0033fee8)
  8 0x7b851498 in kernel32 (+0x41497) (0x0033ff28)
  9 0x7bc6e11c (0x0033ff38)
  10 0x7bc7025d (0x0033ffb8)
  11 0x7bc6e0e2 (0x0033ffd8)
  12 0x7bc45a2f (0x0033ffe8)
0x00000001: -- no code accessible --
Modules:
Module Address   Debug info Name (15 modules)
PE 405a0000-405a3000 Deferred		winemenubuilder
PE 41890000-41894000 Deferred		advapi32
PE 41b10000-41b16000 Deferred		windowscodecs
PE 41bd0000-41bd8000 Deferred		ole32
PE 41d00000-41d3b000 Deferred		user32
PE 41e60000-41e67000 Deferred		gdi32
PE 41fd0000-41fd4000 Deferred		version
PE 43010000-43014000 Deferred		rpcrt4
PE 430a0000-430a8000 Deferred		oleaut32
PE 431d0000-431d8000 Deferred		shlwapi
PE 43260000-433be000 Deferred		shell32
PE 46fa0000-46fa4000 Deferred		imm32
PE 46fc0000-46fc4000 Deferred		winex11
PE 7b810000-7b9ac000 Export		  kernel32
PE 7bc10000-7bc14000 Deferred		ntdll
Threads:
process  tid	  prio (all id:s are in hex)
0000000c (D) C:\windows\system32\winemenubuilder.exe
But the game works :huh:

And during compilation I see many new warnings
shader_sm4.c:861:28: warning: comparison of constant 8 with expression of type 'enum
	  wined3d_sm4_input_primitive_type' is always false
	  [-Wtautological-constant-out-of-range-compare]
  ...primitive_type >= sizeof(input_primitive_type_table) / sizeof(*input_primitive_type_table))
	 ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.


#6 Slice

Slice

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 305 posts
  • Graphics Card:AMD Radeon HD6670, GTX650
  • Operating System:OS X 10.11 (El Capitan)
  • I like to play:Heroes III
    4x4 Evolution
    made Heroes VI working!

Posted 26 March 2015 - 06:51 PM

And worst
keyboard.c:844:26: warning: illegal character encoding in string literal
	  [-Winvalid-source-encoding]
"zZ<E6><C6>","xX<F7><D7>","cC<F8><D8>","vV<F9><D9>","bB<E2><C2>","nN<ED><CD>","mM<EC>...
										   ^~~~~~~~


#7 eradicator006

eradicator006

    Regular Member

  • Members
  • Pip
  • 18 posts

Posted 26 March 2015 - 10:57 PM

I've built a few custom wine engines with clang and 10.8 sdk and never ran in to any errors like that.   Really the only thing different I had to do was add '--disable-win16' to the wine build options.

#8 darklord42

darklord42

    Rookie Porter

  • Members
  • PipPipPipPip
  • 151 posts

Posted 28 March 2015 - 01:29 AM

I should point out the reason we compile with the 10.6 sdk isn't because we don't think wine will compile with modern tools.  It compiles just fine as you saw.  It's because we want the wineskins to work on 10.6 computers as well.  Backwards compatability is huge when the purpose of wineskin is for ditribution.

#9 Slice

Slice

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 305 posts
  • Graphics Card:AMD Radeon HD6670, GTX650
  • Operating System:OS X 10.11 (El Capitan)
  • I like to play:Heroes III
    4x4 Evolution
    made Heroes VI working!

Posted 28 March 2015 - 06:47 AM

View Postdarklord42, on 28 March 2015 - 01:29 AM, said:

I should point out the reason we compile with the 10.6 sdk isn't because we don't think wine will compile with modern tools.  It compiles just fine as you saw.  It's because we want the wineskins to work on 10.6 computers as well.  Backwards compatability is huge when the purpose of wineskin is for ditribution.
First, wineskin may offer both way. 10.6 and 10.8.
Second, AFAIK 10.6 and older systems no more exists. All users already upgraded to 10.7 as least.
Third, for compilation we can set flag "macox minimum version 10.6" even though we compile by clang in 10.10. It affects on object modules format.

#10 darklord42

darklord42

    Rookie Porter

  • Members
  • PipPipPipPip
  • 151 posts

Posted 08 April 2015 - 02:58 PM

First, If you compile for 10.6 it works for 10.6 and newer
Second, quite an assumption on your part that is not true at all.  Some people can't upgrade to 10.7.
Third,  That may be enough for the binnary to execute on 10.6 but you will still hit runtime issues because you didn't compile against 10.6 resources.  you need still need isysroot 10.6.sdk

#11 Slice

Slice

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 305 posts
  • Graphics Card:AMD Radeon HD6670, GTX650
  • Operating System:OS X 10.11 (El Capitan)
  • I like to play:Heroes III
    4x4 Evolution
    made Heroes VI working!

Posted 09 April 2015 - 09:57 AM

Yes, you are right.
Compiled by clang with SDK10.8 is not working on 10.7.
So now I returned to gcc-4.2.1+SDK10.6.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users