Quantcast

cannot build wxpdfdocument for osx32/64 with clang on linux (cross-compilation)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cannot build wxpdfdocument for osx32/64 with clang on linux (cross-compilation)

Frédéric Bron
Hi,

Here am I again with my cross-compilation...
I want to cross-compile wxpdfdoc on linux to target osx32 or 64.
But it does not work.

I build wxwidgets with static libraries (see procedure below).
Then I try to build wxpdfdoc as follows:
CC="i386-apple-darwin13-clang"
 CFLAGS="-g3"
 CXX="i386-apple-darwin13-clang++-libc++"
 CXXFLAGS="-g3 -std=c++14"
 OBJCXXFLAGS="-g3 -std=c++14"
 AR="i386-apple-darwin13-ar"
 AS="i386-apple-darwin13-as"
 RANLIB="i386-apple-darwin13-ranlib"
 WX_CONFIG=/softs/osx32-clang-3.9.1/debug/wx/bin/wx-config
 ../wxpdfdoc-bcfcd2f/configure
 --prefix=/softs/osx32-clang-3.9.1/debug/wxpdfdoc
 --build=x86_64-unknown-linux-gnu
 --host=i386-apple-darwin13
 --enable-static
 --disable-shared
 --with-wx-config=/softs/osx32-clang-3.9.1/debug/wx/bin/wx-config
 --with-wx-prefix=/softs/osx32-clang-3.9.1/debug/wx

Some checks:
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... i386-apple-darwin13
> checking whether we are cross compiling... yes

This may be the cause of my issues:
> checking for i386-apple-darwin13-objdump... no
> checking for objdump... objdump
> configure: WARNING: using cross tools not prefixed with host triplet

My cross compiler does not come with objdump. Instead, I have
i386-apple-darwin13-ObjectDump. I also have i386-apple-darwin13-nm but
not i386-apple-darwin13-objdump.

I see that when I cross-compile wxwidgets for osx, configure does not
look for objdump.

> checking if wxWidgets was built in STATIC mode... yes
> checking which wxWidgets toolkit was selected... osx_cocoa


Then when I run make, I get:

...

  CXXLD    libwxcode_osx_cocoau_pdfdoc-3.1.la

*** Warning: Linking the shared library
libwxcode_osx_cocoau_pdfdoc-3.1.la against the
*** static library
/softs/osx32-clang-3.9.1/debug/wx/lib/libwx_osx_cocoau_core-3.1-i386-apple-darwin13.a
is not portable!

*** Warning: Linking the shared library
libwxcode_osx_cocoau_pdfdoc-3.1.la against the
*** static library
/softs/osx32-clang-3.9.1/debug/wx/lib/libwx_baseu_xml-3.1-i386-apple-darwin13.a
is not portable!

*** Warning: Linking the shared library
libwxcode_osx_cocoau_pdfdoc-3.1.la against the
*** static library
/softs/osx32-clang-3.9.1/debug/wx/lib/libwx_baseu-3.1-i386-apple-darwin13.a
is not portable!
 CXXLD    samples/minimal/minimal
libtool: link: warning: `-no-install' is ignored for i386-apple-darwin13
libtool: link: warning: assuming `-no-fast-install' instead
/softs/osx32-clang-3.9.1/debug/build/wxpdfdoc-bcfcd2f/makefont/makefont.cpp:1497:18:
warning: comparison of unsigned expression >= 0 is always true
[-Wtautological-compare]
         if (cc >= 0 && cc < 0xFFFF)
             ~~ ^  ~
ld: warning: ignoring file ./.libs/libwxcode_osx_cocoau_pdfdoc-3.1.a,
file was built for archive which is not the architecture being linked
(i386): ./.libs/libwxcode_osx_cocoau_pdfdoc-3.1.a
Undefined symbols for architecture i386:
 "wxPdfLayer::SetZoom(double, double)", referenced from:
     LayerRadioGroup(bool) in layers.o
 "wxPdfLayer::AddChild(wxPdfLayer*)", referenced from:
     GroupedLayers(bool) in layers.o
     NestedLayers(bool) in layers.o
     AutomaticLayers(bool) in layers.o
     LayerRadioGroup(bool) in layers.o
 "wxPdfLayer::SetPrint(wxString const&, bool)", referenced from:
     LayerRadioGroup(bool) in layers.o

this is followed by many other similar error messages and then:
> ld: symbol(s) not found for architecture i386
> clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

Frédéric


* Procedure to build wxwidgets:
CC="i386-apple-darwin13-clang"\
  CFLAGS="-g3" CXX="i386-apple-darwin13-clang++-libc++"\
  CXXFLAGS="-g3 -std=c++14"\
  OBJCXXFLAGS="-g3 -std=c++14"\
  ../wxwidgets-3ae438b/configure\
  --prefix=/softs/osx32-clang-3.9.1/debug/wx\
  --build=x86_64-unknown-linux-gnu\
  --host=i386-apple-darwin13\
  --disable-shared\
  ...\
  --with-cxx=14\
  --with-osx\
  --disable-optimise\
  --enable-debug

make
make install

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Loading...