VOGONS


How to compile SVN on OS X in 32bit

Topic actions

First post, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

Hello there,

I can't, for the love of me, generate a 32bits executable on osx (Snow Leopard, 10.6.8 ). This is what I'm trying. First, the exports:

export CFLAGS='-I/usr/local/include -O2 -arch i386'
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export LDFLAGS='-L/usr/local/lib -O2 -arch i386'
export CC='/usr/bin/gcc-4.2 -arch i386'
export CXX='/usr/bin/g++-4.2 -arch i386'
export GCOV='/usr/bin/gcov-4.2 -arch i386'

(yes, libsdl was installed from sources in /usr/local, no macports used)

then I run ./autogen.sh in the sources root directory.
Next I run ./configure. No errors at all. But I get the following errors during the compilation process:

In file included from core_dyn_x86.cpp:181:
core_dyn_x86/risc_x86.h: In member function ‘void GenReg::Load(DynReg*, bool)’:
core_dyn_x86/risc_x86.h:60: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In member function ‘void GenReg::Save()’:
core_dyn_x86/risc_x86.h:68: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_load_host(void*, DynReg*, Bitu)’:
core_dyn_x86/risc_x86.h:310: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_mov_host(void*, DynReg*, Bitu, Bit8u)’:
core_dyn_x86/risc_x86.h:324: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_dop_byte_imm_mem(DualOps, DynReg*, Bit8u, void*)’:
core_dyn_x86/risc_x86.h:398: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_lea_imm_mem(DynReg*, DynReg*, void*)’:
core_dyn_x86/risc_x86.h:486: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_dop_word_imm_mem(DualOps, bool, DynReg*, void*)’:
core_dyn_x86/risc_x86.h:579: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_dop_word_var(DualOps, bool, DynReg*, void*)’:
core_dyn_x86/risc_x86.h:602: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_call_function(void*, const char*, ...)’:
core_dyn_x86/risc_x86.h:871: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:871: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_call_write(DynReg*, Bit32u, Bitu)’:
core_dyn_x86/risc_x86.h:943: error: cast from ‘bool (*)(PhysPt, Bit8u)’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:943: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:944: error: cast from ‘bool (*)(PhysPt, Bit16u)’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:944: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:945: error: cast from ‘bool (*)(PhysPt, Bit32u)’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h:945: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_jmp_ptr(void*, Bits)’:
core_dyn_x86/risc_x86.h:999: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_save_host_direct(void*, Bits)’:
core_dyn_x86/risc_x86.h:1030: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/risc_x86.h: In function ‘void gen_return_fast(BlockReturn, bool)’:
core_dyn_x86/risc_x86.h:1048: error: cast from ‘Bitu*’ to ‘Bit32u’ loses precision
In file included from core_dyn_x86.cpp:234:
core_dyn_x86/decoder.h: In function ‘void dyn_fill_blocks()’:
core_dyn_x86/decoder.h:406: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:409: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_read_intro(DynReg*, bool)’:
core_dyn_x86/decoder.h:491: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_read_byte(DynReg*, DynReg*, Bitu)’:
core_dyn_x86/decoder.h:509: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:521: error: cast from ‘bool (*)(PhysPt)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:521: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:529: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_read_byte_release(DynReg*, DynReg*, Bitu)’:
core_dyn_x86/decoder.h:547: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:559: error: cast from ‘bool (*)(PhysPt)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:559: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:567: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_read_word(DynReg*, DynReg*, bool)’:
core_dyn_x86/decoder.h:602: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:617: error: cast from ‘bool (*)(PhysPt)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:617: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_read_word_release(DynReg*, DynReg*, bool)’:
core_dyn_x86/decoder.h:648: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:663: error: cast from ‘bool (*)(PhysPt)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:663: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_write_intro(DynReg*, bool)’:
core_dyn_x86/decoder.h:707: error: cast from ‘void*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_write_byte(DynReg*, DynReg*, bool)’:
Show last 69 lines
core_dyn_x86/decoder.h:721: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:737: error: cast from ‘bool (*)(PhysPt, Bit8u)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:737: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_write_byte_release(DynReg*, DynReg*, bool)’:
core_dyn_x86/decoder.h:760: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:776: error: cast from ‘bool (*)(PhysPt, Bit8u)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:776: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_write_word(DynReg*, DynReg*, bool)’:
core_dyn_x86/decoder.h:804: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:820: error: cast from ‘bool (*)(PhysPt, Bit32u)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:820: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h: In function ‘void dyn_write_word_release(DynReg*, DynReg*, bool)’:
core_dyn_x86/decoder.h:853: error: cast from ‘Bit8u**’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:869: error: cast from ‘bool (*)(PhysPt, Bit32u)’ to ‘Bit32u’ loses precision
core_dyn_x86/decoder.h:869: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
In file included from core_dyn_x86/decoder.h:1974,
from core_dyn_x86.cpp:234:
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc0()’:
core_dyn_x86/dyn_fpu_dh.h:161: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc1()’:
core_dyn_x86/dyn_fpu_dh.h:179: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:187: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:193: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:200: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:206: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:211: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc2()’:
core_dyn_x86/dyn_fpu_dh.h:234: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc3()’:
core_dyn_x86/dyn_fpu_dh.h:264: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘Bitu’
core_dyn_x86/dyn_fpu_dh.h:264: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘Bitu’
core_dyn_x86/dyn_fpu_dh.h:280: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:288: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:294: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:301: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:306: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc4()’:
core_dyn_x86/dyn_fpu_dh.h:327: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc5()’:
core_dyn_x86/dyn_fpu_dh.h:345: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:353: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:359: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:366: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:371: error: cast from ‘Bit8u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:379: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc6()’:
core_dyn_x86/dyn_fpu_dh.h:400: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h: In function ‘void dh_fpu_esc7()’:
core_dyn_x86/dyn_fpu_dh.h:428: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:449: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:457: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:463: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:470: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:476: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:481: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
core_dyn_x86/dyn_fpu_dh.h:487: error: cast from ‘Bit32u*’ to ‘Bit32u’ loses precision
In file included from core_dyn_x86/decoder.h:1988,
from core_dyn_x86.cpp:234:
core_dyn_x86/dyn_fpu.h: In function ‘void dyn_fpu_esc3()’:
core_dyn_x86/dyn_fpu.h:382: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘Bitu’
core_dyn_x86/dyn_fpu.h:382: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘Bitu’
In file included from core_dyn_x86.cpp:234:
core_dyn_x86/decoder.h: In function ‘CacheBlock* CreateCacheBlock(CodePageHandler*, PhysPt, Bitu)’:
core_dyn_x86/decoder.h:2005: error: cast from ‘CacheBlock*’ to ‘Bit32u’ loses precision
make[4]: *** [core_dyn_x86.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

can you lend a hand, please?

Reply 3 of 27, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

@Dominus: SDL is in 64bits, that could be the problem. I compiled and installed 1.2.14 sources.
I'm trying to build the trunk in cvs (cloned yesterday).

@emendelson: I got the exports from your instructions, and I also run a make clean, the autogen.sh script and the configure script.

So, what are my options? Building a new, 32bit SDL and install it to another location, then pointing dosbox to it via the exports with the new routes?

Reply 4 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

If you compile SDL from trunk you need the 1.2 branch but that currently breaks fullscreen/windows.

You can also compile in 32bit and lipo the libs together so they are universal

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 27, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

Compiled SDL 1.2.14 from the tar.gz in the libsdl page, in 32bits. I have compiled this version on Linux countless times, and also compiled dosbox against it, with no problems at all.

Installed it in /usr/local32 via configure --prefix.
Pointed dosbox sources to the new 32bits sdl with the exports:

export CFLAGS='-I/usr/local32/include -O2 -arch i386'
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export LDFLAGS='-L/usr/local32/lib -O2 -arch i386'
export CC='/usr/bin/gcc-4.2 -arch i386'
export CXX='/usr/bin/g++-4.2 -arch i386'
export GCOV='/usr/bin/gcov-4.2 -arch i386'

ran make distclean.
ran autogen.sh after it.
ran ./configure --build=i386-apple-darwin10.5.0 --host=i386-apple-darwin10.5.0, because if I don't include the build and host options, it detects a 64bits building system.

But dosbox gives the same errorrs on compilation...

Reply 6 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Use the sdl-prefix option in dosbox configure as well. But strange that you need to pass build and host, never needed this on SL?

On page 2 of this thread I ran into this as well but didn't need it anymore after passing along the correct includes.

Last edited by Dominus on 2011-09-06, 10:34. Edited 1 time in total.

Reply 7 of 27, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
cast from ‘Bit32u*’ to ‘Bit32u’ loses precision 

So it assumes that a pointer is more than 32 bits. Can you post/attach the config.log file and maybe the makefile present in the directory src ?

Water flows down the stream
How to ask questions the smart way!

Reply 9 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

export CC='/usr/bin/gcc-4.2 -arch i386'
export CXX='/usr/bin/g++-4.2 -arch i386'
export GCOV='/usr/bin/gcov-4.2 -arch i386'
./autogen.sh
./configure --disable-sdltest --disable-alsatest --with-sdl-prefix=/usr/local32

*should* be enough to pass along

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 27, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

@Qbix: I'm attaching the files.

@Dominus: Same errors after that, sorry

Attachments

  • Filename
    Makefile.txt
    File size
    22.03 KiB
    Downloads
    102 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    config.log
    File size
    62.69 KiB
    Downloads
    145 downloads
    File license
    Fair use/fair dealing exception

Reply 11 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

it still thinks it is compiling for 64bit.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 14 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

And use a really clean dosbox (i'm not trusting distclean 100%). M32 shouldn't be needed on os x.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 15 of 27, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

Tried a new fresh copy of the trunk sources, exported the new CFLAGS including -m32, ran autogen.sh, configure with the sdl prefix and all, and still no luck. The same exact errors on building.

Reply 17 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

in your config log, it seems your gcc isn't passing along the "-arch i386" flag.
Can you do the exact exports I gave earlier and attach the config.log again?

Edit: as I wrote on page 2 of this thread host/build'/target are determined partyl by the compiler flags. if you don't pass the arch to the compiler binaries, averything is reset to the 64bit host. Probably not everything, hence the compiler error.

Last edited by Dominus on 2011-09-07, 12:25. Edited 1 time in total.

Reply 18 of 27, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

another odditiy, your makefile reports automake 1.11. I'm on Xcode 4.2 Preview 7 and it still comes with automake 1.10.
Where does that come from? Did you muck with Apple's development stuff? You shouldn't do that since Apple does some patching to a lot of things. Better restore it to Apple's stuff and if you want to use newer versions make your own prefix and place that bin in front of the PATH setting.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 19 of 27, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

I haven't mocked Apple's binaries, but installed automake/autoconf/libtool etc in a separate directory: Apple's binaries live in /usr/bin while mine live in /usr/local/bin. So I removed /usr/local from my /etc/paths and now I'm on Apple's default tools again, with the versions you would expect.

But I get the same error. Take a look at the updated config.log, I think it says it's configured for a i386 cpu:

Attachments

  • Filename
    config.log
    File size
    61.72 KiB
    Downloads
    214 downloads
    File license
    Fair use/fair dealing exception