b2 + iOS: weird behaviour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

b2 + iOS: weird behaviour

Boost - Build mailing list
Hi all,

I am trying to build boost for iOS/iPhone. I have found this:

https://github.com/faithfracture/Apple-Boost-BuildScript

which is nice, but I wanted to nail it down to the bare minimum. So I am
doing this:

./b2 \
   -j2 \
 
--prefix=/Users/raffi/Code/SoftwareWorkshop/sw_thirdparties/osx/boost_1_64_0_build/install
\
   toolset=clang \
   architecture=arm \
   cxxflags="-std=c++11 -stdlib=libc++ -arch armv7 -arch arm64 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk
-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG
-fvisibility=hidden -fvisibility-inlines-hidden
-Wno-unused-local-typedef -fembed-bitcode -mios-version-min=10.1"\
   define=_LITTLE_ENDIAN \
   layout=versioned \
   install

The generated static libraries are ok:

 > lipo -info ./install/lib/libboost_wserialization-clang-darwin42-mt-1_64.a
Architectures in the fat file:
./install/lib/libboost_wserialization-clang-darwin42-mt-1_64.a are:
armv7 arm64

The generated dynamic libraries are not ok:
 > lipo -info
./install/lib/libboost_wserialization-clang-darwin42-mt-1_64.dylib
Non-fat file:
./install/lib/libboost_wserialization-clang-darwin42-mt-1_64.dylib is
architecture: x86_64

This is not the right architecture.

The other strange thing is this:
 > ls -l ./install/lib/ | grep dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_atomic-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_chrono-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff      50040 Aug  7 03:18
libboost_container-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_date_time-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_filesystem-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_graph-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_iostreams-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_log-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_log_setup-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_c99-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_c99f-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_c99l-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_tr1-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_tr1f-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_math_tr1l-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_numpy-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_prg_exec_monitor-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_program_options-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_python-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_random-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_regex-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_serialization-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_signals-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_system-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_thread-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_timer-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_type_erasure-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_unit_test_framework-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_wave-clang-darwin42-mt-1_64.dylib
-rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
libboost_wserialization-clang-darwin42-mt-1_64.dylib


As you can see, all but boost.container *shared* libraries have exactly
the same size.

Inspecting the symbols gives:

 > nm -g
./install/lib/libboost_unit_test_framework-clang-darwin42-mt-1_64.dylib

                  U dyld_stub_binder

... so close to nothing.

I believe this comes from the "-fvisibility=hidden
-fvisibility-inlines-hidden" passed to clang, but I am not sure.

Questions are:
* has anyone some experience for iOS? :)
* it is relevant to build shared libraries for iOS? I believe this makes
all the process a bit more complicated, especially because of signing.
* why is this compiling the shared libraries with the wrong
architecture? I am never passing x86_64 on the command line
* why boost.container is different from the others?
* how do we do to export what is explicitly exported? I know for sure
that classes in boost.test have the proper export directive, so those
should appear at least in the exported table name

Thanks!
Raffi

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 + iOS: weird behaviour

Boost - Build mailing list
Le 08.08.17 à 13:39, Raffi Enficiaud via Boost-build a écrit :

> Hi all,
>
> I am trying to build boost for iOS/iPhone. I have found this:
>
> https://github.com/faithfracture/Apple-Boost-BuildScript
>
> which is nice, but I wanted to nail it down to the bare minimum. So I am
> doing this:
>
> ../b2 \
>   -j2 \
>
> --prefix=/Users/raffi/Code/SoftwareWorkshop/sw_thirdparties/osx/boost_1_64_0_build/install
> \
>   toolset=clang \
>   architecture=arm \
>   cxxflags="-std=c++11 -stdlib=libc++ -arch armv7 -arch arm64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk
> -DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG
> -fvisibility=hidden -fvisibility-inlines-hidden
> -Wno-unused-local-typedef -fembed-bitcode -mios-version-min=10.1"\
>   define=_LITTLE_ENDIAN \
>   layout=versioned \
>   install
>
> The generated static libraries are ok:
>
>> lipo -info ./install/lib/libboost_wserialization-clang-darwin42-mt-1_64.a
> Architectures in the fat file:
> ../install/lib/libboost_wserialization-clang-darwin42-mt-1_64.a are:
> armv7 arm64
>
> The generated dynamic libraries are not ok:
>> lipo -info
> ../install/lib/libboost_wserialization-clang-darwin42-mt-1_64.dylib
> Non-fat file:
> ../install/lib/libboost_wserialization-clang-darwin42-mt-1_64.dylib is
> architecture: x86_64
>
> This is not the right architecture.
>
> The other strange thing is this:
>> ls -l ./install/lib/ | grep dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_atomic-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_chrono-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff      50040 Aug  7 03:18
> libboost_container-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_date_time-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_filesystem-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_graph-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_iostreams-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_log-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_log_setup-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_c99-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_c99f-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_c99l-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_tr1-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_tr1f-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_math_tr1l-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_numpy-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_prg_exec_monitor-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_program_options-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_python-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_random-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_regex-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_serialization-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_signals-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_system-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_thread-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_timer-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_type_erasure-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_unit_test_framework-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_wave-clang-darwin42-mt-1_64.dylib
> -rwxr-xr-x  1 raffi  staff       4144 Aug  7 03:18
> libboost_wserialization-clang-darwin42-mt-1_64.dylib
>
>
> As you can see, all but boost.container *shared* libraries have exactly
> the same size.
>
> Inspecting the symbols gives:
>
>> nm -g
> ../install/lib/libboost_unit_test_framework-clang-darwin42-mt-1_64.dylib
>
>                  U dyld_stub_binder
>
> .... so close to nothing.
>
> I believe this comes from the "-fvisibility=hidden
> -fvisibility-inlines-hidden" passed to clang, but I am not sure.
>
> Questions are:
> * has anyone some experience for iOS? :)
> * it is relevant to build shared libraries for iOS? I believe this makes
> all the process a bit more complicated, especially because of signing.
> * why is this compiling the shared libraries with the wrong
> architecture? I am never passing x86_64 on the command line
> * why boost.container is different from the others?
> * how do we do to export what is explicitly exported? I know for sure
> that classes in boost.test have the proper export directive, so those
> should appear at least in the exported table name
>
> Thanks!
> Raffi

Anyone?



_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 + iOS: weird behaviour

Boost - Build mailing list
AMDG

On 08/12/2017 10:48 AM, Raffi Enficiaud via Boost-build wrote:
>
>> * why is this compiling the shared libraries with the wrong
>> architecture? I am never passing x86_64 on the command line

No idea, but it would help to see the clang command line
(Pass -d2 to b2 or -n to print the command line without
actually executing it).

>> * why boost.container is different from the others?
>> * how do we do to export what is explicitly exported? I know for sure
>> that classes in boost.test have the proper export directive, so those
>> should appear at least in the exported table name
>>

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 + iOS: weird behaviour

Boost - Build mailing list
Le 12.08.17 à 22:16, Steven Watanabe via Boost-build a écrit :

> AMDG
>
> On 08/12/2017 10:48 AM, Raffi Enficiaud via Boost-build wrote:
>>
>>> * why is this compiling the shared libraries with the wrong
>>> architecture? I am never passing x86_64 on the command line
>
> No idea, but it would help to see the clang command line
> (Pass -d2 to b2 or -n to print the command line without
> actually executing it).

Thanks for the answer. I am able to reproduce the issue with those
options as well. Logs available on the following link:

https://owncloud.tuebingen.mpg.de/index.php/s/jCZoDeaiyf4c2SO



>
>>> * why boost.container is different from the others?
>>> * how do we do to export what is explicitly exported? I know for sure
>>> that classes in boost.test have the proper export directive, so those
>>> should appear at least in the exported table name
>>>
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
>


_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build