Topic: Compile Mac i386 on a 64 machine

The following used to work in an old wolfSSL embedded SSL version (1.5.0)

./configure --without-zlib --enable-static --enable-shared=no CFLAGS="-arch i386 -mmacosx-version-min=10.4" LDFLAGS="-arch i386"

Now I get an error when building a lot of the binaries. Probably means that some outputs are picking up the platform override and some ignore it. Is there a new way I should be using to specify architecture?





  CCLD     testsuite/testsuite
ldld: warning: ignoring file ctaocryptld/test/:test.o , warningfile:  wasld :built  warningfor:  unsupportedignoring  filefile  formatctaocrypt /(benchmark /0xcfbenchmark.o ,0xfa  file0xed  was0xfe  built0x  for7  unsupported0x  file0  format0x  (0  0xcf0x  0xfa1  0xed0x  0xfe3  0x0x  70  0x0x  00  0x0x  00  0x0x  11  0x0x  30  0x0x  00  0x0x  00  0x)  0which  0xis  1not  0xthe  0architecture  0xbeing  0linked  0x( i3860) smile  ctaocryptwhich/ testis/ test.onot
ldthe:  architecturewarning :being  ignoringlinked  file( i386src)/:. libsctaocrypt//libcyassl.abenchmark,/ benchmark.oignoringfile  filewas  srcbuilt/ .forlibs /archivelibcyassl.a ,which  fileis  wasnot  builtthe  forarchitecture  archivebeing  whichlinked  is( i386not) :the  srcarchitecture/ .beinglibs /linkedlibcyassl.a
(Undefinedi386 )symbols:  forsrc /architecture. libsi386/:libcyassl.a


Undefined" _mainsymbols" ,for  referencedarchitecture  fromi386::

     " _main " ,start  referencedin  fromcrt1.10.6.o:

Share

Re: Compile Mac i386 on a 64 machine

Which version of wolfSSL are you using now?

Try:

$ ./configure --enable-static --disable-shared \
    C_EXTRA_FLAGS="-arch i386 -mmacosx-version-min=10.4" \
    LDFLAGS="-arch i386"

I tried this configure line on the latest pull from GitHub and it passed the make test.

CFLAGS was conflicting with something so we added C_EXTRA_FLAGS to cover the items you want to add. (I'm pretty sure that's why your configure is failing to build.) Note, we don't use ZLIB as a flag but we do have "--with-libz" as an option to add; it is disabled by default.

Re: Compile Mac i386 on a 64 machine

I got the latest version on the site 2.6.0
I still can't get it to work.
Below is what I am getting. Perhaps you are using an i386 machine to test? That would explain why I can't get it to work on a x86_64 machine (when I use -arch x86_64 all works fine).


make -j9  all-am
  CC       ctaocrypt/src/src_libcyassl_la-tfm.lo
  CC       tests/tests_unit-suites.o
  CC       tests/tests_unit-hash.o
  CC       examples/client/tests_unit-client.o
  CC       examples/server/tests_unit-server.o
  CC       src/src_libcyassl_la-internal.lo
  CC       src/src_libcyassl_la-io.lo
  CC       src/src_libcyassl_la-keys.lo
  CC       src/src_libcyassl_la-ssl.lo
  CC       src/src_libcyassl_la-tls.lo
  CC       ctaocrypt/src/src_libcyassl_la-hmac.lo
  CC       ctaocrypt/src/src_libcyassl_la-random.lo
  CC       ctaocrypt/src/src_libcyassl_la-sha256.lo
  CC       ctaocrypt/src/src_libcyassl_la-logging.lo
  CC       ctaocrypt/src/src_libcyassl_la-error.lo
  CC       ctaocrypt/src/src_libcyassl_la-memory.lo
  CC       ctaocrypt/src/src_libcyassl_la-rsa.lo
  CC       ctaocrypt/src/src_libcyassl_la-dh.lo
  CC       ctaocrypt/src/src_libcyassl_la-asn.lo
  CC       ctaocrypt/src/src_libcyassl_la-coding.lo
cc1: error in backend: Unsupported asm: input constraint with a matching output constraint of incompatible type!
make[1]: *** [ctaocrypt/src/src_libcyassl_la-tfm.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC       ctaocrypt/src/src_libcyassl_la-aes.lo
make: *** [all] Error 2

Share

Re: Compile Mac i386 on a 64 machine

You'll need to add --disable-fastmath as well since the mac gcc version no longer handles x86 assembly as well if you have to use i386 (see the note in the README under 2.6.0 ia32).  But that begs the question.  Why are you limiting to i386, is that even a possibility now?

Thanks,
-Todd

Share

Re: Compile Mac i386 on a 64 machine

It works now. thanks!

I am trying to create a universal binary that will support old macs.
Once I have i386 and the x64 version I "concatinate" them using the lipo tool.
Now I have wolfSSL that can be linked to universal binaries.

Yuval

Share