qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

Building libwebp for iOS with latest Xcode is impossible #226

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to build libwebp for iOS (using the provided iosbuild.sh script), 
and with the latest Mac OS X / Xcode this seems to be practically impossible.

Version info: libwebp 0.4.1, Mac OS X 10.9.5, Xcode 6.0.1 (clang version: Apple 
LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn).)

Firstly, when running the iosbuild.sh script, it gives an error about 
'autoreconf' not being found (Apple has dropped support). This can be fixed by 
installing the autoconf package eg. with macports.

Next it gives an error about 'aclocal' not being found. Fixed by installing 
automake.

Next it gives an error about some strange 'AC_PROG_LIBTOOL' macro being 
undefined. Fixed by installing libtool.

Now it's able to create the necessary configure script files. However, when 
running configure, it complains:

configure: error: C compiler cannot create executables

The exact error found in config.log is:

configure:3428: checking whether the C compiler works
configure:3450: gcc -arch i386 -pipe -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/De
veloper/SDKs/iPhoneSimulator8.0.sdk/ -O3 -DNDEBUG -miphoneos-version-min=5.0  
-arch i386 -pipe -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/De
veloper/SDKs/iPhoneSimulator8.0.sdk/ -miphoneos-version-min=5.0 conftest.c  >&5
Undefined symbols for architecture i386:
  "start", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(Note that with the latest Xcode, 'gcc' is just an alias for 'clang', but 
making configure run clang directly doesn't change anything.)

This is where I got stuck, as I don't know how to fix that problem.

Original issue reported on code.google.com by juha.nie...@gmail.com on 23 Sep 2014 at 9:41

GoogleCodeExporter commented 8 years ago
This is looking for the iOS simulator. If it isn't installed and you don't need 
that configuration you can remove it from the target list [1]:

declare -r PLATFORMS="iPhoneSimulator iPhoneOS-V7 iPhoneOS-V7s 
iPhoneOS-V7-arm64"

[1] 
https://gerrit.chromium.org/gerrit/gitweb?p=webm/libwebp.git;a=blob;f=iosbuild.s
h;h=32f2a6dcc4a5e51b7b9be9e926c81d4f3b9c95af;hb=refs/heads/master#l25

Original comment by jz...@google.com on 24 Sep 2014 at 12:52

GoogleCodeExporter commented 8 years ago
The iOS simulator is installed as normal, and I obviously need that 
configuration since I want to be able to use the simulator for development. (I 
do not know, however, if Xcode 6 has set up the simulator in some new way that 
confuses the configure script...)

Original comment by juha.nie...@gmail.com on 24 Sep 2014 at 10:54

GoogleCodeExporter commented 8 years ago
I didn't see anything in the release notes, but it seems the 
iphoneos-version-min (5.0) is too low for this release. Going to 6 is fine and 
I think that covers most viable iphone's still.
I uploaded a patch [1], give it a try if you get a chance.

[1] https://gerrit.chromium.org/gerrit/#/c/71660/

Original comment by jz...@google.com on 25 Sep 2014 at 2:45

GoogleCodeExporter commented 8 years ago
Changing -miphoneos-version-min to 6.0 seems to fix the configuration problem, 
as it now compiles without problems.

Original comment by juha.nie...@gmail.com on 25 Sep 2014 at 6:54

GoogleCodeExporter commented 8 years ago
I merged this:
9f7d9e6 iosbuild: make iOS 6 the minimum requirement

Thanks for the report and verifying! As I said in the change I couldn't find a 
way to avoid this flag in simulator builds, using xcrun for instance.

Original comment by jz...@google.com on 25 Sep 2014 at 10:53

GoogleCodeExporter commented 8 years ago
Note, however, that there's still the problem of the missing tools with the 
newest Xcode (ie. autoconf, automake and libtool). It may be a good idea if the 
script checked that those tools are installed and informed properly the user if 
they are not (or offered some kind of alternative).

Btw, it's strange that a minimum of 6.0 seems to be required, given that even 
the newest Xcode compiles fine for iOS 5.0 otherwise...

Original comment by juha.nie...@gmail.com on 25 Sep 2014 at 11:11

GoogleCodeExporter commented 8 years ago
> Note, however, that there's still the problem of the missing tools with the 
newest Xcode (ie. autoconf, automake and libtool). It may be a good idea if the 
script checked that those tools are installed and informed properly the user if 
they are not (or offered some kind of alternative).

Good point. It's documented for general configure use, but the script itself 
could be more helpful. I plan on adding a framework build to the next release 
which should help too.

> Btw, it's strange that a minimum of 6.0 seems to be required, given that even 
the newest Xcode compiles fine for iOS 5.0 otherwise...

That might be worth some investigation. Before posting the patch I removed the 
simulator and all was well, so only it may be affected in this release.

Original comment by jz...@google.com on 26 Sep 2014 at 3:31

GoogleCodeExporter commented 8 years ago
Sorry for the long delay, but have been busy with other projects.

Version 0.4.2 compiles and works fine for the latest Xcode, except that the 
64-bit simulator version is not compiled into the framework. This causes a 
linker error when trying to compile a 64-bit version for the simulator.

I fixed this by editing iosbuild.sh and adding a name like "iPhoneSimulator-64" 
to the PLATFORMS variable, and then adding these lines in the "for PLATFORM 
..." loop:

  elif [[ "${PLATFORM}" == "iPhoneSimulator-64" ]]; then
    PLATFORM="iPhoneSimulator";
    ARCH="x86_64"

Original comment by juha.nie...@gmail.com on 9 Dec 2014 at 4:19

GoogleCodeExporter commented 8 years ago
Thanks. This was added to the master branch recently and will be available in 
the next release:

commit a96ccf8fdece8ea32d20406bd0c028545ec8534f
Author: James Zern <jzern@google.com>
Date:   Fri Nov 14 16:38:42 2014 -0800

    iosbuild: add x64_64 simulator support

    based on the patch here:
    https://github.com/pixelkind/webp-ios-build

    Change-Id: Iaa346b751e5f18e8cf13a8e5c4064b0c2a3f5f6c

Original comment by jz...@google.com on 10 Dec 2014 at 3:18

GoogleCodeExporter commented 8 years ago
Hi,

I am trying to create vpx frame work by running the iosbuild.sh but I am 
getting error when I am trying to run iosbuild.sh with extra arguments. Below 
is the command what I have used and error what I am getting. Help to fix this 
error, thanks in advance.

dsp-videos-Mac-mini-5:~ dsp_video$ cd 
/Users/dsp_video/Desktop/vp8_64bit_git/vpx_frame_wrok/new 
dsp-videos-Mac-mini-5:new dsp_video$ cd libvpx
dsp-videos-Mac-mini-5:libvpx dsp_video$ cd framework
dsp-videos-Mac-mini-5:framework dsp_video$ ../build/make/iosbuild.sh 
--extra-configure-args="--enable-error-concealment"
  Usage: iosbuild.sh [arguments]
    --help: Display this message and exit.
    --extra-configure-args <args>: Extra args to pass when configuring libvpx.
    --jobs: Number of make jobs.
    --preserve-build-output: Do not delete the build directory.
    --show-build-output: Show output from each library build.
    --targets <targets>: Override default target list. Defaults:
         arm64-darwin-gcc
         armv7-darwin-gcc
         armv7s-darwin-gcc
         x86-iphonesimulator-gcc
         x86_64-iphonesimulator-gcc
    --verbose: Output information about the environment and each stage of the
               build.
iosbuild.sh failed because: build exited with error (1)

Original comment by neelufar...@gmail.com on 15 Dec 2014 at 6:23

GoogleCodeExporter commented 8 years ago
The above output is from libvpx's build script, this bug is for libwebp. You 
can post a bug to code.google.com/p/webm or post a mail to 
webm-discuss@webmproject.org.

Original comment by jz...@google.com on 16 Dec 2014 at 1:32